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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_cocoa.mm

Issue 11072002: Combined window positioning and show state determiniation in the WindowSizer (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: More include issues Created 8 years, 2 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 | Annotate | Revision Log
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 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h" 5 #include "chrome/browser/ui/cocoa/browser_window_cocoa.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/mac/mac_util.h" 10 #include "base/mac/mac_util.h"
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 82
83 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser, 83 BrowserWindowCocoa::BrowserWindowCocoa(Browser* browser,
84 BrowserWindowController* controller) 84 BrowserWindowController* controller)
85 : browser_(browser), 85 : browser_(browser),
86 controller_(controller), 86 controller_(controller),
87 confirm_close_factory_(browser), 87 confirm_close_factory_(browser),
88 attention_request_id_(0) { 88 attention_request_id_(0) {
89 89
90 pref_change_registrar_.Init(browser_->profile()->GetPrefs()); 90 pref_change_registrar_.Init(browser_->profile()->GetPrefs());
91 pref_change_registrar_.Add(prefs::kShowBookmarkBar, this); 91 pref_change_registrar_.Add(prefs::kShowBookmarkBar, this);
92 92 gfx::Rect bounds;
93 initial_show_state_ = chrome::GetSavedWindowShowState(browser_); 93 chrome::GetSavedWindowBoundsAndShowState(browser_,
94 &bounds,
95 &initial_show_state_);
sky 2012/10/08 21:01:25 Same comment about initializing initial_show_state
Mr4D (OOO till 08-26) 2012/10/08 23:04:27 Done.
94 } 96 }
95 97
96 BrowserWindowCocoa::~BrowserWindowCocoa() { 98 BrowserWindowCocoa::~BrowserWindowCocoa() {
97 } 99 }
98 100
99 void BrowserWindowCocoa::Show() { 101 void BrowserWindowCocoa::Show() {
100 // The Browser associated with this browser window must become the active 102 // The Browser associated with this browser window must become the active
101 // browser at the time |Show()| is called. This is the natural behaviour under 103 // browser at the time |Show()| is called. This is the natural behaviour under
102 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:| 104 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:|
103 // until we return to the runloop. Therefore any calls to 105 // until we return to the runloop. Therefore any calls to
(...skipping 548 matching lines...) Expand 10 before | Expand all | Expand 10 after
652 AvatarMenuBubbleController* menu = 654 AvatarMenuBubbleController* menu =
653 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 655 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
654 anchoredAt:point]; 656 anchoredAt:point];
655 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 657 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
656 [menu showWindow:nil]; 658 [menu showWindow:nil];
657 } 659 }
658 660
659 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 661 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
660 [[controller_ avatarButtonController] showAvatarBubble]; 662 [[controller_ avatarButtonController] showAvatarBubble];
661 } 663 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698