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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/memory/scoped_nsobject.h" | 9 #include "base/memory/scoped_nsobject.h" |
10 #include "base/memory/weak_ptr.h" | 10 #include "base/memory/weak_ptr.h" |
11 #include "chrome/browser/bookmarks/bookmark_model.h" | 11 #include "chrome/browser/bookmarks/bookmark_model.h" |
12 #include "chrome/browser/prefs/pref_change_registrar.h" | 12 #include "chrome/browser/prefs/pref_change_registrar.h" |
13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
14 #include "content/public/browser/notification_registrar.h" | 14 #include "content/public/browser/notification_registrar.h" |
15 #include "ui/base/ui_base_types.h" | 15 #include "ui/base/ui_base_types.h" |
16 | 16 |
17 class Browser; | 17 class Browser; |
18 @class BrowserWindowController; | 18 @class BrowserWindowController; |
19 @class FindBarCocoaController; | 19 @class FindBarCocoaController; |
20 @class NSEvent; | 20 @class NSEvent; |
21 @class NSMenu; | 21 @class NSMenu; |
22 @class NSWindow; | 22 @class NSWindow; |
23 | 23 |
| 24 namespace extensions { |
| 25 class Extension; |
| 26 } |
| 27 |
24 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and | 28 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and |
25 // the Cocoa NSWindow. Cross-platform code will interact with this object when | 29 // the Cocoa NSWindow. Cross-platform code will interact with this object when |
26 // it needs to manipulate the window. | 30 // it needs to manipulate the window. |
27 | 31 |
28 class BrowserWindowCocoa : public BrowserWindow, | 32 class BrowserWindowCocoa : public BrowserWindow, |
29 public content::NotificationObserver { | 33 public content::NotificationObserver { |
30 public: | 34 public: |
31 BrowserWindowCocoa(Browser* browser, | 35 BrowserWindowCocoa(Browser* browser, |
32 BrowserWindowController* controller); | 36 BrowserWindowController* controller); |
33 virtual ~BrowserWindowCocoa(); | 37 virtual ~BrowserWindowCocoa(); |
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
116 virtual void ShowAppMenu() OVERRIDE; | 120 virtual void ShowAppMenu() OVERRIDE; |
117 virtual bool PreHandleKeyboardEvent( | 121 virtual bool PreHandleKeyboardEvent( |
118 const content::NativeWebKeyboardEvent& event, | 122 const content::NativeWebKeyboardEvent& event, |
119 bool* is_keyboard_shortcut) OVERRIDE; | 123 bool* is_keyboard_shortcut) OVERRIDE; |
120 virtual void HandleKeyboardEvent( | 124 virtual void HandleKeyboardEvent( |
121 const content::NativeWebKeyboardEvent& event) OVERRIDE; | 125 const content::NativeWebKeyboardEvent& event) OVERRIDE; |
122 virtual void ShowCreateWebAppShortcutsDialog( | 126 virtual void ShowCreateWebAppShortcutsDialog( |
123 TabContentsWrapper* tab_contents) OVERRIDE; | 127 TabContentsWrapper* tab_contents) OVERRIDE; |
124 virtual void ShowCreateChromeAppShortcutsDialog( | 128 virtual void ShowCreateChromeAppShortcutsDialog( |
125 Profile* profile, | 129 Profile* profile, |
126 const Extension* app) OVERRIDE; | 130 const extensions::Extension* app) OVERRIDE; |
127 virtual void Cut() OVERRIDE; | 131 virtual void Cut() OVERRIDE; |
128 virtual void Copy() OVERRIDE; | 132 virtual void Copy() OVERRIDE; |
129 virtual void Paste() OVERRIDE; | 133 virtual void Paste() OVERRIDE; |
130 virtual void OpenTabpose() OVERRIDE; | 134 virtual void OpenTabpose() OVERRIDE; |
131 virtual void EnterPresentationMode( | 135 virtual void EnterPresentationMode( |
132 const GURL& url, | 136 const GURL& url, |
133 FullscreenExitBubbleType bubble_type) OVERRIDE; | 137 FullscreenExitBubbleType bubble_type) OVERRIDE; |
134 virtual void ExitPresentationMode() OVERRIDE; | 138 virtual void ExitPresentationMode() OVERRIDE; |
135 virtual bool InPresentationMode() OVERRIDE; | 139 virtual bool InPresentationMode() OVERRIDE; |
136 virtual void ShowInstant(TabContentsWrapper* preview) OVERRIDE; | 140 virtual void ShowInstant(TabContentsWrapper* preview) OVERRIDE; |
(...skipping 27 matching lines...) Expand all Loading... |
164 PrefChangeRegistrar pref_change_registrar_; | 168 PrefChangeRegistrar pref_change_registrar_; |
165 Browser* browser_; // weak, owned by controller | 169 Browser* browser_; // weak, owned by controller |
166 BrowserWindowController* controller_; // weak, owns us | 170 BrowserWindowController* controller_; // weak, owns us |
167 base::WeakPtrFactory<Browser> confirm_close_factory_; | 171 base::WeakPtrFactory<Browser> confirm_close_factory_; |
168 scoped_nsobject<NSString> pending_window_title_; | 172 scoped_nsobject<NSString> pending_window_title_; |
169 ui::WindowShowState initial_show_state_; | 173 ui::WindowShowState initial_show_state_; |
170 NSInteger attention_request_id_; // identifier from requestUserAttention | 174 NSInteger attention_request_id_; // identifier from requestUserAttention |
171 }; | 175 }; |
172 | 176 |
173 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 177 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |