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 10444040: Tracks changes to zoom icon and zoom percentage. Notifies browser window if the icon should be chan… (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Changed delegate to observer Created 8 years, 6 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
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 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 246
247 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) { 247 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) {
248 // Do nothing on Mac. 248 // Do nothing on Mac.
249 } 249 }
250 250
251 void BrowserWindowCocoa::SetStarredState(bool is_starred) { 251 void BrowserWindowCocoa::SetStarredState(bool is_starred) {
252 [controller_ setStarredState:is_starred ? YES : NO]; 252 [controller_ setStarredState:is_starred ? YES : NO];
253 } 253 }
254 254
255 void BrowserWindowCocoa::SetZoomIconState(ZoomController::ZoomIconState,
256 int zoomPercent) {
tfarina 2012/06/01 00:47:53 nit: zoom_percent
Kyle Horimoto 2012/06/01 18:04:50 Oops, that wasn't even supposed to be there at all
257 // TODO(khorimoto): Find someone to implement this.
258 }
259
260 void BrowserWindowCocoa::SetZoomIconTooltipPercent(int zoom_percent) {
261 // TODO(khorimoto): Find someone to implement this.
262 }
263
264 void BrowserWindowCocoa::ShowZoomBubble(int zoomPercent) {
tfarina 2012/06/01 00:47:53 nit: zoom_percent
Kyle Horimoto 2012/06/01 18:04:50 Done.
265 // TODO(khorimoto): Find someone to implement this.
266 }
267
255 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const { 268 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const {
256 // Flip coordinates based on the primary screen. 269 // Flip coordinates based on the primary screen.
257 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; 270 NSScreen* screen = [[NSScreen screens] objectAtIndex:0];
258 NSRect frame = [controller_ regularWindowFrame]; 271 NSRect frame = [controller_ regularWindowFrame];
259 gfx::Rect bounds(frame.origin.x, 0, frame.size.width, frame.size.height); 272 gfx::Rect bounds(frame.origin.x, 0, frame.size.width, frame.size.height);
260 bounds.set_y([screen frame].size.height - frame.origin.y - frame.size.height); 273 bounds.set_y([screen frame].size.height - frame.origin.y - frame.size.height);
261 return bounds; 274 return bounds;
262 } 275 }
263 276
264 gfx::Rect BrowserWindowCocoa::GetBounds() const { 277 gfx::Rect BrowserWindowCocoa::GetBounds() const {
(...skipping 375 matching lines...) Expand 10 before | Expand all | Expand 10 after
640 AvatarMenuBubbleController* menu = 653 AvatarMenuBubbleController* menu =
641 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ 654 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_
642 anchoredAt:point]; 655 anchoredAt:point];
643 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; 656 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge];
644 [menu showWindow:nil]; 657 [menu showWindow:nil];
645 } 658 }
646 659
647 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { 660 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() {
648 [[controller_ avatarButtonController] showAvatarBubble]; 661 [[controller_ avatarButtonController] showAvatarBubble];
649 } 662 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698