| 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_commands.h" |
| 20 #include "chrome/browser/ui/browser_list.h" | 21 #include "chrome/browser/ui/browser_list.h" |
| 21 #include "chrome/browser/ui/browser_tabstrip.h" | 22 #include "chrome/browser/ui/browser_tabstrip.h" |
| 22 #include "chrome/browser/ui/browser_window_state.h" | 23 #include "chrome/browser/ui/browser_window_state.h" |
| 23 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" | 24 #import "chrome/browser/ui/cocoa/browser/avatar_button_controller.h" |
| 24 #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" | 25 #import "chrome/browser/ui/cocoa/browser/avatar_menu_bubble_controller.h" |
| 25 #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" | 26 #import "chrome/browser/ui/cocoa/browser/edit_search_engine_cocoa_controller.h" |
| 26 #import "chrome/browser/ui/cocoa/browser_window_controller.h" | 27 #import "chrome/browser/ui/cocoa/browser_window_controller.h" |
| 27 #import "chrome/browser/ui/cocoa/browser_window_utils.h" | 28 #import "chrome/browser/ui/cocoa/browser_window_utils.h" |
| 28 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" | 29 #import "chrome/browser/ui/cocoa/chrome_event_processing_window.h" |
| 29 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" | 30 #import "chrome/browser/ui/cocoa/download/download_shelf_controller.h" |
| (...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 | 119 |
| 119 [window() makeKeyAndOrderFront:controller_]; | 120 [window() makeKeyAndOrderFront:controller_]; |
| 120 | 121 |
| 121 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:| | 122 // When creating windows from nibs it is necessary to |makeKeyAndOrderFront:| |
| 122 // prior to |orderOut:| then |miniaturize:| when restoring windows in the | 123 // prior to |orderOut:| then |miniaturize:| when restoring windows in the |
| 123 // minimized state. | 124 // minimized state. |
| 124 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) { | 125 if (initial_show_state_ == ui::SHOW_STATE_MINIMIZED) { |
| 125 [window() orderOut:controller_]; | 126 [window() orderOut:controller_]; |
| 126 [window() miniaturize:controller_]; | 127 [window() miniaturize:controller_]; |
| 127 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) { | 128 } else if (initial_show_state_ == ui::SHOW_STATE_FULLSCREEN) { |
| 128 browser_->ToggleFullscreenMode(); | 129 chrome::ToggleFullscreenMode(browser_); |
| 129 } | 130 } |
| 130 initial_show_state_ = ui::SHOW_STATE_DEFAULT; | 131 initial_show_state_ = ui::SHOW_STATE_DEFAULT; |
| 131 | 132 |
| 132 // Restore window animation behavior. | 133 // Restore window animation behavior. |
| 133 if (did_save_animation_behavior) | 134 if (did_save_animation_behavior) |
| 134 [window() setAnimationBehavior:saved_animation_behavior]; | 135 [window() setAnimationBehavior:saved_animation_behavior]; |
| 135 | 136 |
| 136 browser_->OnWindowDidShow(); | 137 browser_->OnWindowDidShow(); |
| 137 } | 138 } |
| 138 | 139 |
| (...skipping 511 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 650 AvatarMenuBubbleController* menu = | 651 AvatarMenuBubbleController* menu = |
| 651 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ | 652 [[AvatarMenuBubbleController alloc] initWithBrowser:browser_ |
| 652 anchoredAt:point]; | 653 anchoredAt:point]; |
| 653 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; | 654 [[menu bubble] setAlignment:info_bubble::kAlignEdgeToAnchorEdge]; |
| 654 [menu showWindow:nil]; | 655 [menu showWindow:nil]; |
| 655 } | 656 } |
| 656 | 657 |
| 657 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { | 658 void BrowserWindowCocoa::ShowAvatarBubbleFromAvatarButton() { |
| 658 [[controller_ avatarButtonController] showAvatarBubble]; | 659 [[controller_ avatarButtonController] showAvatarBubble]; |
| 659 } | 660 } |
| OLD | NEW |