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/prefs/pref_member.h" | 10 #include "base/prefs/pref_member.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 class MenuRunner; | 36 class MenuRunner; |
37 class View; | 37 class View; |
38 } | 38 } |
39 | 39 |
40 // This is a virtual interface that allows system specific browser frames. | 40 // This is a virtual interface that allows system specific browser frames. |
41 class BrowserFrame | 41 class BrowserFrame |
42 : public views::Widget, | 42 : public views::Widget, |
43 public views::ContextMenuController { | 43 public views::ContextMenuController { |
44 public: | 44 public: |
45 explicit BrowserFrame(BrowserView* browser_view); | 45 explicit BrowserFrame(BrowserView* browser_view); |
46 virtual ~BrowserFrame(); | 46 ~BrowserFrame() override; |
47 | 47 |
48 static const gfx::FontList& GetTitleFontList(); | 48 static const gfx::FontList& GetTitleFontList(); |
49 | 49 |
50 // Initialize the frame (creates the underlying native window). | 50 // Initialize the frame (creates the underlying native window). |
51 void InitBrowserFrame(); | 51 void InitBrowserFrame(); |
52 | 52 |
53 // Sets the ThemeProvider returned from GetThemeProvider(). | 53 // Sets the ThemeProvider returned from GetThemeProvider(). |
54 void SetThemeProvider(scoped_ptr<ui::ThemeProvider> provider); | 54 void SetThemeProvider(scoped_ptr<ui::ThemeProvider> provider); |
55 | 55 |
56 // Determine the distance of the left edge of the minimize button from the | 56 // Determine the distance of the left edge of the minimize button from the |
(...skipping 23 matching lines...) Expand all Loading... |
80 bool UseCustomFrame() const; | 80 bool UseCustomFrame() const; |
81 | 81 |
82 // Returns true when the window placement should be saved. | 82 // Returns true when the window placement should be saved. |
83 bool ShouldSaveWindowPlacement() const; | 83 bool ShouldSaveWindowPlacement() const; |
84 | 84 |
85 // Retrieves the window placement (show state and bounds) for restoring. | 85 // Retrieves the window placement (show state and bounds) for restoring. |
86 void GetWindowPlacement(gfx::Rect* bounds, | 86 void GetWindowPlacement(gfx::Rect* bounds, |
87 ui::WindowShowState* show_state) const; | 87 ui::WindowShowState* show_state) const; |
88 | 88 |
89 // Overridden from views::Widget: | 89 // Overridden from views::Widget: |
90 virtual views::internal::RootView* CreateRootView() override; | 90 views::internal::RootView* CreateRootView() override; |
91 virtual views::NonClientFrameView* CreateNonClientFrameView() override; | 91 views::NonClientFrameView* CreateNonClientFrameView() override; |
92 virtual bool GetAccelerator(int command_id, | 92 bool GetAccelerator(int command_id, |
93 ui::Accelerator* accelerator) const override; | 93 ui::Accelerator* accelerator) const override; |
94 virtual ui::ThemeProvider* GetThemeProvider() const override; | 94 ui::ThemeProvider* GetThemeProvider() const override; |
95 virtual void SchedulePaintInRect(const gfx::Rect& rect) override; | 95 void SchedulePaintInRect(const gfx::Rect& rect) override; |
96 virtual void OnNativeWidgetActivationChanged(bool active) override; | 96 void OnNativeWidgetActivationChanged(bool active) override; |
97 | 97 |
98 // Overridden from views::ContextMenuController: | 98 // Overridden from views::ContextMenuController: |
99 virtual void ShowContextMenuForView(views::View* source, | 99 void ShowContextMenuForView(views::View* source, |
100 const gfx::Point& p, | 100 const gfx::Point& p, |
101 ui::MenuSourceType source_type) override; | 101 ui::MenuSourceType source_type) override; |
102 | 102 |
103 // Returns true if we should leave any offset at the frame caption. Typically | 103 // Returns true if we should leave any offset at the frame caption. Typically |
104 // when the frame is maximized/full screen we want to leave no offset at the | 104 // when the frame is maximized/full screen we want to leave no offset at the |
105 // top. | 105 // top. |
106 bool ShouldLeaveOffsetNearTopBorder(); | 106 bool ShouldLeaveOffsetNearTopBorder(); |
107 | 107 |
108 AvatarMenuButton* GetAvatarMenuButton(); | 108 AvatarMenuButton* GetAvatarMenuButton(); |
109 | 109 |
110 NewAvatarButton* GetNewAvatarMenuButton(); | 110 NewAvatarButton* GetNewAvatarMenuButton(); |
111 | 111 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 | 145 |
146 // Whether the custom Chrome frame preference is set. | 146 // Whether the custom Chrome frame preference is set. |
147 BooleanPrefMember use_custom_frame_pref_; | 147 BooleanPrefMember use_custom_frame_pref_; |
148 | 148 |
149 scoped_ptr<ui::EventHandler> browser_command_handler_; | 149 scoped_ptr<ui::EventHandler> browser_command_handler_; |
150 | 150 |
151 DISALLOW_COPY_AND_ASSIGN(BrowserFrame); | 151 DISALLOW_COPY_AND_ASSIGN(BrowserFrame); |
152 }; | 152 }; |
153 | 153 |
154 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ | 154 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_ |
OLD | NEW |