| 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 #include <utility> |
| 8 | 9 |
| 9 #include "base/callback.h" | 10 #include "base/callback.h" |
| 10 #include "base/macros.h" | 11 #include "base/macros.h" |
| 11 #include "chrome/browser/devtools/devtools_window.h" | 12 #include "chrome/browser/devtools/devtools_window.h" |
| 12 #include "chrome/browser/extensions/extension_view_host.h" | 13 #include "chrome/browser/extensions/extension_view_host.h" |
| 13 #include "chrome/browser/extensions/extension_view_host_factory.h" | 14 #include "chrome/browser/extensions/extension_view_host_factory.h" |
| 14 #include "chrome/browser/ui/browser.h" | 15 #include "chrome/browser/ui/browser.h" |
| 15 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" | 16 #import "chrome/browser/ui/cocoa/browser_window_cocoa.h" |
| 16 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" | 17 #import "chrome/browser/ui/cocoa/extensions/extension_view_mac.h" |
| 17 #import "chrome/browser/ui/cocoa/info_bubble_window.h" | 18 #import "chrome/browser/ui/cocoa/info_bubble_window.h" |
| (...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 [gPopup close]; // Starts the animation to fade out the popup. | 270 [gPopup close]; // Starts the animation to fade out the popup. |
| 270 | 271 |
| 271 // Create the popup first. This establishes an initially hidden NSWindow so | 272 // Create the popup first. This establishes an initially hidden NSWindow so |
| 272 // that the renderer is able to gather correct screen metrics for the initial | 273 // that the renderer is able to gather correct screen metrics for the initial |
| 273 // paint. | 274 // paint. |
| 274 gPopup = [[ExtensionPopupController alloc] | 275 gPopup = [[ExtensionPopupController alloc] |
| 275 initWithParentWindow:browser->window()->GetNativeWindow() | 276 initWithParentWindow:browser->window()->GetNativeWindow() |
| 276 anchoredAt:anchoredAt | 277 anchoredAt:anchoredAt |
| 277 arrowLocation:arrowLocation | 278 arrowLocation:arrowLocation |
| 278 devMode:devMode]; | 279 devMode:devMode]; |
| 279 [gPopup setExtensionViewHost:host.Pass()]; | 280 [gPopup setExtensionViewHost:std::move(host)]; |
| 280 return gPopup; | 281 return gPopup; |
| 281 } | 282 } |
| 282 | 283 |
| 283 + (ExtensionPopupController*)popup { | 284 + (ExtensionPopupController*)popup { |
| 284 return gPopup; | 285 return gPopup; |
| 285 } | 286 } |
| 286 | 287 |
| 287 - (void)setExtensionViewHost:(scoped_ptr<ExtensionViewHost>)host { | 288 - (void)setExtensionViewHost:(scoped_ptr<ExtensionViewHost>)host { |
| 288 DCHECK(!host_); | 289 DCHECK(!host_); |
| 289 DCHECK(host); | 290 DCHECK(host); |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 441 return minSize; | 442 return minSize; |
| 442 } | 443 } |
| 443 | 444 |
| 444 // Private (TestingAPI) | 445 // Private (TestingAPI) |
| 445 + (NSSize)maxPopupSize { | 446 + (NSSize)maxPopupSize { |
| 446 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 447 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
| 447 return maxSize; | 448 return maxSize; |
| 448 } | 449 } |
| 449 | 450 |
| 450 @end | 451 @end |
| OLD | NEW |