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_COCOA_BROWSER_WINDOW_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
7 | 7 |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 10 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
11 #include "chrome/browser/signin/chrome_signin_helper.h" | 11 #include "chrome/browser/signin/chrome_signin_helper.h" |
12 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
13 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | |
14 #include "chrome/browser/ui/search/search_model_observer.h" | 13 #include "chrome/browser/ui/search/search_model_observer.h" |
15 #include "chrome/browser/ui/tabs/tab_utils.h" | 14 #include "chrome/browser/ui/tabs/tab_utils.h" |
16 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
17 #include "components/security_state/security_state_model.h" | 16 #include "components/security_state/security_state_model.h" |
18 #include "ui/base/ui_base_types.h" | 17 #include "ui/base/ui_base_types.h" |
19 | 18 |
20 class Browser; | 19 class Browser; |
21 @class BrowserWindowController; | 20 @class BrowserWindowController; |
22 @class FindBarCocoaController; | 21 @class FindBarCocoaController; |
23 @class NSEvent; | 22 @class NSEvent; |
24 @class NSMenu; | 23 @class NSMenu; |
25 @class NSWindow; | 24 @class NSWindow; |
26 | 25 |
27 namespace extensions { | 26 namespace extensions { |
28 class ActiveTabPermissionGranter; | 27 class ActiveTabPermissionGranter; |
29 class Command; | 28 class Command; |
30 class Extension; | 29 class Extension; |
31 } | 30 } |
32 | 31 |
33 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and | 32 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and |
34 // the Cocoa NSWindow. Cross-platform code will interact with this object when | 33 // the Cocoa NSWindow. Cross-platform code will interact with this object when |
35 // it needs to manipulate the window. | 34 // it needs to manipulate the window. |
36 | 35 |
37 class BrowserWindowCocoa | 36 class BrowserWindowCocoa |
38 : public BrowserWindow, | 37 : public BrowserWindow, |
39 public ExclusiveAccessContext, | |
40 public extensions::ExtensionKeybindingRegistry::Delegate, | 38 public extensions::ExtensionKeybindingRegistry::Delegate, |
41 public SearchModelObserver { | 39 public SearchModelObserver { |
42 public: | 40 public: |
43 BrowserWindowCocoa(Browser* browser, | 41 BrowserWindowCocoa(Browser* browser, |
44 BrowserWindowController* controller); | 42 BrowserWindowController* controller); |
45 ~BrowserWindowCocoa() override; | 43 ~BrowserWindowCocoa() override; |
46 | 44 |
47 // Overridden from BrowserWindow | 45 // Overridden from BrowserWindow |
48 void Show() override; | 46 void Show() override; |
49 void ShowInactive() override; | 47 void ShowInactive() override; |
(...skipping 21 matching lines...) Expand all Loading... |
71 int reason) override; | 69 int reason) override; |
72 void ZoomChangedForActiveTab(bool can_show_bubble) override; | 70 void ZoomChangedForActiveTab(bool can_show_bubble) override; |
73 gfx::Rect GetRestoredBounds() const override; | 71 gfx::Rect GetRestoredBounds() const override; |
74 ui::WindowShowState GetRestoredState() const override; | 72 ui::WindowShowState GetRestoredState() const override; |
75 gfx::Rect GetBounds() const override; | 73 gfx::Rect GetBounds() const override; |
76 bool IsMaximized() const override; | 74 bool IsMaximized() const override; |
77 bool IsMinimized() const override; | 75 bool IsMinimized() const override; |
78 void Maximize() override; | 76 void Maximize() override; |
79 void Minimize() override; | 77 void Minimize() override; |
80 void Restore() override; | 78 void Restore() override; |
81 void EnterFullscreen(const GURL& url, | |
82 ExclusiveAccessBubbleType type, | |
83 bool with_toolbar) override; | |
84 void ExitFullscreen() override; | |
85 void UpdateExclusiveAccessExitBubbleContent( | |
86 const GURL& url, | |
87 ExclusiveAccessBubbleType bubble_type) override; | |
88 void OnExclusiveAccessUserInput() override; | |
89 bool ShouldHideUIForFullscreen() const override; | 79 bool ShouldHideUIForFullscreen() const override; |
90 bool IsFullscreen() const override; | 80 bool IsFullscreen() const override; |
91 bool IsFullscreenBubbleVisible() const override; | 81 bool IsFullscreenBubbleVisible() const override; |
92 bool SupportsFullscreenWithToolbar() const override; | |
93 void UpdateFullscreenWithToolbar(bool with_toolbar) override; | |
94 void ToggleFullscreenToolbar() override; | |
95 bool IsFullscreenWithToolbar() const override; | |
96 bool ShouldHideFullscreenToolbar() const override; | |
97 LocationBar* GetLocationBar() const override; | 82 LocationBar* GetLocationBar() const override; |
98 void SetFocusToLocationBar(bool select_all) override; | 83 void SetFocusToLocationBar(bool select_all) override; |
99 void UpdateReloadStopState(bool is_loading, bool force) override; | 84 void UpdateReloadStopState(bool is_loading, bool force) override; |
100 void UpdateToolbar(content::WebContents* contents) override; | 85 void UpdateToolbar(content::WebContents* contents) override; |
101 void ResetToolbarTabState(content::WebContents* contents) override; | 86 void ResetToolbarTabState(content::WebContents* contents) override; |
102 void FocusToolbar() override; | 87 void FocusToolbar() override; |
103 ToolbarActionsBar* GetToolbarActionsBar() override; | 88 ToolbarActionsBar* GetToolbarActionsBar() override; |
104 void ToolbarSizeChanged(bool is_animating) override; | 89 void ToolbarSizeChanged(bool is_animating) override; |
105 void FocusAppMenu() override; | 90 void FocusAppMenu() override; |
106 void FocusBookmarksToolbar() override; | 91 void FocusBookmarksToolbar() override; |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 const signin::ManageAccountsParams& manage_accounts_params, | 148 const signin::ManageAccountsParams& manage_accounts_params, |
164 signin_metrics::AccessPoint access_point) override; | 149 signin_metrics::AccessPoint access_point) override; |
165 void ShowModalSigninWindow(AvatarBubbleMode mode, | 150 void ShowModalSigninWindow(AvatarBubbleMode mode, |
166 signin_metrics::AccessPoint access_point) override; | 151 signin_metrics::AccessPoint access_point) override; |
167 void CloseModalSigninWindow() override; | 152 void CloseModalSigninWindow() override; |
168 int GetRenderViewHeightInsetWithDetachedBookmarkBar() override; | 153 int GetRenderViewHeightInsetWithDetachedBookmarkBar() override; |
169 void ExecuteExtensionCommand(const extensions::Extension* extension, | 154 void ExecuteExtensionCommand(const extensions::Extension* extension, |
170 const extensions::Command& command) override; | 155 const extensions::Command& command) override; |
171 ExclusiveAccessContext* GetExclusiveAccessContext() override; | 156 ExclusiveAccessContext* GetExclusiveAccessContext() override; |
172 | 157 |
173 // ExclusiveAccessContext interface | |
174 Profile* GetProfile() override; | |
175 content::WebContents* GetActiveWebContents() override; | |
176 void UnhideDownloadShelf() override; | |
177 void HideDownloadShelf() override; | |
178 | |
179 // Overridden from ExtensionKeybindingRegistry::Delegate: | 158 // Overridden from ExtensionKeybindingRegistry::Delegate: |
180 extensions::ActiveTabPermissionGranter* GetActiveTabPermissionGranter() | 159 extensions::ActiveTabPermissionGranter* GetActiveTabPermissionGranter() |
181 override; | 160 override; |
182 | 161 |
183 // Overridden from SearchModelObserver: | 162 // Overridden from SearchModelObserver: |
184 void ModelChanged(const SearchModel::State& old_state, | 163 void ModelChanged(const SearchModel::State& old_state, |
185 const SearchModel::State& new_state) override; | 164 const SearchModel::State& new_state) override; |
186 | 165 |
187 // Adds the given FindBar cocoa controller to this browser window. | 166 // Adds the given FindBar cocoa controller to this browser window. |
188 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); | 167 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); |
(...skipping 24 matching lines...) Expand all Loading... |
213 ui::WindowShowState initial_show_state_; | 192 ui::WindowShowState initial_show_state_; |
214 NSInteger attention_request_id_; // identifier from requestUserAttention | 193 NSInteger attention_request_id_; // identifier from requestUserAttention |
215 | 194 |
216 // Preserves window media state to show appropriate icon in the window title | 195 // Preserves window media state to show appropriate icon in the window title |
217 // which can be audio playing, muting or none (determined by media state of | 196 // which can be audio playing, muting or none (determined by media state of |
218 // tabs. | 197 // tabs. |
219 TabMediaState media_state_; | 198 TabMediaState media_state_; |
220 }; | 199 }; |
221 | 200 |
222 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 201 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |