[email protected] | 098fa7a | 2013-03-08 22:11:17 | [diff] [blame] | 1 | // Copyright (c) 2013 The Chromium Authors. All rights reserved. |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #include "chrome/browser/extensions/unpacked_installer.h" |
| 6 | |
| 7 | #include "base/bind.h" |
| 8 | #include "base/callback.h" |
| 9 | #include "base/file_util.h" |
[email protected] | 46acbf1 | 2013-06-10 18:43:42 | [diff] [blame] | 10 | #include "base/strings/string_util.h" |
[email protected] | 99d2131 | 2013-05-14 15:51:13 | [diff] [blame] | 11 | #include "base/strings/utf_string_conversions.h" |
[email protected] | bebe1d0 | 2012-08-02 20:17:09 | [diff] [blame] | 12 | #include "base/threading/thread_restrictions.h" |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 13 | #include "chrome/browser/extensions/extension_install_prompt.h" |
[email protected] | 00b3824 | 2012-07-18 18:43:22 | [diff] [blame] | 14 | #include "chrome/browser/extensions/extension_install_ui.h" |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 15 | #include "chrome/browser/extensions/extension_prefs.h" |
| 16 | #include "chrome/browser/extensions/extension_service.h" |
[email protected] | 0d90431 | 2012-01-25 23:00:16 | [diff] [blame] | 17 | #include "chrome/browser/extensions/permissions_updater.h" |
[email protected] | 098fa7a | 2013-03-08 22:11:17 | [diff] [blame] | 18 | #include "chrome/common/extensions/api/plugins/plugins_handler.h" |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 19 | #include "chrome/common/extensions/extension_file_util.h" |
[email protected] | 557c7bd | 2013-09-18 21:51:25 | [diff] [blame] | 20 | #include "chrome/common/extensions/extension_l10n_util.h" |
[email protected] | 79a6064 | 2012-10-20 21:03:18 | [diff] [blame] | 21 | #include "content/public/browser/browser_thread.h" |
[email protected] | e4452d3 | 2013-11-15 23:07:41 | [diff] [blame^] | 22 | #include "extensions/common/extension.h" |
[email protected] | 993da5e | 2013-03-23 21:25:16 | [diff] [blame] | 23 | #include "extensions/common/id_util.h" |
[email protected] | d42c1115 | 2013-08-22 19:36:32 | [diff] [blame] | 24 | #include "extensions/common/manifest.h" |
[email protected] | 36b64321 | 2012-09-07 12:53:00 | [diff] [blame] | 25 | #include "sync/api/string_ordinal.h" |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 26 | |
[email protected] | 545ab7a | 2011-11-03 14:54:21 | [diff] [blame] | 27 | using content::BrowserThread; |
[email protected] | 1c321ee | 2012-05-21 03:02:34 | [diff] [blame] | 28 | using extensions::Extension; |
[email protected] | 545ab7a | 2011-11-03 14:54:21 | [diff] [blame] | 29 | |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 30 | namespace { |
| 31 | |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 32 | const char kUnpackedExtensionsBlacklistedError[] = |
| 33 | "Loading of unpacked extensions is disabled by the administrator."; |
| 34 | |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 35 | // Manages an ExtensionInstallPrompt for a particular extension. |
| 36 | class SimpleExtensionLoadPrompt : public ExtensionInstallPrompt::Delegate { |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 37 | public: |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 38 | SimpleExtensionLoadPrompt(const Extension* extension, |
| 39 | Profile* profile, |
| 40 | const base::Closure& callback); |
[email protected] | 49aeab6 | 2013-02-07 02:53:11 | [diff] [blame] | 41 | virtual ~SimpleExtensionLoadPrompt(); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 42 | |
| 43 | void ShowPrompt(); |
| 44 | |
| 45 | // ExtensionInstallUI::Delegate |
[email protected] | 0d90431 | 2012-01-25 23:00:16 | [diff] [blame] | 46 | virtual void InstallUIProceed() OVERRIDE; |
| 47 | virtual void InstallUIAbort(bool user_initiated) OVERRIDE; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 48 | |
| 49 | private: |
[email protected] | c82da8c4 | 2012-06-08 19:49:11 | [diff] [blame] | 50 | scoped_ptr<ExtensionInstallPrompt> install_ui_; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 51 | scoped_refptr<const Extension> extension_; |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 52 | base::Closure callback_; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 53 | }; |
| 54 | |
| 55 | SimpleExtensionLoadPrompt::SimpleExtensionLoadPrompt( |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 56 | const Extension* extension, |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 57 | Profile* profile, |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 58 | const base::Closure& callback) |
| 59 | : install_ui_(ExtensionInstallUI::CreateInstallPromptWithProfile( |
| 60 | profile)), |
| 61 | extension_(extension), |
| 62 | callback_(callback) { |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 63 | } |
| 64 | |
| 65 | SimpleExtensionLoadPrompt::~SimpleExtensionLoadPrompt() { |
| 66 | } |
| 67 | |
| 68 | void SimpleExtensionLoadPrompt::ShowPrompt() { |
[email protected] | af6efb2 | 2012-10-12 02:23:05 | [diff] [blame] | 69 | install_ui_->ConfirmInstall( |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 70 | this, |
[email protected] | dc24976f | 2013-06-02 21:15:09 | [diff] [blame] | 71 | extension_.get(), |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 72 | ExtensionInstallPrompt::GetDefaultShowDialogCallback()); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | void SimpleExtensionLoadPrompt::InstallUIProceed() { |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 76 | callback_.Run(); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 77 | delete this; |
| 78 | } |
| 79 | |
| 80 | void SimpleExtensionLoadPrompt::InstallUIAbort(bool user_initiated) { |
| 81 | delete this; |
| 82 | } |
| 83 | |
| 84 | } // namespace |
| 85 | |
| 86 | namespace extensions { |
| 87 | |
| 88 | // static |
| 89 | scoped_refptr<UnpackedInstaller> UnpackedInstaller::Create( |
| 90 | ExtensionService* extension_service) { |
| 91 | return scoped_refptr<UnpackedInstaller>( |
| 92 | new UnpackedInstaller(extension_service)); |
| 93 | } |
| 94 | |
| 95 | UnpackedInstaller::UnpackedInstaller(ExtensionService* extension_service) |
| 96 | : service_weak_(extension_service->AsWeakPtr()), |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 97 | prompt_for_plugins_(true), |
[email protected] | 9d02fa1 | 2013-02-19 05:12:57 | [diff] [blame] | 98 | require_modern_manifest_version_(true), |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 99 | installer_(extension_service->profile()) { |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 100 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 101 | } |
| 102 | |
| 103 | UnpackedInstaller::~UnpackedInstaller() { |
| 104 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI) || |
| 105 | BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 106 | } |
| 107 | |
[email protected] | 650b2d5 | 2013-02-10 03:41:45 | [diff] [blame] | 108 | void UnpackedInstaller::Load(const base::FilePath& path_in) { |
[email protected] | 9827043 | 2012-09-11 20:51:24 | [diff] [blame] | 109 | DCHECK(extension_path_.empty()); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 110 | extension_path_ = path_in; |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 111 | BrowserThread::PostTask( |
| 112 | BrowserThread::FILE, |
| 113 | FROM_HERE, |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 114 | base::Bind(&UnpackedInstaller::GetAbsolutePath, this)); |
| 115 | } |
| 116 | |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 117 | bool UnpackedInstaller::LoadFromCommandLine(const base::FilePath& path_in, |
| 118 | std::string* extension_id) { |
[email protected] | 9827043 | 2012-09-11 20:51:24 | [diff] [blame] | 119 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 120 | DCHECK(extension_path_.empty()); |
| 121 | |
[email protected] | e8dad9b | 2013-06-04 04:43:45 | [diff] [blame] | 122 | if (!service_weak_.get()) |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 123 | return false; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 124 | // Load extensions from the command line synchronously to avoid a race |
| 125 | // between extension loading and loading an URL from the command line. |
| 126 | base::ThreadRestrictions::ScopedAllowIO allow_io; |
| 127 | |
[email protected] | 1547693 | 2013-04-12 05:17:15 | [diff] [blame] | 128 | extension_path_ = base::MakeAbsoluteFilePath(path_in); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 129 | |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 130 | if (!IsLoadingUnpackedAllowed()) { |
| 131 | ReportExtensionLoadError(kUnpackedExtensionsBlacklistedError); |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 132 | return false; |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 133 | } |
| 134 | |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 135 | std::string error; |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 136 | installer_.set_extension(extension_file_util::LoadExtension( |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 137 | extension_path_, Manifest::COMMAND_LINE, GetFlags(), &error).get()); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 138 | |
[email protected] | 557c7bd | 2013-09-18 21:51:25 | [diff] [blame] | 139 | if (!installer_.extension().get() || |
| 140 | !extension_l10n_util::ValidateExtensionLocales( |
| 141 | extension_path_, |
| 142 | installer_.extension()->manifest()->value(), |
| 143 | &error)) { |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 144 | ReportExtensionLoadError(error); |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 145 | return false; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 146 | } |
| 147 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 148 | ShowInstallPrompt(); |
[email protected] | 2a69b94 | 2013-05-31 09:37:53 | [diff] [blame] | 149 | |
| 150 | *extension_id = installer_.extension()->id(); |
| 151 | return true; |
[email protected] | 9827043 | 2012-09-11 20:51:24 | [diff] [blame] | 152 | } |
| 153 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 154 | void UnpackedInstaller::ShowInstallPrompt() { |
[email protected] | 9827043 | 2012-09-11 20:51:24 | [diff] [blame] | 155 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
[email protected] | e8dad9b | 2013-06-04 04:43:45 | [diff] [blame] | 156 | if (!service_weak_.get()) |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 157 | return; |
| 158 | |
| 159 | const ExtensionSet* disabled_extensions = |
| 160 | service_weak_->disabled_extensions(); |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 161 | if (service_weak_->show_extensions_prompts() && prompt_for_plugins_ && |
| 162 | PluginInfo::HasPlugins(installer_.extension().get()) && |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 163 | !disabled_extensions->Contains(installer_.extension()->id())) { |
| 164 | SimpleExtensionLoadPrompt* prompt = new SimpleExtensionLoadPrompt( |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 165 | installer_.extension().get(), |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 166 | installer_.profile(), |
| 167 | base::Bind(&UnpackedInstaller::CallCheckRequirements, this)); |
| 168 | prompt->ShowPrompt(); |
| 169 | return; |
| 170 | } |
| 171 | CallCheckRequirements(); |
| 172 | } |
| 173 | |
| 174 | void UnpackedInstaller::CallCheckRequirements() { |
| 175 | installer_.CheckRequirements( |
[email protected] | 9827043 | 2012-09-11 20:51:24 | [diff] [blame] | 176 | base::Bind(&UnpackedInstaller::OnRequirementsChecked, this)); |
| 177 | } |
| 178 | |
| 179 | void UnpackedInstaller::OnRequirementsChecked( |
| 180 | std::vector<std::string> requirement_errors) { |
| 181 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 182 | |
| 183 | if (!requirement_errors.empty()) { |
| 184 | ReportExtensionLoadError(JoinString(requirement_errors, ' ')); |
| 185 | return; |
| 186 | } |
| 187 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 188 | ConfirmInstall(); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 189 | } |
| 190 | |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 191 | int UnpackedInstaller::GetFlags() { |
[email protected] | 993da5e | 2013-03-23 21:25:16 | [diff] [blame] | 192 | std::string id = id_util::GenerateIdForPath(extension_path_); |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 193 | bool allow_file_access = |
[email protected] | 12075d1 | 2013-02-27 05:38:05 | [diff] [blame] | 194 | Manifest::ShouldAlwaysAllowFileAccess(Manifest::UNPACKED); |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 195 | ExtensionPrefs* prefs = service_weak_->extension_prefs(); |
| 196 | if (prefs->HasAllowFileAccessSetting(id)) |
| 197 | allow_file_access = prefs->AllowFileAccess(id); |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 198 | |
| 199 | int result = Extension::FOLLOW_SYMLINKS_ANYWHERE; |
| 200 | if (allow_file_access) |
| 201 | result |= Extension::ALLOW_FILE_ACCESS; |
| 202 | if (require_modern_manifest_version_) |
| 203 | result |= Extension::REQUIRE_MODERN_MANIFEST_VERSION; |
| 204 | |
| 205 | return result; |
| 206 | } |
| 207 | |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 208 | bool UnpackedInstaller::IsLoadingUnpackedAllowed() const { |
[email protected] | e8dad9b | 2013-06-04 04:43:45 | [diff] [blame] | 209 | if (!service_weak_.get()) |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 210 | return true; |
| 211 | // If there is a "*" in the extension blacklist, then no extensions should be |
| 212 | // allowed at all (except explicitly whitelisted extensions). |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 213 | ExtensionPrefs* prefs = service_weak_->extension_prefs(); |
| 214 | return !prefs->ExtensionsBlacklistedByDefault(); |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 215 | } |
| 216 | |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 217 | void UnpackedInstaller::GetAbsolutePath() { |
| 218 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
| 219 | |
[email protected] | 1547693 | 2013-04-12 05:17:15 | [diff] [blame] | 220 | extension_path_ = base::MakeAbsoluteFilePath(extension_path_); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 221 | |
[email protected] | 5ccca8ad | 2013-08-19 22:35:34 | [diff] [blame] | 222 | std::string error; |
| 223 | if (!extension_file_util::CheckForIllegalFilenames(extension_path_, |
| 224 | &error)) { |
| 225 | BrowserThread::PostTask( |
| 226 | BrowserThread::UI, |
| 227 | FROM_HERE, |
| 228 | base::Bind(&UnpackedInstaller::ReportExtensionLoadError, this, error)); |
| 229 | return; |
| 230 | } |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 231 | BrowserThread::PostTask( |
| 232 | BrowserThread::UI, FROM_HERE, |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 233 | base::Bind(&UnpackedInstaller::CheckExtensionFileAccess, this)); |
| 234 | } |
| 235 | |
| 236 | void UnpackedInstaller::CheckExtensionFileAccess() { |
| 237 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
[email protected] | e8dad9b | 2013-06-04 04:43:45 | [diff] [blame] | 238 | if (!service_weak_.get()) |
[email protected] | 8e7b2cf4 | 2012-04-18 14:26:58 | [diff] [blame] | 239 | return; |
| 240 | |
| 241 | if (!IsLoadingUnpackedAllowed()) { |
| 242 | ReportExtensionLoadError(kUnpackedExtensionsBlacklistedError); |
| 243 | return; |
| 244 | } |
| 245 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 246 | BrowserThread::PostTask( |
| 247 | BrowserThread::FILE, |
| 248 | FROM_HERE, |
| 249 | base::Bind(&UnpackedInstaller::LoadWithFileAccess, this, GetFlags())); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 250 | } |
| 251 | |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 252 | void UnpackedInstaller::LoadWithFileAccess(int flags) { |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 253 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
[email protected] | b7462f3 | 2012-09-02 15:18:12 | [diff] [blame] | 254 | |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 255 | std::string error; |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 256 | installer_.set_extension(extension_file_util::LoadExtension( |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 257 | extension_path_, Manifest::UNPACKED, flags, &error).get()); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 258 | |
[email protected] | 557c7bd | 2013-09-18 21:51:25 | [diff] [blame] | 259 | if (!installer_.extension().get() || |
| 260 | !extension_l10n_util::ValidateExtensionLocales( |
| 261 | extension_path_, |
| 262 | installer_.extension()->manifest()->value(), |
| 263 | &error)) { |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 264 | BrowserThread::PostTask( |
| 265 | BrowserThread::UI, |
| 266 | FROM_HERE, |
| 267 | base::Bind(&UnpackedInstaller::ReportExtensionLoadError, this, error)); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 268 | return; |
| 269 | } |
| 270 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 271 | BrowserThread::PostTask( |
| 272 | BrowserThread::UI, |
| 273 | FROM_HERE, |
| 274 | base::Bind(&UnpackedInstaller::ShowInstallPrompt, this)); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 275 | } |
| 276 | |
| 277 | void UnpackedInstaller::ReportExtensionLoadError(const std::string &error) { |
| 278 | CHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
[email protected] | e8dad9b | 2013-06-04 04:43:45 | [diff] [blame] | 279 | if (!service_weak_.get()) |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 280 | return; |
| 281 | service_weak_->ReportExtensionLoadError(extension_path_, error, true); |
| 282 | } |
| 283 | |
[email protected] | 849749d | 2013-05-06 17:30:45 | [diff] [blame] | 284 | void UnpackedInstaller::ConfirmInstall() { |
| 285 | DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 286 | string16 error = installer_.CheckManagementPolicy(); |
| 287 | if (!error.empty()) { |
[email protected] | 99d2131 | 2013-05-14 15:51:13 | [diff] [blame] | 288 | ReportExtensionLoadError(UTF16ToUTF8(error)); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 289 | return; |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 290 | } |
[email protected] | 0d90431 | 2012-01-25 23:00:16 | [diff] [blame] | 291 | |
| 292 | PermissionsUpdater perms_updater(service_weak_->profile()); |
[email protected] | cadac62 | 2013-06-11 16:46:36 | [diff] [blame] | 293 | perms_updater.GrantActivePermissions(installer_.extension().get()); |
[email protected] | 9d02fa1 | 2013-02-19 05:12:57 | [diff] [blame] | 294 | |
[email protected] | 9f3c853 | 2013-07-31 19:52:07 | [diff] [blame] | 295 | service_weak_->OnExtensionInstalled( |
| 296 | installer_.extension().get(), |
| 297 | syncer::StringOrdinal(), |
| 298 | false /* no requirement errors */, |
| 299 | Blacklist::NOT_BLACKLISTED, |
| 300 | false /* don't wait for idle */); |
[email protected] | d8c8f25f | 2011-11-02 18:18:01 | [diff] [blame] | 301 | } |
| 302 | |
| 303 | } // namespace extensions |