| OLD | NEW |
| 1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/browser_commands.h" | 5 #include "chrome/browser/ui/browser_commands.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 #include "chrome/browser/ui/accelerator_utils.h" | 33 #include "chrome/browser/ui/accelerator_utils.h" |
| 34 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" | 34 #include "chrome/browser/ui/bookmarks/bookmark_utils.h" |
| 35 #include "chrome/browser/ui/browser.h" | 35 #include "chrome/browser/ui/browser.h" |
| 36 #include "chrome/browser/ui/browser_command_controller.h" | 36 #include "chrome/browser/ui/browser_command_controller.h" |
| 37 #include "chrome/browser/ui/browser_dialogs.h" | 37 #include "chrome/browser/ui/browser_dialogs.h" |
| 38 #include "chrome/browser/ui/browser_instant_controller.h" | 38 #include "chrome/browser/ui/browser_instant_controller.h" |
| 39 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" | 39 #include "chrome/browser/ui/browser_tab_restore_service_delegate.h" |
| 40 #include "chrome/browser/ui/browser_tabstrip.h" | 40 #include "chrome/browser/ui/browser_tabstrip.h" |
| 41 #include "chrome/browser/ui/browser_window.h" | 41 #include "chrome/browser/ui/browser_window.h" |
| 42 #include "chrome/browser/ui/chrome_pages.h" | 42 #include "chrome/browser/ui/chrome_pages.h" |
| 43 #include "chrome/browser/ui/exclusive_access/exclusive_access_controller_manager
.h" |
| 43 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" | 44 #include "chrome/browser/ui/exclusive_access/fullscreen_controller.h" |
| 44 #include "chrome/browser/ui/find_bar/find_bar.h" | 45 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 45 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 46 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 46 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 47 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 47 #include "chrome/browser/ui/location_bar/location_bar.h" | 48 #include "chrome/browser/ui/location_bar/location_bar.h" |
| 48 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" | 49 #include "chrome/browser/ui/passwords/manage_passwords_ui_controller.h" |
| 49 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" | 50 #include "chrome/browser/ui/scoped_tabbed_browser_displayer.h" |
| 50 #include "chrome/browser/ui/search/search_tab_helper.h" | 51 #include "chrome/browser/ui/search/search_tab_helper.h" |
| 51 #include "chrome/browser/ui/status_bubble.h" | 52 #include "chrome/browser/ui/status_bubble.h" |
| 52 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" | 53 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" |
| (...skipping 1070 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1123 chrome::VersionInfo version_info; | 1124 chrome::VersionInfo version_info; |
| 1124 std::string product = version_info.ProductNameAndVersionForUserAgent(); | 1125 std::string product = version_info.ProductNameAndVersionForUserAgent(); |
| 1125 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( | 1126 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( |
| 1126 kOsOverrideForTabletSite, product)); | 1127 kOsOverrideForTabletSite, product)); |
| 1127 } | 1128 } |
| 1128 controller.ReloadOriginalRequestURL(true); | 1129 controller.ReloadOriginalRequestURL(true); |
| 1129 } | 1130 } |
| 1130 | 1131 |
| 1131 void ToggleFullscreenMode(Browser* browser) { | 1132 void ToggleFullscreenMode(Browser* browser) { |
| 1132 DCHECK(browser); | 1133 DCHECK(browser); |
| 1133 browser->fullscreen_controller()->ToggleBrowserFullscreenMode(); | 1134 browser->GetExclusiveAccessControllerManager() |
| 1135 ->GetFullscreenController() |
| 1136 ->ToggleBrowserFullscreenMode(); |
| 1134 } | 1137 } |
| 1135 | 1138 |
| 1136 void ClearCache(Browser* browser) { | 1139 void ClearCache(Browser* browser) { |
| 1137 BrowsingDataRemover* remover = | 1140 BrowsingDataRemover* remover = |
| 1138 BrowsingDataRemover::CreateForUnboundedRange(browser->profile()); | 1141 BrowsingDataRemover::CreateForUnboundedRange(browser->profile()); |
| 1139 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, | 1142 remover->Remove(BrowsingDataRemover::REMOVE_CACHE, |
| 1140 BrowsingDataHelper::UNPROTECTED_WEB); | 1143 BrowsingDataHelper::UNPROTECTED_WEB); |
| 1141 // BrowsingDataRemover takes care of deleting itself when done. | 1144 // BrowsingDataRemover takes care of deleting itself when done. |
| 1142 } | 1145 } |
| 1143 | 1146 |
| (...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1276 browser->host_desktop_type())); | 1279 browser->host_desktop_type())); |
| 1277 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1280 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1278 | 1281 |
| 1279 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1282 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1280 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1283 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1281 app_browser->window()->Show(); | 1284 app_browser->window()->Show(); |
| 1282 } | 1285 } |
| 1283 #endif // defined(ENABLE_EXTENSIONS) | 1286 #endif // defined(ENABLE_EXTENSIONS) |
| 1284 | 1287 |
| 1285 } // namespace chrome | 1288 } // namespace chrome |
| OLD | NEW |