OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/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/cpu.h" | 8 #include "base/cpu.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 340 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
351 | 351 |
352 } // namespace | 352 } // namespace |
353 | 353 |
354 namespace chrome { | 354 namespace chrome { |
355 | 355 |
356 const char* const ChromeContentClient::kPDFPluginName = ::kPDFPluginName; | 356 const char* const ChromeContentClient::kPDFPluginName = ::kPDFPluginName; |
357 const char* const ChromeContentClient::kNaClPluginName = ::kNaClPluginName; | 357 const char* const ChromeContentClient::kNaClPluginName = ::kNaClPluginName; |
358 const char* const ChromeContentClient::kNaClOldPluginName = | 358 const char* const ChromeContentClient::kNaClOldPluginName = |
359 ::kNaClOldPluginName; | 359 ::kNaClOldPluginName; |
360 | 360 |
| 361 std::string ChromeContentClient::GetProductImpl() { |
| 362 chrome::VersionInfo version_info; |
| 363 std::string product("Chrome/"); |
| 364 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; |
| 365 return product; |
| 366 } |
| 367 |
361 void ChromeContentClient::SetActiveURL(const GURL& url) { | 368 void ChromeContentClient::SetActiveURL(const GURL& url) { |
362 child_process_logging::SetActiveURL(url); | 369 child_process_logging::SetActiveURL(url); |
363 } | 370 } |
364 | 371 |
365 void ChromeContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) { | 372 void ChromeContentClient::SetGpuInfo(const content::GPUInfo& gpu_info) { |
366 child_process_logging::SetGpuInfo(gpu_info); | 373 child_process_logging::SetGpuInfo(gpu_info); |
367 } | 374 } |
368 | 375 |
369 void ChromeContentClient::AddPepperPlugins( | 376 void ChromeContentClient::AddPepperPlugins( |
370 std::vector<content::PepperPluginInfo>* plugins) { | 377 std::vector<content::PepperPluginInfo>* plugins) { |
(...skipping 25 matching lines...) Expand all Loading... |
396 | 403 |
397 bool ChromeContentClient::CanHandleWhileSwappedOut( | 404 bool ChromeContentClient::CanHandleWhileSwappedOut( |
398 const IPC::Message& msg) { | 405 const IPC::Message& msg) { |
399 // Any Chrome-specific messages (apart from those listed in | 406 // Any Chrome-specific messages (apart from those listed in |
400 // CanSendWhileSwappedOut) that must be handled by the browser when sent from | 407 // CanSendWhileSwappedOut) that must be handled by the browser when sent from |
401 // swapped out renderers. | 408 // swapped out renderers. |
402 return false; | 409 return false; |
403 } | 410 } |
404 | 411 |
405 std::string ChromeContentClient::GetProduct() const { | 412 std::string ChromeContentClient::GetProduct() const { |
406 chrome::VersionInfo version_info; | 413 return GetProductImpl(); |
407 std::string product("Chrome/"); | |
408 product += version_info.is_valid() ? version_info.Version() : "0.0.0.0"; | |
409 return product; | |
410 } | 414 } |
411 | 415 |
412 std::string ChromeContentClient::GetUserAgent() const { | 416 std::string ChromeContentClient::GetUserAgent() const { |
413 std::string product = GetProduct(); | 417 std::string product = GetProduct(); |
414 #if defined(OS_ANDROID) | 418 #if defined(OS_ANDROID) |
415 CommandLine* command_line = CommandLine::ForCurrentProcess(); | 419 CommandLine* command_line = CommandLine::ForCurrentProcess(); |
416 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) | 420 if (command_line->HasSwitch(switches::kUseMobileUserAgent)) |
417 product += " Mobile"; | 421 product += " Mobile"; |
418 #endif | 422 #endif |
419 return webkit_glue::BuildUserAgentFromProduct(product); | 423 return webkit_glue::BuildUserAgentFromProduct(product); |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
464 } | 468 } |
465 return false; | 469 return false; |
466 } | 470 } |
467 | 471 |
468 std::string ChromeContentClient::GetCarbonInterposePath() const { | 472 std::string ChromeContentClient::GetCarbonInterposePath() const { |
469 return std::string(kInterposeLibraryPath); | 473 return std::string(kInterposeLibraryPath); |
470 } | 474 } |
471 #endif | 475 #endif |
472 | 476 |
473 } // namespace chrome | 477 } // namespace chrome |
OLD | NEW |