menu_layout.h 908 B

123456789101112131415161718192021222324252627282930313233343536
  1. // Copyright (c) 2014 GitHub, Inc.
  2. // Use of this source code is governed by the MIT license that can be
  3. // found in the LICENSE file.
  4. #ifndef ATOM_BROWSER_UI_VIEWS_MENU_LAYOUT_H_
  5. #define ATOM_BROWSER_UI_VIEWS_MENU_LAYOUT_H_
  6. #include "ui/views/layout/fill_layout.h"
  7. namespace atom {
  8. class NativeWindowViews;
  9. class MenuLayout : public views::FillLayout {
  10. public:
  11. MenuLayout(NativeWindowViews* window, int menu_height);
  12. virtual ~MenuLayout();
  13. // views::LayoutManager:
  14. void Layout(views::View* host) override;
  15. gfx::Size GetPreferredSize(const views::View* host) const override;
  16. int GetPreferredHeightForWidth(
  17. const views::View* host, int width) const override;
  18. private:
  19. bool HasMenu(const views::View* host) const;
  20. NativeWindowViews* window_;
  21. int menu_height_;
  22. DISALLOW_COPY_AND_ASSIGN(MenuLayout);
  23. };
  24. } // namespace atom
  25. #endif // ATOM_BROWSER_UI_VIEWS_MENU_LAYOUT_H_