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

Side by Side Diff: extensions/browser/extension_prefs.cc

Issue 2252373002: Re-write many calls to WrapUnique() with MakeUnique() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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 | « extensions/browser/extension_function.cc ('k') | extensions/browser/extension_protocols.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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/browser/extension_prefs.h" 5 #include "extensions/browser/extension_prefs.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <iterator> 10 #include <iterator>
(...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after
341 // 341 //
342 342
343 // static 343 // static
344 ExtensionPrefs* ExtensionPrefs::Create( 344 ExtensionPrefs* ExtensionPrefs::Create(
345 content::BrowserContext* browser_context, 345 content::BrowserContext* browser_context,
346 PrefService* prefs, 346 PrefService* prefs,
347 const base::FilePath& root_dir, 347 const base::FilePath& root_dir,
348 ExtensionPrefValueMap* extension_pref_value_map, 348 ExtensionPrefValueMap* extension_pref_value_map,
349 bool extensions_disabled, 349 bool extensions_disabled,
350 const std::vector<ExtensionPrefsObserver*>& early_observers) { 350 const std::vector<ExtensionPrefsObserver*>& early_observers) {
351 return ExtensionPrefs::Create(browser_context, prefs, root_dir, 351 return ExtensionPrefs::Create(
352 extension_pref_value_map, extensions_disabled, 352 browser_context, prefs, root_dir, extension_pref_value_map,
353 early_observers, 353 extensions_disabled, early_observers, base::MakeUnique<TimeProvider>());
354 base::WrapUnique(new TimeProvider()));
355 } 354 }
356 355
357 // static 356 // static
358 ExtensionPrefs* ExtensionPrefs::Create( 357 ExtensionPrefs* ExtensionPrefs::Create(
359 content::BrowserContext* browser_context, 358 content::BrowserContext* browser_context,
360 PrefService* pref_service, 359 PrefService* pref_service,
361 const base::FilePath& root_dir, 360 const base::FilePath& root_dir,
362 ExtensionPrefValueMap* extension_pref_value_map, 361 ExtensionPrefValueMap* extension_pref_value_map,
363 bool extensions_disabled, 362 bool extensions_disabled,
364 const std::vector<ExtensionPrefsObserver*>& early_observers, 363 const std::vector<ExtensionPrefsObserver*>& early_observers,
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
602 ReadPrefAsURLPatternSet( 601 ReadPrefAsURLPatternSet(
603 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts), 602 extension_id, JoinPrefs(pref_key, kPrefExplicitHosts),
604 &explicit_hosts, Extension::kValidHostPermissionSchemes); 603 &explicit_hosts, Extension::kValidHostPermissionSchemes);
605 604
606 // Retrieve the scriptable host permissions. 605 // Retrieve the scriptable host permissions.
607 URLPatternSet scriptable_hosts; 606 URLPatternSet scriptable_hosts;
608 ReadPrefAsURLPatternSet( 607 ReadPrefAsURLPatternSet(
609 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts), 608 extension_id, JoinPrefs(pref_key, kPrefScriptableHosts),
610 &scriptable_hosts, UserScript::ValidUserScriptSchemes()); 609 &scriptable_hosts, UserScript::ValidUserScriptSchemes());
611 610
612 return base::WrapUnique(new PermissionSet(apis, manifest_permissions, 611 return base::MakeUnique<PermissionSet>(apis, manifest_permissions,
613 explicit_hosts, scriptable_hosts)); 612 explicit_hosts, scriptable_hosts);
614 } 613 }
615 614
616 // Set the API or Manifest permissions. 615 // Set the API or Manifest permissions.
617 // The format of api_values is: 616 // The format of api_values is:
618 // [ "permission_name1", // permissions do not support detail. 617 // [ "permission_name1", // permissions do not support detail.
619 // "permission_name2", 618 // "permission_name2",
620 // {"permission_name3": value }, 619 // {"permission_name3": value },
621 // // permission supports detail, permission detail will be stored in value. 620 // // permission supports detail, permission detail will be stored in value.
622 // ... 621 // ...
623 // ] 622 // ]
(...skipping 1362 matching lines...) Expand 10 before | Expand all | Expand 10 after
1986 extension_pref_value_map_->RegisterExtension( 1985 extension_pref_value_map_->RegisterExtension(
1987 extension_id, install_time, is_enabled, is_incognito_enabled); 1986 extension_id, install_time, is_enabled, is_incognito_enabled);
1988 1987
1989 FOR_EACH_OBSERVER( 1988 FOR_EACH_OBSERVER(
1990 ExtensionPrefsObserver, 1989 ExtensionPrefsObserver,
1991 observer_list_, 1990 observer_list_,
1992 OnExtensionRegistered(extension_id, install_time, is_enabled)); 1991 OnExtensionRegistered(extension_id, install_time, is_enabled));
1993 } 1992 }
1994 1993
1995 } // namespace extensions 1994 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/extension_function.cc ('k') | extensions/browser/extension_protocols.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698