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 #import "base/mac/sdk_forward_declarations.h" | 10 #import "base/mac/sdk_forward_declarations.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 &bounds, | 136 &bounds, |
137 &initial_show_state_); | 137 &initial_show_state_); |
138 | 138 |
139 browser_->search_model()->AddObserver(this); | 139 browser_->search_model()->AddObserver(this); |
140 } | 140 } |
141 | 141 |
142 BrowserWindowCocoa::~BrowserWindowCocoa() { | 142 BrowserWindowCocoa::~BrowserWindowCocoa() { |
143 browser_->search_model()->RemoveObserver(this); | 143 browser_->search_model()->RemoveObserver(this); |
144 } | 144 } |
145 | 145 |
146 void BrowserWindowCocoa::Show() { | 146 void BrowserWindowCocoa::Show(bool user_gesture) { |
147 // The Browser associated with this browser window must become the active | 147 // The Browser associated with this browser window must become the active |
148 // browser at the time |Show()| is called. This is the natural behaviour under | 148 // browser at the time |Show()| is called. This is the natural behaviour under |
149 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:| | 149 // Windows, but |-makeKeyAndOrderFront:| won't send |-windowDidBecomeMain:| |
150 // until we return to the runloop. Therefore any calls to | 150 // until we return to the runloop. Therefore any calls to |
151 // |chrome::FindLastActiveWithHostDesktopType| will return the previous | 151 // |chrome::FindLastActiveWithHostDesktopType| will return the previous |
152 // browser instead if we don't explicitly set it here. | 152 // browser instead if we don't explicitly set it here. |
153 BrowserList::SetLastActive(browser_); | 153 BrowserList::SetLastActive(browser_); |
154 | 154 |
155 bool is_session_restore = browser_->is_session_restore(); | 155 bool is_session_restore = browser_->is_session_restore(); |
156 NSWindowAnimationBehavior saved_animation_behavior = | 156 NSWindowAnimationBehavior saved_animation_behavior = |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
833 void BrowserWindowCocoa::UnhideDownloadShelf() { | 833 void BrowserWindowCocoa::UnhideDownloadShelf() { |
834 GetDownloadShelf()->Unhide(); | 834 GetDownloadShelf()->Unhide(); |
835 } | 835 } |
836 | 836 |
837 void BrowserWindowCocoa::HideDownloadShelf() { | 837 void BrowserWindowCocoa::HideDownloadShelf() { |
838 GetDownloadShelf()->Hide(); | 838 GetDownloadShelf()->Hide(); |
839 StatusBubble* statusBubble = GetStatusBubble(); | 839 StatusBubble* statusBubble = GetStatusBubble(); |
840 if (statusBubble) | 840 if (statusBubble) |
841 statusBubble->Hide(); | 841 statusBubble->Hide(); |
842 } | 842 } |
OLD | NEW |