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" |
(...skipping 363 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 // the notification is fired (and consequently the view contents have loaded). | 374 // the notification is fired (and consequently the view contents have loaded). |
375 if (![window isVisible]) { | 375 if (![window isVisible]) { |
376 [self showWindow:self]; | 376 [self showWindow:self]; |
377 } | 377 } |
378 } | 378 } |
379 | 379 |
380 - (void)onSizeChanged:(NSSize)newSize { | 380 - (void)onSizeChanged:(NSSize)newSize { |
381 // When we update the size, the window will become visible. Stay hidden until | 381 // When we update the size, the window will become visible. Stay hidden until |
382 // the host is loaded. | 382 // the host is loaded. |
383 pendingSize_ = newSize; | 383 pendingSize_ = newSize; |
384 if (!host_ || !host_->did_stop_loading()) | 384 if (!host_ || !host_->has_loaded_once()) |
385 return; | 385 return; |
386 | 386 |
387 // No need to use CA here, our caller calls us repeatedly to animate the | 387 // No need to use CA here, our caller calls us repeatedly to animate the |
388 // resizing. | 388 // resizing. |
389 NSRect frame = [extensionView_ frame]; | 389 NSRect frame = [extensionView_ frame]; |
390 frame.size = newSize; | 390 frame.size = newSize; |
391 | 391 |
392 // |new_size| is in pixels. Convert to view units. | 392 // |new_size| is in pixels. Convert to view units. |
393 frame.size = [extensionView_ convertSize:frame.size fromView:nil]; | 393 frame.size = [extensionView_ convertSize:frame.size fromView:nil]; |
394 | 394 |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
432 return minSize; | 432 return minSize; |
433 } | 433 } |
434 | 434 |
435 // Private (TestingAPI) | 435 // Private (TestingAPI) |
436 + (NSSize)maxPopupSize { | 436 + (NSSize)maxPopupSize { |
437 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; | 437 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; |
438 return maxSize; | 438 return maxSize; |
439 } | 439 } |
440 | 440 |
441 @end | 441 @end |
OLD | NEW |