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

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

Issue 10736028: Refactor browser window zoom handling and enable zoom icon on all platforms. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 years, 4 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 231 matching lines...) Expand 10 before | Expand all | Expand 10 after
242 } 242 }
243 243
244 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) { 244 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) {
245 // Do nothing on Mac. 245 // Do nothing on Mac.
246 } 246 }
247 247
248 void BrowserWindowCocoa::SetStarredState(bool is_starred) { 248 void BrowserWindowCocoa::SetStarredState(bool is_starred) {
249 [controller_ setStarredState:is_starred ? YES : NO]; 249 [controller_ setStarredState:is_starred ? YES : NO];
250 } 250 }
251 251
252 void BrowserWindowCocoa::SetZoomIconState(ZoomController::ZoomIconState state) { 252 void BrowserWindowCocoa::ZoomChangedForActiveTab(bool can_show_bubble) {
253 // TODO(khorimoto): Find someone to implement this. 253 // TODO(dbeam): make sure a truthy |can_show_bubble| is only sent to the
254 } 254 // location bar when the wrench menu is hidden.
255 255 [controller_ zoomChangedForActiveTab:can_show_bubble ? YES : NO];
256 void BrowserWindowCocoa::SetZoomIconTooltipPercent(int zoom_percent) {
257 // TODO(khorimoto): Find someone to implement this.
258 }
259
260 void BrowserWindowCocoa::ShowZoomBubble(int zoom_percent) {
261 // TODO(khorimoto): Find someone to implement this.
262 } 256 }
263 257
264 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const { 258 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const {
265 // Flip coordinates based on the primary screen. 259 // Flip coordinates based on the primary screen.
266 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 260 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
267 NSRect frame = [controller_ regularWindowFrame]; 261 NSRect frame = [controller_ regularWindowFrame];
268 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); 262 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame));
269 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); 263 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame));
270 return bounds; 264 return bounds;
271 } 265 }
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after
641 AvatarMenuBubbleController* menu = 635 AvatarMenuBubbleController* menu =
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 636 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
643 anchoredAt:point]; 637 anchoredAt:point];
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 638 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
645 [menu showWindow:nil]; 639 [menu showWindow:nil];
646 } 640 }
647 641
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 642 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
649 [[controller_ avatarButtonController] showAvatarBubble]; 643 [[controller_ avatarButtonController] showAvatarBubble];
650 } 644 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698