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/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" |
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
138 virtual bool InPresentationMode() OVERRIDE; | 138 virtual bool InPresentationMode() OVERRIDE; |
139 virtual gfx::Rect GetInstantBounds() OVERRIDE; | 139 virtual gfx::Rect GetInstantBounds() OVERRIDE; |
140 virtual bool IsInstantTabShowing() OVERRIDE; | 140 virtual bool IsInstantTabShowing() OVERRIDE; |
141 virtual WindowOpenDisposition GetDispositionForPopupBounds( | 141 virtual WindowOpenDisposition GetDispositionForPopupBounds( |
142 const gfx::Rect& bounds) OVERRIDE; | 142 const gfx::Rect& bounds) OVERRIDE; |
143 virtual FindBar* CreateFindBar() OVERRIDE; | 143 virtual FindBar* CreateFindBar() OVERRIDE; |
144 virtual bool GetConstrainedWindowTopY(int* top_y) OVERRIDE; | 144 virtual bool GetConstrainedWindowTopY(int* top_y) OVERRIDE; |
145 virtual void ShowAvatarBubble(content::WebContents* web_contents, | 145 virtual void ShowAvatarBubble(content::WebContents* web_contents, |
146 const gfx::Rect& rect) OVERRIDE; | 146 const gfx::Rect& rect) OVERRIDE; |
147 virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; | 147 virtual void ShowAvatarBubbleFromAvatarButton() OVERRIDE; |
| 148 virtual void ShowPasswordGenerationBubble( |
| 149 const gfx::Rect& rect, |
| 150 const content::PasswordForm& form, |
| 151 autofill::PasswordGenerator* password_generator) OVERRIDE; |
148 | 152 |
149 // Overridden from NotificationObserver | 153 // Overridden from NotificationObserver |
150 virtual void OnPreferenceChanged(PrefServiceBase* service, | 154 virtual void OnPreferenceChanged(PrefServiceBase* service, |
151 const std::string& pref_name) OVERRIDE; | 155 const std::string& pref_name) OVERRIDE; |
152 | 156 |
153 // Overridden from ExtensionKeybindingRegistry::Delegate: | 157 // Overridden from ExtensionKeybindingRegistry::Delegate: |
154 virtual extensions::ActiveTabPermissionGranter* | 158 virtual extensions::ActiveTabPermissionGranter* |
155 GetActiveTabPermissionGranter() OVERRIDE; | 159 GetActiveTabPermissionGranter() OVERRIDE; |
156 | 160 |
157 // Adds the given FindBar cocoa controller to this browser window. | 161 // Adds the given FindBar cocoa controller to this browser window. |
158 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); | 162 void AddFindBar(FindBarCocoaController* find_bar_cocoa_controller); |
159 | 163 |
160 // Returns the cocoa-world BrowserWindowController | 164 // Returns the cocoa-world BrowserWindowController |
161 BrowserWindowController* cocoa_controller() { return controller_; } | 165 BrowserWindowController* cocoa_controller() { return controller_; } |
162 | 166 |
163 protected: | 167 protected: |
164 virtual void DestroyBrowser() OVERRIDE; | 168 virtual void DestroyBrowser() OVERRIDE; |
165 | 169 |
166 private: | 170 private: |
167 NSWindow* window() const; // Accessor for the (current) |NSWindow|. | 171 NSWindow* window() const; // Accessor for the (current) |NSWindow|. |
168 | 172 |
| 173 NSPoint GetPointForBubble(content::WebContents* web_contents, |
| 174 const gfx::Rect& rect) const; |
| 175 |
169 PrefChangeRegistrar pref_change_registrar_; | 176 PrefChangeRegistrar pref_change_registrar_; |
170 Browser* browser_; // weak, owned by controller | 177 Browser* browser_; // weak, owned by controller |
171 BrowserWindowController* controller_; // weak, owns us | 178 BrowserWindowController* controller_; // weak, owns us |
172 base::WeakPtrFactory<Browser> confirm_close_factory_; | 179 base::WeakPtrFactory<Browser> confirm_close_factory_; |
173 scoped_nsobject<NSString> pending_window_title_; | 180 scoped_nsobject<NSString> pending_window_title_; |
174 ui::WindowShowState initial_show_state_; | 181 ui::WindowShowState initial_show_state_; |
175 NSInteger attention_request_id_; // identifier from requestUserAttention | 182 NSInteger attention_request_id_; // identifier from requestUserAttention |
176 }; | 183 }; |
177 | 184 |
178 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ | 185 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_COCOA_H_ |
OLD | NEW |