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

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

Issue 2149953002: Enable login screen apps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Additional IsBackgroundPageAllowed check Created 3 years, 9 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
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 <stddef.h> 7 #include <stddef.h>
8 #include <memory> 8 #include <memory>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 24 matching lines...) Expand all
35 #include "extensions/common/extension.h" 35 #include "extensions/common/extension.h"
36 #include "extensions/common/extension_l10n_util.h" 36 #include "extensions/common/extension_l10n_util.h"
37 #include "extensions/common/extension_set.h" 37 #include "extensions/common/extension_set.h"
38 #include "extensions/common/extension_urls.h" 38 #include "extensions/common/extension_urls.h"
39 #include "extensions/common/file_util.h" 39 #include "extensions/common/file_util.h"
40 #include "extensions/common/manifest.h" 40 #include "extensions/common/manifest.h"
41 #include "extensions/common/manifest_constants.h" 41 #include "extensions/common/manifest_constants.h"
42 #include "extensions/common/manifest_handlers/background_info.h" 42 #include "extensions/common/manifest_handlers/background_info.h"
43 #include "extensions/common/manifest_url_handlers.h" 43 #include "extensions/common/manifest_url_handlers.h"
44 44
45 #if defined(OS_CHROMEOS)
46 #include "chrome/browser/chromeos/profiles/profile_helper.h"
47 #endif
48
45 using base::UserMetricsAction; 49 using base::UserMetricsAction;
46 using content::BrowserThread; 50 using content::BrowserThread;
47 51
48 namespace extensions { 52 namespace extensions {
49 53
50 namespace errors = manifest_errors; 54 namespace errors = manifest_errors;
51 55
52 namespace { 56 namespace {
53 57
54 // The following enumeration is used in histograms matching 58 // The following enumeration is used in histograms matching
(...skipping 245 matching lines...) Expand 10 before | Expand all | Expand 10 after
300 } 304 }
301 305
302 extensions_info->at(i)->extension_manifest.reset( 306 extensions_info->at(i)->extension_manifest.reset(
303 static_cast<base::DictionaryValue*>( 307 static_cast<base::DictionaryValue*>(
304 extension->manifest()->value()->DeepCopy())); 308 extension->manifest()->value()->DeepCopy()));
305 should_write_prefs = true; 309 should_write_prefs = true;
306 } 310 }
307 } 311 }
308 312
309 for (size_t i = 0; i < extensions_info->size(); ++i) { 313 for (size_t i = 0; i < extensions_info->size(); ++i) {
314 #if defined(OS_CHROMEOS)
315 // Don't load saved extensions in signin profile.
Devlin 2017/03/08 17:24:32 This seems like the wrong place to put this... we
achuithb 2017/03/09 14:31:06 I've tried to keep as much of the old behavior as
Devlin 2017/03/13 19:39:35 LoadAllExtensions() basically iterates over the pr
achuithb 2017/03/15 00:40:25 There's state in the signin profile - for example
316 if (chromeos::ProfileHelper::IsSigninProfile(profile))
317 break;
318 #endif
310 if (extensions_info->at(i)->extension_location != Manifest::COMMAND_LINE) 319 if (extensions_info->at(i)->extension_location != Manifest::COMMAND_LINE)
311 Load(*extensions_info->at(i), should_write_prefs); 320 Load(*extensions_info->at(i), should_write_prefs);
312 } 321 }
313 322
314 extension_service_->OnLoadedInstalledExtensions(); 323 extension_service_->OnLoadedInstalledExtensions();
315 324
316 // The histograms Extensions.ManifestReload* allow us to validate 325 // The histograms Extensions.ManifestReload* allow us to validate
317 // the assumption that reloading manifest is a rare event. 326 // the assumption that reloading manifest is a rare event.
318 UMA_HISTOGRAM_COUNTS_100("Extensions.ManifestReloadNotNeeded", 327 UMA_HISTOGRAM_COUNTS_100("Extensions.ManifestReloadNotNeeded",
319 reload_reason_counts[NOT_NEEDED]); 328 reload_reason_counts[NOT_NEEDED]);
(...skipping 306 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { 635 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
627 int flags = extension_prefs_->GetCreationFlags(info->extension_id); 636 int flags = extension_prefs_->GetCreationFlags(info->extension_id);
628 if (!Manifest::IsUnpackedLocation(info->extension_location)) 637 if (!Manifest::IsUnpackedLocation(info->extension_location))
629 flags |= Extension::REQUIRE_KEY; 638 flags |= Extension::REQUIRE_KEY;
630 if (extension_prefs_->AllowFileAccess(info->extension_id)) 639 if (extension_prefs_->AllowFileAccess(info->extension_id))
631 flags |= Extension::ALLOW_FILE_ACCESS; 640 flags |= Extension::ALLOW_FILE_ACCESS;
632 return flags; 641 return flags;
633 } 642 }
634 643
635 } // namespace extensions 644 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698