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

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

Issue 14113053: chrome: Use base::MessageLoop. (Part 3) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 8 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) 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/browser/extensions/installed_loader.h" 5 #include "chrome/browser/extensions/installed_loader.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/threading/thread_restrictions.h" 10 #include "base/threading/thread_restrictions.h"
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after
166 NOTREACHED(); 166 NOTREACHED();
167 167
168 Version old_version; 168 Version old_version;
169 if (info->extension_manifest) { 169 if (info->extension_manifest) {
170 std::string version_str; 170 std::string version_str;
171 if (info->extension_manifest->GetString( 171 if (info->extension_manifest->GetString(
172 extension_manifest_keys::kVersion, &version_str)) { 172 extension_manifest_keys::kVersion, &version_str)) {
173 old_version = Version(version_str); 173 old_version = Version(version_str);
174 } 174 }
175 } 175 }
176 MessageLoop::current()->PostTask(FROM_HERE, 176 base::MessageLoop::current()->PostTask(
177 base::Bind(&DispatchOnInstalledEvent, extension_service_->profile(), 177 FROM_HERE,
178 info->extension_id, old_version, false)); 178 base::Bind(&DispatchOnInstalledEvent,
179 extension_service_->profile(),
180 info->extension_id,
181 old_version,
182 false));
179 183
180 info = extension_prefs_->GetInstalledExtensionInfo( 184 info = extension_prefs_->GetInstalledExtensionInfo(
181 info->extension_id).release(); 185 info->extension_id).release();
182 extensions_info->at(i).reset(info); 186 extensions_info->at(i).reset(info);
183 187
184 update_count++; 188 update_count++;
185 } 189 }
186 190
187 ManifestReloadReason reload_reason = ShouldReloadExtensionManifest(*info); 191 ManifestReloadReason reload_reason = ShouldReloadExtensionManifest(*info);
188 ++reload_reason_counts[reload_reason]; 192 ++reload_reason_counts[reload_reason];
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after
380 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { 384 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
381 int flags = extension_prefs_->GetCreationFlags(info->extension_id); 385 int flags = extension_prefs_->GetCreationFlags(info->extension_id);
382 if (!Manifest::IsUnpackedLocation(info->extension_location)) 386 if (!Manifest::IsUnpackedLocation(info->extension_location))
383 flags |= Extension::REQUIRE_KEY; 387 flags |= Extension::REQUIRE_KEY;
384 if (extension_prefs_->AllowFileAccess(info->extension_id)) 388 if (extension_prefs_->AllowFileAccess(info->extension_id))
385 flags |= Extension::ALLOW_FILE_ACCESS; 389 flags |= Extension::ALLOW_FILE_ACCESS;
386 return flags; 390 return flags;
387 } 391 }
388 392
389 } // namespace extensions 393 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698