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

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

Issue 1094873002: Extensions: Switch to new permission message system, part V (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 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
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_macros.h" 8 #include "base/metrics/histogram_macros.h"
9 #include "base/metrics/sparse_histogram.h" 9 #include "base/metrics/sparse_histogram.h"
10 #include "base/strings/stringprintf.h" 10 #include "base/strings/stringprintf.h"
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after
496 ++page_action_count; 496 ++page_action_count;
497 497
498 if (extension_action_manager->GetBrowserAction(*extension)) 498 if (extension_action_manager->GetBrowserAction(*extension))
499 ++browser_action_count; 499 ++browser_action_count;
500 500
501 if (SupervisedUserInfo::IsContentPack(extension)) 501 if (SupervisedUserInfo::IsContentPack(extension))
502 ++content_pack_count; 502 ++content_pack_count;
503 503
504 RecordCreationFlags(extension); 504 RecordCreationFlags(extension);
505 505
506 ExtensionService::RecordPermissionMessagesHistogram( 506 ExtensionService::RecordPermissionMessagesHistogram(extension, "Load");
507 extension, "Extensions.Permissions_Load2");
508 507
509 // For incognito and file access, skip anything that doesn't appear in 508 // For incognito and file access, skip anything that doesn't appear in
510 // settings. Also, policy-installed (and unpacked of course, checked above) 509 // settings. Also, policy-installed (and unpacked of course, checked above)
511 // extensions are boring. 510 // extensions are boring.
512 if (extension->ShouldDisplayInExtensionSettings() && 511 if (extension->ShouldDisplayInExtensionSettings() &&
513 !Manifest::IsPolicyLocation(extension->location())) { 512 !Manifest::IsPolicyLocation(extension->location())) {
514 if (extension->can_be_incognito_enabled()) { 513 if (extension->can_be_incognito_enabled()) {
515 if (util::IsIncognitoEnabled(extension->id(), profile)) 514 if (util::IsIncognitoEnabled(extension->id(), profile))
516 ++incognito_allowed_count; 515 ++incognito_allowed_count;
517 else 516 else
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
616 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { 615 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
617 int flags = extension_prefs_->GetCreationFlags(info->extension_id); 616 int flags = extension_prefs_->GetCreationFlags(info->extension_id);
618 if (!Manifest::IsUnpackedLocation(info->extension_location)) 617 if (!Manifest::IsUnpackedLocation(info->extension_location))
619 flags |= Extension::REQUIRE_KEY; 618 flags |= Extension::REQUIRE_KEY;
620 if (extension_prefs_->AllowFileAccess(info->extension_id)) 619 if (extension_prefs_->AllowFileAccess(info->extension_id))
621 flags |= Extension::ALLOW_FILE_ACCESS; 620 flags |= Extension::ALLOW_FILE_ACCESS;
622 return flags; 621 return flags;
623 } 622 }
624 623
625 } // namespace extensions 624 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698