Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Side by Side Diff: chrome/browser/ui/browser_commands.cc

Issue 634583003: Simplify VersionInfo code, avoid hitting sandbox IPC constantly on Windows (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: linux include Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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
OLDNEW
« no previous file with comments | « chrome/browser/sync/glue/local_device_info_provider_impl.cc ('k') | chrome/browser/ui/webui/help/help_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698