| 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/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" |
| 11 #include "chrome/browser/extensions/extension_process_manager.h" | 11 #include "chrome/browser/extensions/extension_process_manager.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" |
| 12 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 13 #include "chrome/browser/ui/browser.h" | 14 #include "chrome/browser/ui/browser.h" |
| 14 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 15 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 15 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 16 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 16 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 17 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| 17 #include "chrome/common/chrome_notification_types.h" | 18 #include "chrome/common/chrome_notification_types.h" |
| 18 #include "content/public/browser/notification_details.h" | 19 #include "content/public/browser/notification_details.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 20 #include "content/public/browser/notification_registrar.h" |
| 20 #include "content/public/browser/notification_source.h" | 21 #include "content/public/browser/notification_source.h" |
| 21 #include "ui/base/cocoa/window_size_constants.h" | 22 #include "ui/base/cocoa/window_size_constants.h" |
| (...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 anchoredAt:(NSPoint)anchoredAt | 224 anchoredAt:(NSPoint)anchoredAt |
| 224 arrowLocation:(info_bubble::BubbleArrowLocation) | 225 arrowLocation:(info_bubble::BubbleArrowLocation) |
| 225 arrowLocation | 226 arrowLocation |
| 226 devMode:(BOOL)devMode { | 227 devMode:(BOOL)devMode { |
| 227 DCHECK([NSThread isMainThread]); | 228 DCHECK([NSThread isMainThread]); |
| 228 DCHECK(browser); | 229 DCHECK(browser); |
| 229 if (!browser) | 230 if (!browser) |
| 230 return nil; | 231 return nil; |
| 231 | 232 |
| 232 ExtensionProcessManager* manager = | 233 ExtensionProcessManager* manager = |
| 233 browser->profile()->GetExtensionProcessManager(); | 234 extensions::ExtensionSystem::Get(browser->profile())->process_manager(); |
| 234 DCHECK(manager); | 235 DCHECK(manager); |
| 235 if (!manager) | 236 if (!manager) |
| 236 return nil; | 237 return nil; |
| 237 | 238 |
| 238 extensions::ExtensionHost* host = manager->CreatePopupHost(url, browser); | 239 extensions::ExtensionHost* host = manager->CreatePopupHost(url, browser); |
| 239 DCHECK(host); | 240 DCHECK(host); |
| 240 if (!host) | 241 if (!host) |
| 241 return nil; | 242 return nil; |
| 242 | 243 |
| 243 // Make absolutely sure that no popups are leaked. | 244 // Make absolutely sure that no popups are leaked. |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 370 return minSize; | 371 return minSize; |
| 371 } | 372 } |
| 372 | 373 |
| 373 // Private (TestingAPI) | 374 // Private (TestingAPI) |
| 374 + (NSSize)maxPopupSize { | 375 + (NSSize)maxPopupSize { |
| 375 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 376 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
| 376 return maxSize; | 377 return maxSize; |
| 377 } | 378 } |
| 378 | 379 |
| 379 @end | 380 @end |
| OLD | NEW |