Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(992)

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.h

Issue 11308295: Revert 170483 - Remove PrefObserver usages, batch 12. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/memory/scoped_nsobject.h" 8 #include "base/memory/scoped_nsobject.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "base/prefs/public/pref_change_registrar.h" 10 #include "base/prefs/public/pref_change_registrar.h"
11 #include "base/prefs/public/pref_observer.h"
11 #include "chrome/browser/bookmarks/bookmark_model.h" 12 #include "chrome/browser/bookmarks/bookmark_model.h"
12 #include "chrome/browser/extensions/extension_keybinding_registry.h" 13 #include "chrome/browser/extensions/extension_keybinding_registry.h"
13 #include "chrome/browser/ui/browser_window.h" 14 #include "chrome/browser/ui/browser_window.h"
14 #include "ui/base/ui_base_types.h" 15 #include "ui/base/ui_base_types.h"
15 16
16 class Browser; 17 class Browser;
17 @class BrowserWindowController; 18 @class BrowserWindowController;
18 @class FindBarCocoaController; 19 @class FindBarCocoaController;
19 @class NSEvent; 20 @class NSEvent;
20 @class NSMenu; 21 @class NSMenu;
21 @class NSWindow; 22 @class NSWindow;
22 23
23 namespace extensions { 24 namespace extensions {
24 class ActiveTabPermissionGranter; 25 class ActiveTabPermissionGranter;
25 class Extension; 26 class Extension;
26 } 27 }
27 28
28 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and 29 // An implementation of BrowserWindow for Cocoa. Bridges between C++ and
29 // the Cocoa NSWindow. Cross-platform code will interact with this object when 30 // the Cocoa NSWindow. Cross-platform code will interact with this object when
30 // it needs to manipulate the window. 31 // it needs to manipulate the window.
31 32
32 class BrowserWindowCocoa : 33 class BrowserWindowCocoa :
33 public BrowserWindow, 34 public BrowserWindow,
35 public PrefObserver,
34 public extensions::ExtensionKeybindingRegistry::Delegate { 36 public extensions::ExtensionKeybindingRegistry::Delegate {
35 public: 37 public:
36 BrowserWindowCocoa(Browser* browser, 38 BrowserWindowCocoa(Browser* browser,
37 BrowserWindowController* controller); 39 BrowserWindowController* controller);
38 virtual ~BrowserWindowCocoa(); 40 virtual ~BrowserWindowCocoa();
39 41
40 // Overridden from BrowserWindow 42 // Overridden from BrowserWindow
41 virtual void Show() OVERRIDE; 43 virtual void Show() OVERRIDE;
42 virtual void ShowInactive() OVERRIDE; 44 virtual void ShowInactive() OVERRIDE;
43 virtual void Hide() OVERRIDE; 45 virtual void Hide() OVERRIDE;
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after
137 virtual gfx::Rect GetInstantBounds() OVERRIDE; 139 virtual gfx::Rect GetInstantBounds() OVERRIDE;
138 virtual bool IsInstantTabShowing() OVERRIDE; 140 virtual bool IsInstantTabShowing() OVERRIDE;
139 virtual WindowOpenDisposition GetDispositionForPopupBounds( 141 virtual WindowOpenDisposition GetDispositionForPopupBounds(
140 const gfx::Rect& bounds) OVERRIDE; 142 const gfx::Rect& bounds) OVERRIDE;
141 virtual FindBar* CreateFindBar() OVERRIDE; 143 virtual FindBar* CreateFindBar() OVERRIDE;
142 virtual bool GetConstrainedWindowTopY(int* top_y) OVERRIDE; 144 virtual bool GetConstrainedWindowTopY(int* top_y) OVERRIDE;
143 virtual void ShowAvatarBubble(content::WebContents* web_contents, 145 virtual void ShowAvatarBubble(content::WebContents* web_contents,
144 const gfx::Rect& rect) OVERRIDE; 146 const gfx::Rect& rect) OVERRIDE;
145 virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; 147 virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE;
146 148
149 // Overridden from NotificationObserver
150 virtual void OnPreferenceChanged(PrefServiceBase* service,
151 const std::string& pref_name) OVERRIDE;
152
147 // Overridden from ExtensionKeybindingRegistry::Delegate: 153 // Overridden from ExtensionKeybindingRegistry::Delegate:
148 virtual extensions::ActiveTabPermissionGranter* 154 virtual extensions::ActiveTabPermissionGranter*
149 GetActiveTabPermissionGranter() OVERRIDE; 155 GetActiveTabPermissionGranter() OVERRIDE;
150 156
151 // Adds the given FindBar cocoa controller to this browser window. 157 // Adds the given FindBar cocoa controller to this browser window.
152 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); 158 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller);
153 159
154 // Returns the cocoa-world BrowserWindowController 160 // Returns the cocoa-world BrowserWindowController
155 BrowserWindowController* cocoa_controller() { return controller_; } 161 BrowserWindowController* cocoa_controller() { return controller_; }
156 162
157 protected: 163 protected:
158 virtual void DestroyBrowser() OVERRIDE; 164 virtual void DestroyBrowser() OVERRIDE;
159 165
160 private: 166 private:
161 virtual void OnShowBookmarkBarChanged();
162 NSWindow* window() const; // Accessor for the (current) |NSWindow|. 167 NSWindow* window() const; // Accessor for the (current) |NSWindow|.
163 168
164 PrefChangeRegistrar pref_change_registrar_; 169 PrefChangeRegistrar pref_change_registrar_;
165 Browser* browser_; // weak, owned by controller 170 Browser* browser_; // weak, owned by controller
166 BrowserWindowController* controller_; // weak, owns us 171 BrowserWindowController* controller_; // weak, owns us
167 base::WeakPtrFactory<Browser> confirm_close_factory_; 172 base::WeakPtrFactory<Browser> confirm_close_factory_;
168 scoped_nsobject<NSString> pending_window_title_; 173 scoped_nsobject<NSString> pending_window_title_;
169 ui::WindowShowState initial_show_state_; 174 ui::WindowShowState initial_show_state_;
170 NSInteger attention_request_id_; // identifier from requestUserAttention 175 NSInteger attention_request_id_; // identifier from requestUserAttention
171 }; 176 };
172 177
173 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ 178 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser_command_controller.cc ('k') | chrome/browser/ui/cocoa/browser_window_cocoa.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698