| 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 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" | 5 #import "chrome/browser/ui/cocoa/extensions/extension_popup_controller.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "chrome/browser/devtools/devtools_window.h" | 10 #include "chrome/browser/devtools/devtools_window.h" |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 86 explicit DevtoolsNotificationBridge(ExtensionPopupController* controller) | 86 explicit DevtoolsNotificationBridge(ExtensionPopupController* controller) |
| 87 : controller_(controller), | 87 : controller_(controller), |
| 88 render_view_host_([controller_ extensionHost]->render_view_host()), | 88 render_view_host_([controller_ extensionHost]->render_view_host()), |
| 89 devtools_callback_(base::Bind( | 89 devtools_callback_(base::Bind( |
| 90 &DevtoolsNotificationBridge::OnDevToolsStateChanged, | 90 &DevtoolsNotificationBridge::OnDevToolsStateChanged, |
| 91 base::Unretained(this))) { | 91 base::Unretained(this))) { |
| 92 content::DevToolsManager::GetInstance()->AddAgentStateCallback( | 92 content::DevToolsManager::GetInstance()->AddAgentStateCallback( |
| 93 devtools_callback_); | 93 devtools_callback_); |
| 94 } | 94 } |
| 95 | 95 |
| 96 ~DevtoolsNotificationBridge() { | 96 virtual ~DevtoolsNotificationBridge() { |
| 97 content::DevToolsManager::GetInstance()->RemoveAgentStateCallback( | 97 content::DevToolsManager::GetInstance()->RemoveAgentStateCallback( |
| 98 devtools_callback_); | 98 devtools_callback_); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void OnDevToolsStateChanged(content::DevToolsAgentHost* agent_host, | 101 void OnDevToolsStateChanged(content::DevToolsAgentHost* agent_host, |
| 102 bool attached) { | 102 bool attached) { |
| 103 if (agent_host->GetRenderViewHost() != render_view_host_) | 103 if (agent_host->GetRenderViewHost() != render_view_host_) |
| 104 return; | 104 return; |
| 105 | 105 |
| 106 if (attached) { | 106 if (attached) { |
| (...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 379 return minSize; | 379 return minSize; |
| 380 } | 380 } |
| 381 | 381 |
| 382 // Private (TestingAPI) | 382 // Private (TestingAPI) |
| 383 + (NSSize)maxPopupSize { | 383 + (NSSize)maxPopupSize { |
| 384 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 384 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
| 385 return maxSize; | 385 return maxSize; |
| 386 } | 386 } |
| 387 | 387 |
| 388 @end | 388 @end |
| OLD | NEW |