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_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 13 matching lines...) Expand all Loading... |
24 virtual ~ExtensionPopup(); | 24 virtual ~ExtensionPopup(); |
25 | 25 |
26 // Create and show a popup with |url| positioned adjacent to |anchor_view|. | 26 // Create and show a popup with |url| positioned adjacent to |anchor_view|. |
27 // |browser| is the browser to which the pop-up will be attached. NULL is a | 27 // |browser| is the browser to which the pop-up will be attached. NULL is a |
28 // valid parameter for pop-ups not associated with a browser. | 28 // valid parameter for pop-ups not associated with a browser. |
29 // The positioning of the pop-up is determined by |arrow_location| according | 29 // The positioning of the pop-up is determined by |arrow_location| according |
30 // to the following logic: The popup is anchored so that the corner indicated | 30 // to the following logic: The popup is anchored so that the corner indicated |
31 // by value of |arrow_location| remains fixed during popup resizes. | 31 // by value of |arrow_location| remains fixed during popup resizes. |
32 // If |arrow_location| is BOTTOM_*, then the popup 'pops up', otherwise | 32 // If |arrow_location| is BOTTOM_*, then the popup 'pops up', otherwise |
33 // the popup 'drops down'. | 33 // the popup 'drops down'. |
34 // Pass |inspect_with_devtools| as true to pin the popup open and show the | |
35 // devtools window for it. | |
36 // The actual display of the popup is delayed until the page contents | 34 // The actual display of the popup is delayed until the page contents |
37 // finish loading in order to minimize UI flashing and resizing. | 35 // finish loading in order to minimize UI flashing and resizing. |
38 // TODO(benwells): remove unused |inspect_with_devtools| parameter. | |
39 static ExtensionPopup* ShowPopup( | 36 static ExtensionPopup* ShowPopup( |
40 const GURL& url, | 37 const GURL& url, |
41 Browser* browser, | 38 Browser* browser, |
42 views::View* anchor_view, | 39 views::View* anchor_view, |
43 views::BubbleBorder::ArrowLocation arrow_location); | 40 views::BubbleBorder::ArrowLocation arrow_location); |
44 | 41 |
45 ExtensionHost* host() const { return extension_host_.get(); } | 42 ExtensionHost* host() const { return extension_host_.get(); } |
46 | 43 |
47 // content::NotificationObserver overrides. | 44 // content::NotificationObserver overrides. |
48 virtual void Observe(int type, | 45 virtual void Observe(int type, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 bool inspect_with_devtools_; | 81 bool inspect_with_devtools_; |
85 | 82 |
86 content::NotificationRegistrar registrar_; | 83 content::NotificationRegistrar registrar_; |
87 | 84 |
88 base::WeakPtrFactory<ExtensionPopup> close_bubble_factory_; | 85 base::WeakPtrFactory<ExtensionPopup> close_bubble_factory_; |
89 | 86 |
90 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); | 87 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); |
91 }; | 88 }; |
92 | 89 |
93 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 90 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
OLD | NEW |