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 | |
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 } | 254 } |
263 | 255 |
264 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const { | 256 gfx::Rect BrowserWindowCocoa::GetRestoredBounds() const { |
265 // Flip coordinates based on the primary screen. | 257 // Flip coordinates based on the primary screen. |
266 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; | 258 NSScreen* screen = [[NSScreen screens] objectAtIndex:0]; |
267 NSRect frame = [controller_ regularWindowFrame]; | 259 NSRect frame = [controller_ regularWindowFrame]; |
268 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); | 260 gfx::Rect bounds(frame.origin.x, 0, NSWidth(frame), NSHeight(frame)); |
269 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); | 261 bounds.set_y(NSHeight([screen frame]) - NSMaxY(frame)); |
270 return bounds; | 262 return bounds; |
271 } | 263 } |
(...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
641 AvatarMenuBubbleController* menu = | 633 AvatarMenuBubbleController* menu = |
642 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 634 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
643 anchoredAt:point]; | 635 anchoredAt:point]; |
644 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 636 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
645 [menu showWindow:nil]; | 637 [menu showWindow:nil]; |
646 } | 638 } |
647 | 639 |
648 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 640 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
649 [[controller_ avatarButtonController] showAvatarBubble]; | 641 [[controller_ avatarButtonController] showAvatarBubble]; |
650 } | 642 } |
OLD | NEW |