| OLD | NEW |
| (Empty) | |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #ifndef CHROME_BROWSER_COCOA_EXTENSIONS_EXTENSION_POPUP_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_COCOA_EXTENSIONS_EXTENSION_POPUP_CONTROLLER_H_ |
| 7 |
| 8 #import <Cocoa/Cocoa.h> |
| 9 |
| 10 #import "base/scoped_nsobject.h" |
| 11 #include "base/scoped_ptr.h" |
| 12 #include "chrome/browser/cocoa/info_bubble_view.h" |
| 13 #include "googleurl/src/gurl.h" |
| 14 |
| 15 class Browser; |
| 16 class ExtensionHost; |
| 17 @class InfoBubbleWindow; |
| 18 |
| 19 // This controller manages a single browser action popup that can appear once a |
| 20 // user has clicked on a browser action button. It instantiates the extension |
| 21 // popup view showing the content and resizes the window to accomodate any size |
| 22 // changes as they occur. |
| 23 // There can only be one browser action popup open at a time. |
| 24 @interface ExtensionPopupController : NSWindowController { |
| 25 @private |
| 26 // The native extension view retrieved from the extension host. Weak. |
| 27 NSView* extensionView_; |
| 28 |
| 29 // The popup's parent window. Weak. |
| 30 NSWindow* parentWindow_; |
| 31 |
| 32 // Where the window is anchored. Right now it's the bottom center of the |
| 33 // browser action button. |
| 34 NSPoint anchor_; |
| 35 |
| 36 // The extension host object. |
| 37 scoped_ptr<ExtensionHost> host_; |
| 38 } |
| 39 |
| 40 // Returns a pointer to the extension host object associated with this |
| 41 // browser action. |
| 42 - (ExtensionHost*)host; |
| 43 |
| 44 // Starts the process of showing the given popup URL. Instantiates an |
| 45 // ExtensionPopupController with the parent window retrieved from |browser|, a |
| 46 // host for the popup created by the extension process manager specific to the |
| 47 // browser profile and the remaining arguments |anchoredAt| and |arrowLocation|. |
| 48 // |anchoredAt| is expected to be in the screen's coordinates at the bottom |
| 49 // center of the browser action button. |
| 50 // The actual display of the popup is delayed until the page contents finish |
| 51 // loading in order to minimize UI flashing and resizing. |
| 52 + (ExtensionPopupController*)showURL:(GURL)url |
| 53 inBrowser:(Browser*)browser |
| 54 anchoredAt:(NSPoint)anchoredAt |
| 55 arrowLocation:(BubbleArrowLocation)arrowLocation; |
| 56 @end |
| 57 |
| 58 #endif // CHROME_BROWSER_COCOA_EXTENSIONS_EXTENSION_POPUP_CONTROLLER_H_ |
| OLD | NEW |