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

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

Issue 189005: Revert 25204 - Revert 24846 Enable extensions by default.... (Closed) Base URL: svn://chrome-svn/chrome/branches/205/src/
Patch Set: Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/extensions_service.h" 5 #include "chrome/browser/extensions/extensions_service.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/string_util.h" 9 #include "base/string_util.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 const CommandLine* command_line, 88 const CommandLine* command_line,
89 PrefService* prefs, 89 PrefService* prefs,
90 const FilePath& install_directory, 90 const FilePath& install_directory,
91 MessageLoop* frontend_loop, 91 MessageLoop* frontend_loop,
92 MessageLoop* backend_loop, 92 MessageLoop* backend_loop,
93 bool autoupdate_enabled) 93 bool autoupdate_enabled)
94 : profile_(profile), 94 : profile_(profile),
95 extension_prefs_(new ExtensionPrefs(prefs, install_directory)), 95 extension_prefs_(new ExtensionPrefs(prefs, install_directory)),
96 backend_loop_(backend_loop), 96 backend_loop_(backend_loop),
97 install_directory_(install_directory), 97 install_directory_(install_directory),
98 extensions_enabled_(false), 98 extensions_enabled_(true),
99 show_extensions_prompts_(true), 99 show_extensions_prompts_(true),
100 ready_(false) { 100 ready_(false) {
101 // Figure out if extension installation should be enabled. 101 // Figure out if extension installation should be enabled.
102 if (command_line->HasSwitch(switches::kEnableExtensions)) { 102 if (command_line->HasSwitch(switches::kDisableExtensions)) {
103 extensions_enabled_ = true; 103 extensions_enabled_ = false;
104 } else if (profile->GetPrefs()->GetBoolean(prefs::kEnableExtensions)) { 104 } else if (profile->GetPrefs()->GetBoolean(prefs::kDisableExtensions)) {
105 extensions_enabled_ = true; 105 extensions_enabled_ = false;
106 } 106 }
107 107
108 // Set up the ExtensionUpdater 108 // Set up the ExtensionUpdater
109 if (autoupdate_enabled) { 109 if (autoupdate_enabled) {
110 int update_frequency = kDefaultUpdateFrequencySeconds; 110 int update_frequency = kDefaultUpdateFrequencySeconds;
111 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) { 111 if (command_line->HasSwitch(switches::kExtensionsUpdateFrequency)) {
112 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue( 112 update_frequency = StringToInt(WideToASCII(command_line->GetSwitchValue(
113 switches::kExtensionsUpdateFrequency))); 113 switches::kExtensionsUpdateFrequency)));
114 } 114 }
115 updater_ = new ExtensionUpdater(this, prefs, update_frequency, 115 updater_ = new ExtensionUpdater(this, prefs, update_frequency,
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after
700 linked_ptr<ExternalExtensionProvider>(test_provider); 700 linked_ptr<ExternalExtensionProvider>(test_provider);
701 } 701 }
702 702
703 void ExtensionsServiceBackend::OnExternalExtensionFound( 703 void ExtensionsServiceBackend::OnExternalExtensionFound(
704 const std::string& id, const Version* version, const FilePath& path, 704 const std::string& id, const Version* version, const FilePath& path,
705 Extension::Location location) { 705 Extension::Location location) {
706 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_, 706 frontend_loop_->PostTask(FROM_HERE, NewRunnableMethod(frontend_,
707 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(), 707 &ExtensionsService::OnExternalExtensionFound, id, version->GetString(),
708 path, location)); 708 path, location));
709 } 709 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_uitest.cc ('k') | chrome/browser/extensions/extensions_service_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698