| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 5 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "chrome/browser/debugger/devtools_window.h" | 9 #include "chrome/browser/debugger/devtools_window.h" |
| 10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 122 switch (type) { | 122 switch (type) { |
| 123 case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: | 123 case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: |
| 124 // Once we receive did stop loading, the content will be complete and | 124 // Once we receive did stop loading, the content will be complete and |
| 125 // the width will have been computed. Now it's safe to show. | 125 // the width will have been computed. Now it's safe to show. |
| 126 if (extension_host_.get() == Details<ExtensionHost>(details).ptr()) { | 126 if (extension_host_.get() == Details<ExtensionHost>(details).ptr()) { |
| 127 Show(true); | 127 Show(true); |
| 128 | 128 |
| 129 if (inspect_with_devtools_) { | 129 if (inspect_with_devtools_) { |
| 130 // Listen for the the devtools window closing. | 130 // Listen for the the devtools window closing. |
| 131 registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, | 131 registrar_.Add(this, content::NOTIFICATION_DEVTOOLS_WINDOW_CLOSING, |
| 132 Source<Profile>(extension_host_->profile())); | 132 Source<content::BrowserContext>(extension_host_->profile())); |
| 133 DevToolsWindow::ToggleDevToolsWindow( | 133 DevToolsWindow::ToggleDevToolsWindow( |
| 134 extension_host_->render_view_host(), | 134 extension_host_->render_view_host(), |
| 135 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); | 135 DEVTOOLS_TOGGLE_ACTION_SHOW_CONSOLE); |
| 136 } | 136 } |
| 137 } | 137 } |
| 138 break; | 138 break; |
| 139 case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: | 139 case chrome::NOTIFICATION_EXTENSION_HOST_VIEW_SHOULD_CLOSE: |
| 140 // If we aren't the host of the popup, then disregard the notification. | 140 // If we aren't the host of the popup, then disregard the notification. |
| 141 if (Details<ExtensionHost>(host()) != details) | 141 if (Details<ExtensionHost>(host()) != details) |
| 142 return; | 142 return; |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 if (closing_) | 204 if (closing_) |
| 205 return; | 205 return; |
| 206 closing_ = true; | 206 closing_ = true; |
| 207 DetachFromBrowser(); | 207 DetachFromBrowser(); |
| 208 | 208 |
| 209 if (observer_) | 209 if (observer_) |
| 210 observer_->ExtensionPopupIsClosing(this); | 210 observer_->ExtensionPopupIsClosing(this); |
| 211 | 211 |
| 212 Release(); // Balanced in ctor. | 212 Release(); // Balanced in ctor. |
| 213 } | 213 } |
| OLD | NEW |