OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/browser.h" | 5 #include "chrome/browser/browser.h" |
6 | 6 |
7 #include "app/animation.h" | 7 #include "app/animation.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/keyboard_codes.h" | 10 #include "base/keyboard_codes.h" |
(...skipping 903 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
914 void Browser::ConvertPopupToTabbedBrowser() { | 914 void Browser::ConvertPopupToTabbedBrowser() { |
915 UserMetrics::RecordAction(L"ShowAsTab", profile_); | 915 UserMetrics::RecordAction(L"ShowAsTab", profile_); |
916 int tab_strip_index = tabstrip_model_.selected_index(); | 916 int tab_strip_index = tabstrip_model_.selected_index(); |
917 TabContents* contents = tabstrip_model_.DetachTabContentsAt(tab_strip_index); | 917 TabContents* contents = tabstrip_model_.DetachTabContentsAt(tab_strip_index); |
918 Browser* browser = Browser::Create(profile_); | 918 Browser* browser = Browser::Create(profile_); |
919 browser->tabstrip_model()->AppendTabContents(contents, true); | 919 browser->tabstrip_model()->AppendTabContents(contents, true); |
920 browser->window()->Show(); | 920 browser->window()->Show(); |
921 } | 921 } |
922 | 922 |
923 void Browser::ToggleFullscreenMode() { | 923 void Browser::ToggleFullscreenMode() { |
| 924 #if !defined(OS_MACOSX) |
| 925 // In kiosk mode, we always want to be fullscreen. When the browser first |
| 926 // starts we're not yet fullscreen, so let the initial toggle go through. |
| 927 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode) && |
| 928 window_->IsFullscreen()) |
| 929 return; |
| 930 #endif |
| 931 |
924 UserMetrics::RecordAction(L"ToggleFullscreen", profile_); | 932 UserMetrics::RecordAction(L"ToggleFullscreen", profile_); |
925 window_->SetFullscreen(!window_->IsFullscreen()); | 933 window_->SetFullscreen(!window_->IsFullscreen()); |
926 // On Linux, setting fullscreen mode is an async call to the X server, which | 934 // On Linux, setting fullscreen mode is an async call to the X server, which |
927 // may or may not support fullscreen mode. | 935 // may or may not support fullscreen mode. |
928 #if !defined(OS_LINUX) | 936 #if !defined(OS_LINUX) |
929 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); | 937 UpdateCommandsForFullscreenMode(window_->IsFullscreen()); |
930 #endif | 938 #endif |
931 } | 939 } |
932 | 940 |
933 #if defined(TOOLKIT_VIEWS) | 941 #if defined(TOOLKIT_VIEWS) |
(...skipping 1703 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2637 UpdateMap::iterator i = scheduled_updates_.find(contents); | 2645 UpdateMap::iterator i = scheduled_updates_.find(contents); |
2638 if (i != scheduled_updates_.end()) | 2646 if (i != scheduled_updates_.end()) |
2639 scheduled_updates_.erase(i); | 2647 scheduled_updates_.erase(i); |
2640 } | 2648 } |
2641 | 2649 |
2642 | 2650 |
2643 /////////////////////////////////////////////////////////////////////////////// | 2651 /////////////////////////////////////////////////////////////////////////////// |
2644 // Browser, Getters for UI (private): | 2652 // Browser, Getters for UI (private): |
2645 | 2653 |
2646 StatusBubble* Browser::GetStatusBubble() { | 2654 StatusBubble* Browser::GetStatusBubble() { |
| 2655 #if !defined(OS_MACOSX) |
| 2656 // In kiosk mode, we want to always hide the status bubble. |
| 2657 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 2658 return NULL; |
| 2659 #endif |
2647 return window_ ? window_->GetStatusBubble() : NULL; | 2660 return window_ ? window_->GetStatusBubble() : NULL; |
2648 } | 2661 } |
2649 | 2662 |
2650 /////////////////////////////////////////////////////////////////////////////// | 2663 /////////////////////////////////////////////////////////////////////////////// |
2651 // Browser, Session restore functions (private): | 2664 // Browser, Session restore functions (private): |
2652 | 2665 |
2653 void Browser::SyncHistoryWithTabs(int index) { | 2666 void Browser::SyncHistoryWithTabs(int index) { |
2654 if (!profile()->HasSessionService()) | 2667 if (!profile()->HasSessionService()) |
2655 return; | 2668 return; |
2656 SessionService* session_service = profile()->GetSessionService(); | 2669 SessionService* session_service = profile()->GetSessionService(); |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3009 /////////////////////////////////////////////////////////////////////////////// | 3022 /////////////////////////////////////////////////////////////////////////////// |
3010 // BrowserToolbarModel (private): | 3023 // BrowserToolbarModel (private): |
3011 | 3024 |
3012 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { | 3025 NavigationController* Browser::BrowserToolbarModel::GetNavigationController() { |
3013 // This |current_tab| can be NULL during the initialization of the | 3026 // This |current_tab| can be NULL during the initialization of the |
3014 // toolbar during window creation (i.e. before any tabs have been added | 3027 // toolbar during window creation (i.e. before any tabs have been added |
3015 // to the window). | 3028 // to the window). |
3016 TabContents* current_tab = browser_->GetSelectedTabContents(); | 3029 TabContents* current_tab = browser_->GetSelectedTabContents(); |
3017 return current_tab ? ¤t_tab->controller() : NULL; | 3030 return current_tab ? ¤t_tab->controller() : NULL; |
3018 } | 3031 } |
OLD | NEW |