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 "base/bind.h" | 5 #include "base/bind.h" |
6 #include "base/mac/mac_util.h" | 6 #include "base/mac/mac_util.h" |
7 #include "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/browser.h" |
10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
129 // Since the fullscreen result is already known here, we can pass it dierctly | 129 // Since the fullscreen result is already known here, we can pass it dierctly |
130 // to CheckFullScreenMode. | 130 // to CheckFullScreenMode. |
131 bool is_fullscreen = *(content::Details<bool>(details)).ptr(); | 131 bool is_fullscreen = *(content::Details<bool>(details)).ptr(); |
132 CheckFullScreenMode( | 132 CheckFullScreenMode( |
133 is_fullscreen ? ASSUME_FULLSCREEN_ON : ASSUME_FULLSCREEN_OFF); | 133 is_fullscreen ? ASSUME_FULLSCREEN_ON : ASSUME_FULLSCREEN_OFF); |
134 } | 134 } |
135 | 135 |
136 void DisplaySettingsProviderCocoa::ActiveWorkSpaceChanged() { | 136 void DisplaySettingsProviderCocoa::ActiveWorkSpaceChanged() { |
137 // The active workspace notification might be received earlier than the | 137 // The active workspace notification might be received earlier than the |
138 // browser window knows that it is not in active space. | 138 // browser window knows that it is not in active space. |
139 MessageLoop::current()->PostDelayedTask( | 139 base::MessageLoop::current()->PostDelayedTask( |
140 FROM_HERE, | 140 FROM_HERE, |
141 base::Bind(&DisplaySettingsProviderCocoa::CheckFullScreenMode, | 141 base::Bind(&DisplaySettingsProviderCocoa::CheckFullScreenMode, |
142 weak_factory_.GetWeakPtr(), | 142 weak_factory_.GetWeakPtr(), |
143 PERFORM_FULLSCREEN_CHECK), | 143 PERFORM_FULLSCREEN_CHECK), |
144 base::TimeDelta::FromMilliseconds(kCheckFullScreenDelayTimeMs)); | 144 base::TimeDelta::FromMilliseconds(kCheckFullScreenDelayTimeMs)); |
145 } | 145 } |
146 | 146 |
147 } // namespace | 147 } // namespace |
148 | 148 |
149 // static | 149 // static |
150 DisplaySettingsProvider* DisplaySettingsProvider::Create() { | 150 DisplaySettingsProvider* DisplaySettingsProvider::Create() { |
151 return new DisplaySettingsProviderCocoa(); | 151 return new DisplaySettingsProviderCocoa(); |
152 } | 152 } |
OLD | NEW |