| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 1296 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1307 | 1307 |
| 1308 browser::Navigate(&local_params); | 1308 browser::Navigate(&local_params); |
| 1309 } | 1309 } |
| 1310 | 1310 |
| 1311 void Browser::WindowFullscreenStateChanged() { | 1311 void Browser::WindowFullscreenStateChanged() { |
| 1312 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); | 1312 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); |
| 1313 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); | 1313 UpdateBookmarkBarState(BOOKMARK_BAR_STATE_CHANGE_TOGGLE_FULLSCREEN); |
| 1314 MessageLoop::current()->PostTask( | 1314 MessageLoop::current()->PostTask( |
| 1315 FROM_HERE, method_factory_.NewRunnableMethod( | 1315 FROM_HERE, method_factory_.NewRunnableMethod( |
| 1316 &Browser::NotifyFullscreenChange)); | 1316 &Browser::NotifyFullscreenChange)); |
| 1317 if (!window_->IsFullscreen()) | 1317 bool notify_tab_of_exit; |
| 1318 #if defined(OS_MACOSX) |
| 1319 notify_tab_of_exit = !window_->InPresentationMode(); |
| 1320 #else |
| 1321 notify_tab_of_exit = !window_->IsFullscreen(); |
| 1322 #endif |
| 1323 if (notify_tab_of_exit) |
| 1318 NotifyTabOfFullscreenExitIfNecessary(); | 1324 NotifyTabOfFullscreenExitIfNecessary(); |
| 1319 } | 1325 } |
| 1320 | 1326 |
| 1321 void Browser::NotifyFullscreenChange() { | 1327 void Browser::NotifyFullscreenChange() { |
| 1322 NotificationService::current()->Notify( | 1328 NotificationService::current()->Notify( |
| 1323 chrome::NOTIFICATION_FULLSCREEN_CHANGED, | 1329 chrome::NOTIFICATION_FULLSCREEN_CHANGED, |
| 1324 Source<Browser>(this), | 1330 Source<Browser>(this), |
| 1325 NotificationService::NoDetails()); | 1331 NotificationService::NoDetails()); |
| 1326 } | 1332 } |
| 1327 | 1333 |
| (...skipping 2496 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3824 const FilePath& path) { | 3830 const FilePath& path) { |
| 3825 EnumerateDirectoryHelper(tab, request_id, path); | 3831 EnumerateDirectoryHelper(tab, request_id, path); |
| 3826 } | 3832 } |
| 3827 | 3833 |
| 3828 void Browser::ToggleFullscreenModeForTab(TabContents* tab, | 3834 void Browser::ToggleFullscreenModeForTab(TabContents* tab, |
| 3829 bool enter_fullscreen) { | 3835 bool enter_fullscreen) { |
| 3830 if (tab != GetSelectedTabContents()) | 3836 if (tab != GetSelectedTabContents()) |
| 3831 return; | 3837 return; |
| 3832 fullscreened_tab_ = enter_fullscreen ? | 3838 fullscreened_tab_ = enter_fullscreen ? |
| 3833 TabContentsWrapper::GetCurrentWrapperForContents(tab) : NULL; | 3839 TabContentsWrapper::GetCurrentWrapperForContents(tab) : NULL; |
| 3834 if (enter_fullscreen && !window_->IsFullscreen()) | 3840 bool in_correct_mode_for_tab_fullscreen; |
| 3841 #if defined(OS_MACOSX) |
| 3842 in_correct_mode_for_tab_fullscreen = window_->InPresentationMode(); |
| 3843 #else |
| 3844 in_correct_mode_for_tab_fullscreen = window_->IsFullscreen(); |
| 3845 #endif |
| 3846 if (enter_fullscreen && !in_correct_mode_for_tab_fullscreen) |
| 3835 tab_caused_fullscreen_ = true; | 3847 tab_caused_fullscreen_ = true; |
| 3836 if (tab_caused_fullscreen_) | 3848 if (tab_caused_fullscreen_) { |
| 3849 #if defined(OS_MACOSX) |
| 3850 TogglePresentationMode(); |
| 3851 #else |
| 3837 ToggleFullscreenMode(); | 3852 ToggleFullscreenMode(); |
| 3853 #endif |
| 3854 } |
| 3838 } | 3855 } |
| 3839 | 3856 |
| 3840 void Browser::JSOutOfMemory(TabContents* tab) { | 3857 void Browser::JSOutOfMemory(TabContents* tab) { |
| 3841 JSOutOfMemoryHelper(tab); | 3858 JSOutOfMemoryHelper(tab); |
| 3842 } | 3859 } |
| 3843 | 3860 |
| 3844 void Browser::RegisterProtocolHandler(TabContents* tab, | 3861 void Browser::RegisterProtocolHandler(TabContents* tab, |
| 3845 const std::string& protocol, | 3862 const std::string& protocol, |
| 3846 const GURL& url, | 3863 const GURL& url, |
| 3847 const string16& title) { | 3864 const string16& title) { |
| (...skipping 1406 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5254 profile()->GetOriginalProfile()->GetProfileSyncService(); | 5271 profile()->GetOriginalProfile()->GetProfileSyncService(); |
| 5255 if (service->HasSyncSetupCompleted()) | 5272 if (service->HasSyncSetupCompleted()) |
| 5256 ShowOptionsTab(chrome::kSyncSetupSubPage); | 5273 ShowOptionsTab(chrome::kSyncSetupSubPage); |
| 5257 else | 5274 else |
| 5258 service->ShowLoginDialog(); | 5275 service->ShowLoginDialog(); |
| 5259 } | 5276 } |
| 5260 | 5277 |
| 5261 void Browser::ToggleSpeechInput() { | 5278 void Browser::ToggleSpeechInput() { |
| 5262 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); | 5279 GetSelectedTabContentsWrapper()->render_view_host()->ToggleSpeechInput(); |
| 5263 } | 5280 } |
| OLD | NEW |