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

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: rebase Created 5 years, 7 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 480 matching lines...) Expand 10 before | Expand all | Expand 10 after
491 } 491 }
492 492
493 if (extension_action_manager->GetPageAction(*extension)) 493 if (extension_action_manager->GetPageAction(*extension))
494 ++page_action_count; 494 ++page_action_count;
495 495
496 if (extension_action_manager->GetBrowserAction(*extension)) 496 if (extension_action_manager->GetBrowserAction(*extension))
497 ++browser_action_count; 497 ++browser_action_count;
498 498
499 RecordCreationFlags(extension); 499 RecordCreationFlags(extension);
500 500
501 ExtensionService::RecordPermissionMessagesHistogram( 501 ExtensionService::RecordPermissionMessagesHistogram(extension, "Load");
502 extension, "Extensions.Permissions_Load2");
503 502
504 // For incognito and file access, skip anything that doesn't appear in 503 // For incognito and file access, skip anything that doesn't appear in
505 // settings. Also, policy-installed (and unpacked of course, checked above) 504 // settings. Also, policy-installed (and unpacked of course, checked above)
506 // extensions are boring. 505 // extensions are boring.
507 if (extension->ShouldDisplayInExtensionSettings() && 506 if (extension->ShouldDisplayInExtensionSettings() &&
508 !Manifest::IsPolicyLocation(extension->location())) { 507 !Manifest::IsPolicyLocation(extension->location())) {
509 if (extension->can_be_incognito_enabled()) { 508 if (extension->can_be_incognito_enabled()) {
510 if (util::IsIncognitoEnabled(extension->id(), profile)) 509 if (util::IsIncognitoEnabled(extension->id(), profile))
511 ++incognito_allowed_count; 510 ++incognito_allowed_count;
512 else 511 else
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
610 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { 609 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) {
611 int flags = extension_prefs_->GetCreationFlags(info->extension_id); 610 int flags = extension_prefs_->GetCreationFlags(info->extension_id);
612 if (!Manifest::IsUnpackedLocation(info->extension_location)) 611 if (!Manifest::IsUnpackedLocation(info->extension_location))
613 flags |= Extension::REQUIRE_KEY; 612 flags |= Extension::REQUIRE_KEY;
614 if (extension_prefs_->AllowFileAccess(info->extension_id)) 613 if (extension_prefs_->AllowFileAccess(info->extension_id))
615 flags |= Extension::ALLOW_FILE_ACCESS; 614 flags |= Extension::ALLOW_FILE_ACCESS;
616 return flags; 615 return flags;
617 } 616 }
618 617
619 } // namespace extensions 618 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698