Chromium Code Reviews| 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 19 matching lines...) Expand all Loading... | |
| 30 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" | 30 #include "chrome/browser/ui/cocoa/find_bar/find_bar_bridge.h" |
| 31 #import "chrome/browser/ui/cocoa/info_bubble_view.h" | 31 #import "chrome/browser/ui/cocoa/info_bubble_view.h" |
| 32 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" | 32 #import "chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.h" |
| 33 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" | 33 #import "chrome/browser/ui/cocoa/nsmenuitem_additions.h" |
| 34 #include "chrome/browser/ui/cocoa/restart_browser.h" | 34 #include "chrome/browser/ui/cocoa/restart_browser.h" |
| 35 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" | 35 #include "chrome/browser/ui/cocoa/status_bubble_mac.h" |
| 36 #include "chrome/browser/ui/cocoa/task_manager_mac.h" | 36 #include "chrome/browser/ui/cocoa/task_manager_mac.h" |
| 37 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 37 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
| 38 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" | 38 #import "chrome/browser/ui/cocoa/web_dialog_window_controller.h" |
| 39 #import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h" | 39 #import "chrome/browser/ui/cocoa/website_settings_bubble_controller.h" |
| 40 #include "chrome/browser/ui/fullscreen/fullscreen_controller.h" | |
| 40 #include "chrome/browser/ui/page_info_bubble.h" | 41 #include "chrome/browser/ui/page_info_bubble.h" |
| 41 #include "chrome/browser/ui/tab_contents/tab_contents.h" | 42 #include "chrome/browser/ui/tab_contents/tab_contents.h" |
| 42 #include "chrome/common/chrome_notification_types.h" | 43 #include "chrome/common/chrome_notification_types.h" |
| 43 #include "chrome/common/pref_names.h" | 44 #include "chrome/common/pref_names.h" |
| 44 #include "content/public/browser/native_web_keyboard_event.h" | 45 #include "content/public/browser/native_web_keyboard_event.h" |
| 45 #include "content/public/browser/notification_details.h" | 46 #include "content/public/browser/notification_details.h" |
| 46 #include "content/public/browser/notification_source.h" | 47 #include "content/public/browser/notification_source.h" |
| 47 #include "content/public/browser/web_contents.h" | 48 #include "content/public/browser/web_contents.h" |
| 48 #include "grit/chromium_strings.h" | 49 #include "grit/chromium_strings.h" |
| 49 #include "grit/generated_resources.h" | 50 #include "grit/generated_resources.h" |
| (...skipping 68 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 browser_->fullscreen_controller()->ToggleFullscreenMode(); |
|
Ben Goodger (Google)
2012/07/03 19:51:35
Since this seems the most common use case, can we
tfarina
2012/07/03 22:38:38
Yup. Done.
| |
| 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 |