| 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/navigation_observer.h" | 5 #include "chrome/browser/extensions/navigation_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/extension_install_ui.h" | 7 #include "chrome/browser/extensions/extension_install_ui.h" |
| 8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
| 9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
| 10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 52 if (!in_progress_prompt_extension_id_.empty()) | 52 if (!in_progress_prompt_extension_id_.empty()) |
| 53 return; | 53 return; |
| 54 | 54 |
| 55 NavigationEntry* nav_entry = nav_controller->GetActiveEntry(); | 55 NavigationEntry* nav_entry = nav_controller->GetActiveEntry(); |
| 56 if (!nav_entry) | 56 if (!nav_entry) |
| 57 return; | 57 return; |
| 58 | 58 |
| 59 ExtensionService* extension_service = | 59 ExtensionService* extension_service = |
| 60 extensions::ExtensionSystem::Get(profile_)->extension_service(); | 60 extensions::ExtensionSystem::Get(profile_)->extension_service(); |
| 61 const Extension* extension = extension_service->disabled_extensions()-> | 61 const Extension* extension = extension_service->disabled_extensions()-> |
| 62 GetExtensionOrAppByURL(ExtensionURLInfo(nav_entry->GetURL())); | 62 GetExtensionOrAppByURL(nav_entry->GetURL()); |
| 63 if (!extension) | 63 if (!extension) |
| 64 return; | 64 return; |
| 65 | 65 |
| 66 // Try not to repeatedly prompt the user about the same extension. | 66 // Try not to repeatedly prompt the user about the same extension. |
| 67 if (prompted_extensions_.find(extension->id()) != prompted_extensions_.end()) | 67 if (prompted_extensions_.find(extension->id()) != prompted_extensions_.end()) |
| 68 return; | 68 return; |
| 69 prompted_extensions_.insert(extension->id()); | 69 prompted_extensions_.insert(extension->id()); |
| 70 | 70 |
| 71 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); | 71 ExtensionPrefs* extension_prefs = extension_service->extension_prefs(); |
| 72 if (extension_prefs->DidExtensionEscalatePermissions(extension->id())) { | 72 if (extension_prefs->DidExtensionEscalatePermissions(extension->id())) { |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 extension_install_prompt_.reset(); | 111 extension_install_prompt_.reset(); |
| 112 | 112 |
| 113 std::string histogram_name = user_initiated ? | 113 std::string histogram_name = user_initiated ? |
| 114 "Extensions.Permissions_ReEnableCancel" : | 114 "Extensions.Permissions_ReEnableCancel" : |
| 115 "Extensions.Permissions_ReEnableAbort"; | 115 "Extensions.Permissions_ReEnableAbort"; |
| 116 ExtensionService::RecordPermissionMessagesHistogram( | 116 ExtensionService::RecordPermissionMessagesHistogram( |
| 117 extension, histogram_name.c_str()); | 117 extension, histogram_name.c_str()); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace extensions | 120 } // namespace extensions |
| OLD | NEW |