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

Side by Side Diff: chrome/browser/extensions/extension_service.cc

Issue 140343002: extensions: Relocate pref name constants. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: add missing include for mac Created 6 years, 11 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/browser/extensions/extension_service.h" 5 #include "chrome/browser/extensions/extension_service.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <iterator> 8 #include <iterator>
9 #include <set> 9 #include <set>
10 10
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after
73 #include "content/public/browser/site_instance.h" 73 #include "content/public/browser/site_instance.h"
74 #include "content/public/browser/storage_partition.h" 74 #include "content/public/browser/storage_partition.h"
75 #include "content/public/browser/url_data_source.h" 75 #include "content/public/browser/url_data_source.h"
76 #include "extensions/browser/app_sorting.h" 76 #include "extensions/browser/app_sorting.h"
77 #include "extensions/browser/event_router.h" 77 #include "extensions/browser/event_router.h"
78 #include "extensions/browser/extension_registry.h" 78 #include "extensions/browser/extension_registry.h"
79 #include "extensions/browser/extensions_browser_client.h" 79 #include "extensions/browser/extensions_browser_client.h"
80 #include "extensions/browser/external_provider_interface.h" 80 #include "extensions/browser/external_provider_interface.h"
81 #include "extensions/browser/management_policy.h" 81 #include "extensions/browser/management_policy.h"
82 #include "extensions/browser/pending_extension_manager.h" 82 #include "extensions/browser/pending_extension_manager.h"
83 #include "extensions/browser/pref_names.h"
83 #include "extensions/browser/process_manager.h" 84 #include "extensions/browser/process_manager.h"
84 #include "extensions/browser/update_observer.h" 85 #include "extensions/browser/update_observer.h"
85 #include "extensions/common/constants.h" 86 #include "extensions/common/constants.h"
86 #include "extensions/common/error_utils.h" 87 #include "extensions/common/error_utils.h"
87 #include "extensions/common/extension.h" 88 #include "extensions/common/extension.h"
88 #include "extensions/common/extensions_client.h" 89 #include "extensions/common/extensions_client.h"
89 #include "extensions/common/feature_switch.h" 90 #include "extensions/common/feature_switch.h"
90 #include "extensions/common/manifest.h" 91 #include "extensions/common/manifest.h"
91 #include "extensions/common/manifest_constants.h" 92 #include "extensions/common/manifest_constants.h"
92 #include "extensions/common/manifest_handlers/background_info.h" 93 #include "extensions/common/manifest_handlers/background_info.h"
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
357 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED, 358 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_CREATED,
358 content::NotificationService::AllBrowserContextsAndSources()); 359 content::NotificationService::AllBrowserContextsAndSources());
359 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED, 360 registrar_.Add(this, content::NOTIFICATION_RENDERER_PROCESS_TERMINATED,
360 content::NotificationService::AllBrowserContextsAndSources()); 361 content::NotificationService::AllBrowserContextsAndSources());
361 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED, 362 registrar_.Add(this, chrome::NOTIFICATION_UPGRADE_RECOMMENDED,
362 content::NotificationService::AllBrowserContextsAndSources()); 363 content::NotificationService::AllBrowserContextsAndSources());
363 pref_change_registrar_.Init(profile->GetPrefs()); 364 pref_change_registrar_.Init(profile->GetPrefs());
364 base::Closure callback = 365 base::Closure callback =
365 base::Bind(&ExtensionService::OnExtensionInstallPrefChanged, 366 base::Bind(&ExtensionService::OnExtensionInstallPrefChanged,
366 base::Unretained(this)); 367 base::Unretained(this));
367 pref_change_registrar_.Add(prefs::kExtensionInstallAllowList, callback); 368 pref_change_registrar_.Add(extensions::pref_names::kInstallAllowList,
368 pref_change_registrar_.Add(prefs::kExtensionInstallDenyList, callback); 369 callback);
369 pref_change_registrar_.Add(prefs::kExtensionAllowedTypes, callback); 370 pref_change_registrar_.Add(extensions::pref_names::kInstallDenyList,
371 callback);
372 pref_change_registrar_.Add(extensions::pref_names::kAllowedTypes, callback);
370 373
371 // Set up the ExtensionUpdater 374 // Set up the ExtensionUpdater
372 if (autoupdate_enabled) { 375 if (autoupdate_enabled) {
373 int update_frequency = extensions::kDefaultUpdateFrequencySeconds; 376 int update_frequency = extensions::kDefaultUpdateFrequencySeconds;
374 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { 377 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) {
375 base::StringToInt(command_line->GetSwitchValueASCII( 378 base::StringToInt(command_line->GetSwitchValueASCII(
376 switches::kExtensionsUpdateFrequency), 379 switches::kExtensionsUpdateFrequency),
377 &update_frequency); 380 &update_frequency);
378 } 381 }
379 updater_.reset(new extensions::ExtensionUpdater(this, 382 updater_.reset(new extensions::ExtensionUpdater(this,
(...skipping 2435 matching lines...) Expand 10 before | Expand all | Expand 10 after
2815 void ExtensionService::UnloadAllExtensionsInternal() { 2818 void ExtensionService::UnloadAllExtensionsInternal() {
2816 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions(); 2819 profile_->GetExtensionSpecialStoragePolicy()->RevokeRightsForAllExtensions();
2817 2820
2818 registry_->ClearAll(); 2821 registry_->ClearAll();
2819 extension_runtime_data_.clear(); 2822 extension_runtime_data_.clear();
2820 2823
2821 // TODO(erikkay) should there be a notification for this? We can't use 2824 // TODO(erikkay) should there be a notification for this? We can't use
2822 // EXTENSION_UNLOADED since that implies that the extension has been disabled 2825 // EXTENSION_UNLOADED since that implies that the extension has been disabled
2823 // or uninstalled. 2826 // or uninstalled.
2824 } 2827 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698