OLD | NEW |
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 Loading... |
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(FROM_HERE, |
177 base::Bind(&DispatchOnInstalledEvent, extension_service_->profile(), | 177 base::Bind(&DispatchOnInstalledEvent, extension_service_->profile(), |
178 info->extension_id, old_version, false)); | 178 info->extension_id, old_version, false)); |
179 | 179 |
180 info = extension_prefs_->GetInstalledExtensionInfo( | 180 info = extension_prefs_->GetInstalledExtensionInfo( |
181 info->extension_id).release(); | 181 info->extension_id).release(); |
182 extensions_info->at(i).reset(info); | 182 extensions_info->at(i).reset(info); |
183 | 183 |
184 update_count++; | 184 update_count++; |
185 } | 185 } |
186 | 186 |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
380 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 380 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
381 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 381 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
382 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 382 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
383 flags |= Extension::REQUIRE_KEY; | 383 flags |= Extension::REQUIRE_KEY; |
384 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 384 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
385 flags |= Extension::ALLOW_FILE_ACCESS; | 385 flags |= Extension::ALLOW_FILE_ACCESS; |
386 return flags; | 386 return flags; |
387 } | 387 } |
388 | 388 |
389 } // namespace extensions | 389 } // namespace extensions |
OLD | NEW |