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" |
11 #include "base/message_loop.h" | 11 #include "base/message_loop.h" |
12 #include "base/sys_string_conversions.h" | 12 #include "base/sys_string_conversions.h" |
13 #include "chrome/app/chrome_command_ids.h" | 13 #include "chrome/app/chrome_command_ids.h" |
14 #include "chrome/browser/bookmarks/bookmark_utils.h" | 14 #include "chrome/browser/bookmarks/bookmark_utils.h" |
15 #include "chrome/browser/download/download_shelf.h" | 15 #include "chrome/browser/download/download_shelf.h" |
16 #include "chrome/browser/prefs/pref_service.h" | 16 #include "chrome/browser/prefs/pref_service.h" |
17 #include "chrome/browser/profiles/profile.h" | 17 #include "chrome/browser/profiles/profile.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
19 #include "chrome/browser/ui/browser_command_controller.h" | 19 #include "chrome/browser/ui/browser_command_controller.h" |
20 #include "chrome/browser/ui/browser_list.h" | 20 #include "chrome/browser/ui/browser_list.h" |
| 21 #include "chrome/browser/ui/browser_tabstrip.h" |
21 #include "chrome/browser/ui/browser_window_state.h" | 22 #include "chrome/browser/ui/browser_window_state.h" |
22 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" | 23 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" |
23 #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" | 24 #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" |
24 #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" | 25 #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" |
25 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 26 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
26 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 27 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
27 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 28 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
28 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 29 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
29 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 30 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
30 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" | 31 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 forWindow:window()]); | 225 forWindow:window()]); |
225 } | 226 } |
226 | 227 |
227 void BrowserWindowCocoa::BookmarkBarStateChanged( | 228 void BrowserWindowCocoa::BookmarkBarStateChanged( |
228 BookmarkBar::AnimateChangeType change_type) { | 229 BookmarkBar::AnimateChangeType change_type) { |
229 // TODO: route changes to state through this. | 230 // TODO: route changes to state through this. |
230 } | 231 } |
231 | 232 |
232 void BrowserWindowCocoa::UpdateDevTools() { | 233 void BrowserWindowCocoa::UpdateDevTools() { |
233 [controller_ updateDevToolsForContents: | 234 [controller_ updateDevToolsForContents: |
234 browser_->GetActiveWebContents()]; | 235 chrome::GetActiveWebContents(browser_)]; |
235 } | 236 } |
236 | 237 |
237 void BrowserWindowCocoa::SetDevToolsDockSide(DevToolsDockSide side) { | 238 void BrowserWindowCocoa::SetDevToolsDockSide(DevToolsDockSide side) { |
238 [controller_ setDevToolsDockToRight:side == DEVTOOLS_DOCK_SIDE_RIGHT]; | 239 [controller_ setDevToolsDockToRight:side == DEVTOOLS_DOCK_SIDE_RIGHT]; |
239 } | 240 } |
240 | 241 |
241 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) { | 242 void BrowserWindowCocoa::UpdateLoadingAnimations(bool should_animate) { |
242 // Do nothing on Mac. | 243 // Do nothing on Mac. |
243 } | 244 } |
244 | 245 |
(...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
646 AvatarMenuBubbleController* menu = | 647 AvatarMenuBubbleController* menu = |
647 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 648 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
648 anchoredAt:point]; | 649 anchoredAt:point]; |
649 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 650 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
650 [menu showWindow:nil]; | 651 [menu showWindow:nil]; |
651 } | 652 } |
652 | 653 |
653 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 654 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
654 [[controller_ avatarButtonController] showAvatarBubble]; | 655 [[controller_ avatarButtonController] showAvatarBubble]; |
655 } | 656 } |
OLD | NEW |