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 #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 Loading... |
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 [controller_ zoomChangedForActiveTab:can_show_bubble ? YES : NO]; |
254 } | |
255 | 254 |
256 void BrowserWindowCocoa::SetZoomIconTooltipPercent(int zoom_percent) { | 255 // TODO(dbeam): show a zoom bubble when when the wrench menu's not showing. |
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 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 AvatarMenuBubbleController* menu = | 640 AvatarMenuBubbleController* menu = |
647 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 641 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
648 anchoredAt:point]; | 642 anchoredAt:point]; |
649 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 643 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
650 [menu showWindow:nil]; | 644 [menu showWindow:nil]; |
651 } | 645 } |
652 | 646 |
653 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 647 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
654 [[controller_ avatarButtonController] showAvatarBubble]; | 648 [[controller_ avatarButtonController] showAvatarBubble]; |
655 } | 649 } |
OLD | NEW |