| 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 | 7 |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 | 44 |
| 45 // Create and show a popup with the given |host| positioned adjacent to | 45 // Create and show a popup with the given |host| positioned adjacent to |
| 46 // |anchor_view|. | 46 // |anchor_view|. |
| 47 // The positioning of the pop-up is determined by |arrow| according to the | 47 // The positioning of the pop-up is determined by |arrow| according to the |
| 48 // following logic: The popup is anchored so that the corner indicated by the | 48 // following logic: The popup is anchored so that the corner indicated by the |
| 49 // value of |arrow| remains fixed during popup resizes. If |arrow| is | 49 // value of |arrow| remains fixed during popup resizes. If |arrow| is |
| 50 // BOTTOM_*, then the popup 'pops up', otherwise the popup 'drops down'. | 50 // BOTTOM_*, then the popup 'pops up', otherwise the popup 'drops down'. |
| 51 // The actual display of the popup is delayed until the page contents | 51 // The actual display of the popup is delayed until the page contents |
| 52 // finish loading in order to minimize UI flashing and resizing. | 52 // finish loading in order to minimize UI flashing and resizing. |
| 53 static ExtensionPopup* ShowPopup( | 53 static ExtensionPopup* ShowPopup( |
| 54 scoped_ptr<extensions::ExtensionViewHost> host, | 54 std::unique_ptr<extensions::ExtensionViewHost> host, |
| 55 views::View* anchor_view, | 55 views::View* anchor_view, |
| 56 views::BubbleBorder::Arrow arrow, | 56 views::BubbleBorder::Arrow arrow, |
| 57 ShowAction show_action); | 57 ShowAction show_action); |
| 58 | 58 |
| 59 extensions::ExtensionViewHost* host() const { return host_.get(); } | 59 extensions::ExtensionViewHost* host() const { return host_.get(); } |
| 60 | 60 |
| 61 // views::BubbleDialogDelegateView overrides. | 61 // views::BubbleDialogDelegateView overrides. |
| 62 int GetDialogButtons() const override; | 62 int GetDialogButtons() const override; |
| 63 | 63 |
| 64 // content::NotificationObserver overrides. | 64 // content::NotificationObserver overrides. |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 views::View* anchor_view, | 103 views::View* anchor_view, |
| 104 views::BubbleBorder::Arrow arrow, | 104 views::BubbleBorder::Arrow arrow, |
| 105 ShowAction show_action); | 105 ShowAction show_action); |
| 106 | 106 |
| 107 // Show the bubble, focus on its content, and register listeners. | 107 // Show the bubble, focus on its content, and register listeners. |
| 108 void ShowBubble(); | 108 void ShowBubble(); |
| 109 | 109 |
| 110 void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached); | 110 void OnDevToolsStateChanged(content::DevToolsAgentHost*, bool attached); |
| 111 | 111 |
| 112 // The contained host for the view. | 112 // The contained host for the view. |
| 113 scoped_ptr<extensions::ExtensionViewHost> host_; | 113 std::unique_ptr<extensions::ExtensionViewHost> host_; |
| 114 | 114 |
| 115 // Flag used to indicate if the pop-up should open a devtools window once | 115 // Flag used to indicate if the pop-up should open a devtools window once |
| 116 // it is shown inspecting it. | 116 // it is shown inspecting it. |
| 117 bool inspect_with_devtools_; | 117 bool inspect_with_devtools_; |
| 118 | 118 |
| 119 content::NotificationRegistrar registrar_; | 119 content::NotificationRegistrar registrar_; |
| 120 | 120 |
| 121 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; | 121 base::Callback<void(content::DevToolsAgentHost*, bool)> devtools_callback_; |
| 122 | 122 |
| 123 bool widget_initialized_; | 123 bool widget_initialized_; |
| 124 | 124 |
| 125 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); | 125 DISALLOW_COPY_AND_ASSIGN(ExtensionPopup); |
| 126 }; | 126 }; |
| 127 | 127 |
| 128 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ | 128 #endif // CHROME_BROWSER_UI_VIEWS_EXTENSIONS_EXTENSION_POPUP_H_ |
| OLD | NEW |