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 "chrome/browser/devtools/devtools_window.h" | 9 #include "chrome/browser/devtools/devtools_window.h" |
10 #include "chrome/browser/extensions/extension_host.h" | 10 #include "chrome/browser/extensions/extension_host.h" |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
76 | 76 |
77 private: | 77 private: |
78 ExtensionPopupController* controller_; // Weak; owns this. | 78 ExtensionPopupController* controller_; // Weak; owns this. |
79 }; | 79 }; |
80 | 80 |
81 class DevtoolsNotificationBridge : public content::NotificationObserver { | 81 class DevtoolsNotificationBridge : public content::NotificationObserver { |
82 public: | 82 public: |
83 explicit DevtoolsNotificationBridge(ExtensionPopupController* controller) | 83 explicit DevtoolsNotificationBridge(ExtensionPopupController* controller) |
84 : controller_(controller) {} | 84 : controller_(controller) {} |
85 | 85 |
86 void Observe(int type, | 86 virtual void Observe( |
87 const content::NotificationSource& source, | 87 int type, |
88 const content::NotificationDetails& details) { | 88 const content::NotificationSource& source, |
| 89 const content::NotificationDetails& details) OVERRIDE { |
89 switch (type) { | 90 switch (type) { |
90 case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: { | 91 case chrome::NOTIFICATION_EXTENSION_HOST_DID_STOP_LOADING: { |
91 if (content::Details<extensions::ExtensionHost>( | 92 if (content::Details<extensions::ExtensionHost>( |
92 [controller_ extensionHost]) == details) { | 93 [controller_ extensionHost]) == details) { |
93 [controller_ showDevTools]; | 94 [controller_ showDevTools]; |
94 } | 95 } |
95 break; | 96 break; |
96 } | 97 } |
97 case content::NOTIFICATION_DEVTOOLS_AGENT_ATTACHED: { | 98 case content::NOTIFICATION_DEVTOOLS_AGENT_ATTACHED: { |
98 RenderViewHost* rvh = [controller_ extensionHost]->render_view_host(); | 99 RenderViewHost* rvh = [controller_ extensionHost]->render_view_host(); |
(...skipping 272 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
371 return minSize; | 372 return minSize; |
372 } | 373 } |
373 | 374 |
374 // Private (TestingAPI) | 375 // Private (TestingAPI) |
375 + (NSSize)maxPopupSize { | 376 + (NSSize)maxPopupSize { |
376 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 377 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
377 return maxSize; | 378 return maxSize; |
378 } | 379 } |
379 | 380 |
380 @end | 381 @end |
OLD | NEW |