| 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/chrome_notification_types.h" | 10 #include "chrome/browser/chrome_notification_types.h" |
| 11 #include "chrome/browser/devtools/devtools_window.h" | 11 #include "chrome/browser/devtools/devtools_window.h" |
| 12 #include "chrome/browser/extensions/extension_host.h" | 12 #include "chrome/browser/extensions/extension_host.h" |
| 13 #include "chrome/browser/extensions/extension_process_manager.h" | 13 #include "chrome/browser/extensions/extension_host_factory.h" |
| 14 #include "chrome/browser/extensions/extension_system.h" | |
| 15 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 17 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 18 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 17 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 19 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 18 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 20 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 19 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 21 #include "content/public/browser/devtools_agent_host.h" | 20 #include "content/public/browser/devtools_agent_host.h" |
| 22 #include "content/public/browser/devtools_manager.h" | 21 #include "content/public/browser/devtools_manager.h" |
| 23 #include "content/public/browser/notification_details.h" | 22 #include "content/public/browser/notification_details.h" |
| 24 #include "content/public/browser/notification_registrar.h" | 23 #include "content/public/browser/notification_registrar.h" |
| (...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 inBrowser:(Browser*)browser | 264 inBrowser:(Browser*)browser |
| 266 anchoredAt:(NSPoint)anchoredAt | 265 anchoredAt:(NSPoint)anchoredAt |
| 267 arrowLocation:(info_bubble::BubbleArrowLocation) | 266 arrowLocation:(info_bubble::BubbleArrowLocation) |
| 268 arrowLocation | 267 arrowLocation |
| 269 devMode:(BOOL)devMode { | 268 devMode:(BOOL)devMode { |
| 270 DCHECK([NSThread isMainThread]); | 269 DCHECK([NSThread isMainThread]); |
| 271 DCHECK(browser); | 270 DCHECK(browser); |
| 272 if (!browser) | 271 if (!browser) |
| 273 return nil; | 272 return nil; |
| 274 | 273 |
| 275 ExtensionProcessManager* manager = | 274 extensions::ExtensionHost* host = |
| 276 extensions::ExtensionSystem::Get(browser->profile())->process_manager(); | 275 extensions::ExtensionHostFactory::CreatePopupHost(url, browser); |
| 277 DCHECK(manager); | |
| 278 if (!manager) | |
| 279 return nil; | |
| 280 | |
| 281 extensions::ExtensionHost* host = manager->CreatePopupHost(url, browser); | |
| 282 DCHECK(host); | 276 DCHECK(host); |
| 283 if (!host) | 277 if (!host) |
| 284 return nil; | 278 return nil; |
| 285 | 279 |
| 286 // Make absolutely sure that no popups are leaked. | 280 // Make absolutely sure that no popups are leaked. |
| 287 if (gPopup) { | 281 if (gPopup) { |
| 288 if ([[gPopup window] isVisible]) | 282 if ([[gPopup window] isVisible]) |
| 289 [gPopup close]; | 283 [gPopup close]; |
| 290 | 284 |
| 291 [gPopup autorelease]; | 285 [gPopup autorelease]; |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 413 return minSize; | 407 return minSize; |
| 414 } | 408 } |
| 415 | 409 |
| 416 // Private (TestingAPI) | 410 // Private (TestingAPI) |
| 417 + (NSSize)maxPopupSize { | 411 + (NSSize)maxPopupSize { |
| 418 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 412 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
| 419 return maxSize; | 413 return maxSize; |
| 420 } | 414 } |
| 421 | 415 |
| 422 @end | 416 @end |
| OLD | NEW |