OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ |
7 | 7 |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
11 #include "build/build_config.h" | 11 #include "build/build_config.h" |
12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" | 12 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h" |
13 #include "ui/views/context_menu_controller.h" | 13 #include "ui/views/context_menu_controller.h" |
| 14 #include "ui/views/controls/button/menu_button.h" |
14 #include "ui/views/widget/widget.h" | 15 #include "ui/views/widget/widget.h" |
15 | 16 |
16 class BrowserRootView; | 17 class BrowserRootView; |
17 class BrowserView; | 18 class BrowserView; |
18 class NativeBrowserFrame; | 19 class NativeBrowserFrame; |
19 class NonClientFrameView; | 20 class NonClientFrameView; |
20 class SystemMenuModelBuilder; | 21 class SystemMenuModelBuilder; |
21 | 22 |
22 namespace content { | 23 namespace content { |
23 struct NativeWebKeyboardEvent; | 24 struct NativeWebKeyboardEvent; |
(...skipping 24 matching lines...) Expand all Loading... |
48 | 49 |
49 static const gfx::FontList& GetTitleFontList(); | 50 static const gfx::FontList& GetTitleFontList(); |
50 | 51 |
51 // Initialize the frame (creates the underlying native window). | 52 // Initialize the frame (creates the underlying native window). |
52 void InitBrowserFrame(); | 53 void InitBrowserFrame(); |
53 | 54 |
54 // Determine the distance of the left edge of the minimize button from the | 55 // Determine the distance of the left edge of the minimize button from the |
55 // left edge of the window. Used in our Non-Client View's Layout. | 56 // left edge of the window. Used in our Non-Client View's Layout. |
56 int GetMinimizeButtonOffset() const; | 57 int GetMinimizeButtonOffset() const; |
57 | 58 |
| 59 // Returns the height of the minimize button. |
| 60 int GetMinimizeButtonHeight() const; |
| 61 |
58 // Retrieves the bounds, in non-client view coordinates for the specified | 62 // Retrieves the bounds, in non-client view coordinates for the specified |
59 // TabStrip view. | 63 // TabStrip view. |
60 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; | 64 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const; |
61 | 65 |
62 // Returns the inset of the topmost view in the client view from the top of | 66 // Returns the inset of the topmost view in the client view from the top of |
63 // the non-client view. The topmost view depends on the window type. The | 67 // the non-client view. The topmost view depends on the window type. The |
64 // topmost view is the tab strip for tabbed browser windows, the toolbar for | 68 // topmost view is the tab strip for tabbed browser windows, the toolbar for |
65 // popups, the web contents for app windows and varies for fullscreen windows. | 69 // popups, the web contents for app windows and varies for fullscreen windows. |
66 // If |restored| is true, this is calculated as if the window was restored, | 70 // If |restored| is true, this is calculated as if the window was restored, |
67 // regardless of its current state. | 71 // regardless of its current state. |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 void SchedulePaintInRect(const gfx::Rect& rect) override; | 112 void SchedulePaintInRect(const gfx::Rect& rect) override; |
109 void OnNativeWidgetActivationChanged(bool active) override; | 113 void OnNativeWidgetActivationChanged(bool active) override; |
110 void OnNativeWidgetWorkspaceChanged() override; | 114 void OnNativeWidgetWorkspaceChanged() override; |
111 void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override; | 115 void OnNativeThemeUpdated(ui::NativeTheme* observed_theme) override; |
112 | 116 |
113 // Overridden from views::ContextMenuController: | 117 // Overridden from views::ContextMenuController: |
114 void ShowContextMenuForView(views::View* source, | 118 void ShowContextMenuForView(views::View* source, |
115 const gfx::Point& p, | 119 const gfx::Point& p, |
116 ui::MenuSourceType source_type) override; | 120 ui::MenuSourceType source_type) override; |
117 | 121 |
118 views::View* GetNewAvatarMenuButton(); | 122 views::MenuButton* GetNewAvatarMenuButton(); |
119 | 123 |
120 // Returns the menu model. BrowserFrame owns the returned model. | 124 // Returns the menu model. BrowserFrame owns the returned model. |
121 // Note that in multi user mode this will upon each call create a new model. | 125 // Note that in multi user mode this will upon each call create a new model. |
122 ui::MenuModel* GetSystemMenuModel(); | 126 ui::MenuModel* GetSystemMenuModel(); |
123 | 127 |
124 private: | 128 private: |
125 // Callback for MenuModelAdapter. | 129 // Callback for MenuModelAdapter. |
126 void OnMenuClosed(); | 130 void OnMenuClosed(); |
127 | 131 |
128 NativeBrowserFrame* native_browser_frame_; | 132 NativeBrowserFrame* native_browser_frame_; |
(...skipping 14 matching lines...) Expand all Loading... |
143 // Used to show the system menu. Only used if | 147 // Used to show the system menu. Only used if |
144 // NativeBrowserFrame::UsesNativeSystemMenu() returns false. | 148 // NativeBrowserFrame::UsesNativeSystemMenu() returns false. |
145 std::unique_ptr<views::MenuRunner> menu_runner_; | 149 std::unique_ptr<views::MenuRunner> menu_runner_; |
146 | 150 |
147 std::unique_ptr<ui::EventHandler> browser_command_handler_; | 151 std::unique_ptr<ui::EventHandler> browser_command_handler_; |
148 | 152 |
149 DISALLOW_COPY_AND_ASSIGN(BrowserFrame); | 153 DISALLOW_COPY_AND_ASSIGN(BrowserFrame); |
150 }; | 154 }; |
151 | 155 |
152 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ | 156 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ |
OLD | NEW |