| 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 1113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1124 return; | 1124 return; |
| 1125 NavigationController& controller = current_tab->GetController(); | 1125 NavigationController& controller = current_tab->GetController(); |
| 1126 NavigationEntry* entry = controller.GetLastCommittedEntry(); | 1126 NavigationEntry* entry = controller.GetLastCommittedEntry(); |
| 1127 if (!entry) | 1127 if (!entry) |
| 1128 return; | 1128 return; |
| 1129 if (entry->GetIsOverridingUserAgent()) { | 1129 if (entry->GetIsOverridingUserAgent()) { |
| 1130 entry->SetIsOverridingUserAgent(false); | 1130 entry->SetIsOverridingUserAgent(false); |
| 1131 } else { | 1131 } else { |
| 1132 entry->SetIsOverridingUserAgent(true); | 1132 entry->SetIsOverridingUserAgent(true); |
| 1133 chrome::VersionInfo version_info; | 1133 chrome::VersionInfo version_info; |
| 1134 std::string product; | 1134 std::string product = version_info.ProductNameAndVersionForUserAgent(); |
| 1135 if (version_info.is_valid()) | |
| 1136 product = version_info.ProductNameAndVersionForUserAgent(); | |
| 1137 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( | 1135 current_tab->SetUserAgentOverride(content::BuildUserAgentFromOSAndProduct( |
| 1138 kOsOverrideForTabletSite, product)); | 1136 kOsOverrideForTabletSite, product)); |
| 1139 } | 1137 } |
| 1140 controller.ReloadOriginalRequestURL(true); | 1138 controller.ReloadOriginalRequestURL(true); |
| 1141 } | 1139 } |
| 1142 | 1140 |
| 1143 void ToggleFullscreenMode(Browser* browser) { | 1141 void ToggleFullscreenMode(Browser* browser) { |
| 1144 DCHECK(browser); | 1142 DCHECK(browser); |
| 1145 browser->fullscreen_controller()->ToggleBrowserFullscreenMode(); | 1143 browser->fullscreen_controller()->ToggleBrowserFullscreenMode(); |
| 1146 } | 1144 } |
| (...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1286 browser->profile(), | 1284 browser->profile(), |
| 1287 browser->host_desktop_type())); | 1285 browser->host_desktop_type())); |
| 1288 app_browser->tab_strip_model()->AppendWebContents(contents, true); | 1286 app_browser->tab_strip_model()->AppendWebContents(contents, true); |
| 1289 | 1287 |
| 1290 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; | 1288 contents->GetMutableRendererPrefs()->can_accept_load_drops = false; |
| 1291 contents->GetRenderViewHost()->SyncRendererPrefs(); | 1289 contents->GetRenderViewHost()->SyncRendererPrefs(); |
| 1292 app_browser->window()->Show(); | 1290 app_browser->window()->Show(); |
| 1293 } | 1291 } |
| 1294 | 1292 |
| 1295 } // namespace chrome | 1293 } // namespace chrome |
| OLD | NEW |