OLD | NEW |
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 Loading... |
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* overriding) const { | 303 std::string ChromeContentClient::GetUserAgent(bool mimic_windows) const { |
304 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kUserAgent)) { | 304 chrome::VersionInfo version_info; |
305 *overriding = true; | 305 std::string product("Chrome/"); |
306 return CommandLine::ForCurrentProcess()->GetSwitchValueASCII( | 306 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
307 switches::kUserAgent); | 307 |
308 } else { | 308 return webkit_glue::BuildUserAgentHelper(mimic_windows, product); |
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::BuildUserAgentFromProduct(product); | |
314 } | |
315 } | 309 } |
316 | 310 |
317 string16 ChromeContentClient::GetLocalizedString(int message_id) const { | 311 string16 ChromeContentClient::GetLocalizedString(int message_id) const { |
318 return l10n_util::GetStringUTF16(message_id); | 312 return l10n_util::GetStringUTF16(message_id); |
319 } | 313 } |
320 | 314 |
321 base::StringPiece ChromeContentClient::GetDataResource(int resource_id) const { | 315 base::StringPiece ChromeContentClient::GetDataResource(int resource_id) const { |
322 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); | 316 return ResourceBundle::GetSharedInstance().GetRawDataResource(resource_id); |
323 } | 317 } |
324 | 318 |
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); | 370 policy->SetJobLevel(sandbox::JOB_UNPROTECTED, 0); |
377 policy->SetTokenLevel( | 371 policy->SetTokenLevel( |
378 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); | 372 sandbox::USER_UNPROTECTED, sandbox::USER_UNPROTECTED); |
379 } | 373 } |
380 | 374 |
381 return true; | 375 return true; |
382 } | 376 } |
383 #endif | 377 #endif |
384 | 378 |
385 } // namespace chrome | 379 } // namespace chrome |
OLD | NEW |