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

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

Issue 2258263002: Consistently use namespaced base::Version. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased against master. Created 4 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
« no previous file with comments | « chrome/browser/upgrade_detector_impl.cc ('k') | chrome/common/service_process_util.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 <stdint.h> 7 #include <stdint.h>
8 8
9 #include <map> 9 #include <map>
10 #include <memory> 10 #include <memory>
(...skipping 381 matching lines...) Expand 10 before | Expand all | Expand 10 after
392 if (!base::ReadFileToString(manifest_path, &manifest_data)) 392 if (!base::ReadFileToString(manifest_path, &manifest_data))
393 return false; 393 return false;
394 std::unique_ptr<base::Value> manifest_value( 394 std::unique_ptr<base::Value> manifest_value(
395 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS)); 395 base::JSONReader::Read(manifest_data, base::JSON_ALLOW_TRAILING_COMMAS));
396 if (!manifest_value.get()) 396 if (!manifest_value.get())
397 return false; 397 return false;
398 base::DictionaryValue* manifest = NULL; 398 base::DictionaryValue* manifest = NULL;
399 if (!manifest_value->GetAsDictionary(&manifest)) 399 if (!manifest_value->GetAsDictionary(&manifest))
400 return false; 400 return false;
401 401
402 Version version; 402 base::Version version;
403 if (!chrome::CheckPepperFlashManifest(*manifest, &version)) 403 if (!chrome::CheckPepperFlashManifest(*manifest, &version))
404 return false; 404 return false;
405 405
406 *plugin = CreatePepperFlashInfo(flash_filename, 406 *plugin = CreatePepperFlashInfo(flash_filename,
407 version.GetString(), 407 version.GetString(),
408 chrome::IsSystemFlashScriptDebuggerPresent(), 408 chrome::IsSystemFlashScriptDebuggerPresent(),
409 true, 409 true,
410 false); 410 false);
411 return true; 411 return true;
412 } 412 }
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
494 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin( 494 content::PepperPluginInfo* ChromeContentClient::FindMostRecentPlugin(
495 const std::vector<content::PepperPluginInfo*>& plugins) { 495 const std::vector<content::PepperPluginInfo*>& plugins) {
496 if (plugins.empty()) 496 if (plugins.empty())
497 return nullptr; 497 return nullptr;
498 498
499 using PluginSortKey = std::tuple<base::Version, bool, bool, bool, bool>; 499 using PluginSortKey = std::tuple<base::Version, bool, bool, bool, bool>;
500 500
501 std::map<PluginSortKey, content::PepperPluginInfo*> plugin_map; 501 std::map<PluginSortKey, content::PepperPluginInfo*> plugin_map;
502 502
503 for (auto* plugin : plugins) { 503 for (auto* plugin : plugins) {
504 Version version(plugin->version); 504 base::Version version(plugin->version);
505 DCHECK(version.IsValid()); 505 DCHECK(version.IsValid());
506 plugin_map[PluginSortKey(version, plugin->is_debug, 506 plugin_map[PluginSortKey(version, plugin->is_debug,
507 plugin->is_bundled, plugin->is_on_local_drive, 507 plugin->is_bundled, plugin->is_on_local_drive,
508 !plugin->is_external)] = plugin; 508 !plugin->is_external)] = plugin;
509 } 509 }
510 510
511 return plugin_map.rbegin()->second; 511 return plugin_map.rbegin()->second;
512 } 512 }
513 #endif // defined(ENABLE_PLUGINS) 513 #endif // defined(ENABLE_PLUGINS)
514 514
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after
730 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy()); 730 origin_trial_policy_ = base::WrapUnique(new ChromeOriginTrialPolicy());
731 } 731 }
732 return origin_trial_policy_.get(); 732 return origin_trial_policy_.get();
733 } 733 }
734 734
735 #if defined(OS_ANDROID) 735 #if defined(OS_ANDROID)
736 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() { 736 media::MediaClientAndroid* ChromeContentClient::GetMediaClientAndroid() {
737 return new ChromeMediaClientAndroid(); 737 return new ChromeMediaClientAndroid();
738 } 738 }
739 #endif // OS_ANDROID 739 #endif // OS_ANDROID
OLDNEW
« no previous file with comments | « chrome/browser/upgrade_detector_impl.cc ('k') | chrome/common/service_process_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698