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

Side by Side Diff: chrome/common/chrome_content_client.cc

Issue 7922023: Remove webkit_glue::BuildUserAgent(), remove windows spoofing (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix GetUserAgent() to return whether the user agent is overriding, clean up Created 9 years, 3 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 | Annotate | Revision Log
OLDNEW
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/common/chrome_content_client.h" 5 #include "chrome/common/chrome_content_client.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_util.h" 8 #include "base/file_util.h"
9 #include "base/path_service.h" 9 #include "base/path_service.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 // swapped out renderers. 293 // swapped out renderers.
294 switch (msg.type()) { 294 switch (msg.type()) {
295 case ChromeViewHostMsg_Snapshot::ID: 295 case ChromeViewHostMsg_Snapshot::ID:
296 return true; 296 return true;
297 default: 297 default:
298 break; 298 break;
299 } 299 }
300 return false; 300 return false;
301 } 301 }
302 302
303 std::string ChromeContentClient::GetUserAgent(bool mimic_windows) const { 303 std::string ChromeContentClient::GetUserAgent(bool *overriding) const {
Evan Martin 2011/09/21 20:27:24 star on the left
304 chrome::VersionInfo version_info; 304 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) {
Dirk Pranke 2011/09/21 20:02:48 I'm not sure if we can be sure that CommandLine::F
Evan Martin 2011/09/21 20:27:24 I think we don't have any real contract for it, so
Dirk Pranke 2011/09/21 21:02:35 ok.
305 std::string product("Chrome/"); 305 *overriding = true;
306 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; 306 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
307 307 switches::kUserAgent);
308 return webkit_glue::BuildUserAgentHelper(mimic_windows, product); 308 } else {
309 *overriding = false;
310 chrome::VersionInfo version_info;
311 std::string product("Chrome/");
312 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0";
313 return webkit_glue::BuildUserAgentHelper(product);
314 }
309 } 315 }
310 316
311 string16 ChromeContentClient::GetLocalizedString(int message_id) const { 317 string16 ChromeContentClient::GetLocalizedString(int message_id) const {
312 return l10n_util::GetStringUTF16(message_id); 318 return l10n_util::GetStringUTF16(message_id);
313 } 319 }
314 320
315 base::StringPiece ChromeContentClient::GetDataResource(int resource_id) const { 321 base::StringPiece ChromeContentClient::GetDataResource(int resource_id) const {
316 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); 322 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id);
317 } 323 }
318 324
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
370 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); 376 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0);
371 policy->SetTokenLevel( 377 policy->SetTokenLevel(
372 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); 378 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED);
373 } 379 }
374 380
375 return true; 381 return true;
376 } 382 }
377 #endif 383 #endif
378 384
379 } // namespace chrome 385 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698