Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(989)

Side by Side Diff: chrome/browser/ui/cocoa/extensions/extension_popup_controller.mm

Issue 573143002: Mac: Give bubble windows an initial position before showing them. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: setAnchorPoint Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
396 396
397 [extensionView_ setFrame:frame]; 397 [extensionView_ setFrame:frame];
398 [extensionView_ setNeedsDisplay:YES]; 398 [extensionView_ setNeedsDisplay:YES];
399 } 399 }
400 400
401 - (void)onViewDidShow { 401 - (void)onViewDidShow {
402 [self onSizeChanged:pendingSize_]; 402 [self onSizeChanged:pendingSize_];
403 } 403 }
404 404
405 - (void)onWindowChanged { 405 - (void)onWindowChanged {
406 // The window is positioned before creating the host, to ensure the host is
407 // created with the correct screen information.
408 if (!host_)
409 return;
410
406 ExtensionViewMac* extensionView = 411 ExtensionViewMac* extensionView =
407 static_cast<ExtensionViewMac*>(host_->view()); 412 static_cast<ExtensionViewMac*>(host_->view());
408 // Let the extension view know, so that it can tell plugins. 413 // Let the extension view know, so that it can tell plugins.
409 if (extensionView) 414 if (extensionView)
410 extensionView->WindowFrameChanged(); 415 extensionView->WindowFrameChanged();
411 } 416 }
412 417
413 - (void)windowDidResize:(NSNotification*)notification { 418 - (void)windowDidResize:(NSNotification*)notification {
414 [self onWindowChanged]; 419 [self onWindowChanged];
415 } 420 }
(...skipping 13 matching lines...) Expand all
429 return minSize; 434 return minSize;
430 } 435 }
431 436
432 // Private (TestingAPI) 437 // Private (TestingAPI)
433 + (NSSize)maxPopupSize { 438 + (NSSize)maxPopupSize {
434 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight}; 439 NSSize maxSize = {ExtensionViewMac::kMaxWidth, ExtensionViewMac::kMaxHeight};
435 return maxSize; 440 return maxSize;
436 } 441 }
437 442
438 @end 443 @end
OLDNEW
« no previous file with comments | « chrome/browser/ui/cocoa/base_bubble_controller_unittest.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698