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 <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 428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
439 // want to mess up the existing stats. | 439 // want to mess up the existing stats. |
440 if (type == Manifest::TYPE_EXTENSION) { | 440 if (type == Manifest::TYPE_EXTENSION) { |
441 UMA_HISTOGRAM_ENUMERATION("Extensions.BackgroundPageType", | 441 UMA_HISTOGRAM_ENUMERATION("Extensions.BackgroundPageType", |
442 GetBackgroundPageType(extension), | 442 GetBackgroundPageType(extension), |
443 NUM_BACKGROUND_PAGE_TYPES); | 443 NUM_BACKGROUND_PAGE_TYPES); |
444 | 444 |
445 if (GetBackgroundPageType(extension) == EVENT_PAGE) { | 445 if (GetBackgroundPageType(extension) == EVENT_PAGE) { |
446 // Count extension event pages with no registered events. Either the | 446 // Count extension event pages with no registered events. Either the |
447 // event page is badly designed, or there may be a bug where the event | 447 // event page is badly designed, or there may be a bug where the event |
448 // page failed to start after an update (crbug.com/469361). | 448 // page failed to start after an update (crbug.com/469361). |
449 if (EventRouter::Get(extension_service_->profile())-> | 449 if (!EventRouter::Get(extension_service_->profile()) |
450 GetRegisteredEvents(extension->id()).size() == 0) { | 450 ->HasRegisteredEvents(extension->id())) { |
451 ++eventless_event_pages_count; | 451 ++eventless_event_pages_count; |
452 VLOG(1) << "Event page without registered event listeners: " | 452 VLOG(1) << "Event page without registered event listeners: " |
453 << extension->id() << " " << extension->name(); | 453 << extension->id() << " " << extension->name(); |
454 } | 454 } |
455 } | 455 } |
456 } | 456 } |
457 | 457 |
458 // Using an enumeration shows us the total installed ratio across all users. | 458 // Using an enumeration shows us the total installed ratio across all users. |
459 // Using the totals per user at each startup tells us the distribution of | 459 // Using the totals per user at each startup tells us the distribution of |
460 // usage for each user (e.g. 40% of users have at least one app installed). | 460 // usage for each user (e.g. 40% of users have at least one app installed). |
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
634 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { | 634 int InstalledLoader::GetCreationFlags(const ExtensionInfo* info) { |
635 int flags = extension_prefs_->GetCreationFlags(info->extension_id); | 635 int flags = extension_prefs_->GetCreationFlags(info->extension_id); |
636 if (!Manifest::IsUnpackedLocation(info->extension_location)) | 636 if (!Manifest::IsUnpackedLocation(info->extension_location)) |
637 flags |= Extension::REQUIRE_KEY; | 637 flags |= Extension::REQUIRE_KEY; |
638 if (extension_prefs_->AllowFileAccess(info->extension_id)) | 638 if (extension_prefs_->AllowFileAccess(info->extension_id)) |
639 flags |= Extension::ALLOW_FILE_ACCESS; | 639 flags |= Extension::ALLOW_FILE_ACCESS; |
640 return flags; | 640 return flags; |
641 } | 641 } |
642 | 642 |
643 } // namespace extensions | 643 } // namespace extensions |
OLD | NEW |