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/tabs/tab_utils.h" | 13 #include "chrome/browser/ui/tabs/tab_utils.h" |
14 #include "chrome/common/features.h" | 14 #include "chrome/common/features.h" |
15 #include "components/bookmarks/browser/bookmark_model.h" | 15 #include "components/bookmarks/browser/bookmark_model.h" |
16 #include "components/security_state/security_state_model.h" | |
17 #include "ui/base/ui_base_types.h" | 16 #include "ui/base/ui_base_types.h" |
18 | 17 |
19 class Browser; | 18 class Browser; |
20 @class BrowserWindowController; | 19 @class BrowserWindowController; |
21 @class FindBarCocoaController; | 20 @class FindBarCocoaController; |
22 @class NSEvent; | 21 @class NSEvent; |
23 @class NSMenu; | 22 @class NSMenu; |
24 @class NSWindow; | 23 @class NSWindow; |
25 | 24 |
26 namespace extensions { | 25 namespace extensions { |
27 class ActiveTabPermissionGranter; | 26 class ActiveTabPermissionGranter; |
28 class Command; | 27 class Command; |
29 class Extension; | 28 class Extension; |
30 } | 29 } |
31 | 30 |
| 31 namespace security_state { |
| 32 struct SecurityInfo; |
| 33 } // namespace security_state |
| 34 |
32 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and | 35 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and |
33 // the Cocoa NSWindow. Cross-platform code will interact with this object when | 36 // the Cocoa NSWindow. Cross-platform code will interact with this object when |
34 // it needs to manipulate the window. | 37 // it needs to manipulate the window. |
35 | 38 |
36 class BrowserWindowCocoa | 39 class BrowserWindowCocoa |
37 : public BrowserWindow, | 40 : public BrowserWindow, |
38 public extensions::ExtensionKeybindingRegistry::Delegate { | 41 public extensions::ExtensionKeybindingRegistry::Delegate { |
39 public: | 42 public: |
40 BrowserWindowCocoa(Browser* browser, | 43 BrowserWindowCocoa(Browser* browser, |
41 BrowserWindowController* controller); | 44 BrowserWindowController* controller); |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 void ConfirmBrowserCloseWithPendingDownloads( | 125 void ConfirmBrowserCloseWithPendingDownloads( |
123 int download_count, | 126 int download_count, |
124 Browser::DownloadClosePreventionType dialog_type, | 127 Browser::DownloadClosePreventionType dialog_type, |
125 bool app_modal, | 128 bool app_modal, |
126 const base::Callback<void(bool)>& callback) override; | 129 const base::Callback<void(bool)>& callback) override; |
127 void UserChangedTheme() override; | 130 void UserChangedTheme() override; |
128 void ShowWebsiteSettings( | 131 void ShowWebsiteSettings( |
129 Profile* profile, | 132 Profile* profile, |
130 content::WebContents* web_contents, | 133 content::WebContents* web_contents, |
131 const GURL& virtual_url, | 134 const GURL& virtual_url, |
132 const security_state::SecurityStateModel::SecurityInfo& security_info) | 135 const security_state::SecurityInfo& security_info) override; |
133 override; | |
134 void ShowAppMenu() override; | 136 void ShowAppMenu() override; |
135 bool PreHandleKeyboardEvent(const content::NativeWebKeyboardEvent& event, | 137 bool PreHandleKeyboardEvent(const content::NativeWebKeyboardEvent& event, |
136 bool* is_keyboard_shortcut) override; | 138 bool* is_keyboard_shortcut) override; |
137 void HandleKeyboardEvent( | 139 void HandleKeyboardEvent( |
138 const content::NativeWebKeyboardEvent& event) override; | 140 const content::NativeWebKeyboardEvent& event) override; |
139 void CutCopyPaste(int command_id) override; | 141 void CutCopyPaste(int command_id) override; |
140 WindowOpenDisposition GetDispositionForPopupBounds( | 142 WindowOpenDisposition GetDispositionForPopupBounds( |
141 const gfx::Rect& bounds) override; | 143 const gfx::Rect& bounds) override; |
142 FindBar* CreateFindBar() override; | 144 FindBar* CreateFindBar() override; |
143 web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost() | 145 web_modal::WebContentsModalDialogHost* GetWebContentsModalDialogHost() |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
190 ui::WindowShowState initial_show_state_; | 192 ui::WindowShowState initial_show_state_; |
191 NSInteger attention_request_id_; // identifier from requestUserAttention | 193 NSInteger attention_request_id_; // identifier from requestUserAttention |
192 | 194 |
193 // Preserves window alert state to show appropriate icon in the window title | 195 // Preserves window alert state to show appropriate icon in the window title |
194 // which can be audio playing, muting or none (determined by alert state of | 196 // which can be audio playing, muting or none (determined by alert state of |
195 // tabs. | 197 // tabs. |
196 TabAlertState alert_state_; | 198 TabAlertState alert_state_; |
197 }; | 199 }; |
198 | 200 |
199 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 201 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |