| 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/permissions_updater.h" | 5 #include "chrome/browser/extensions/permissions_updater.h" |
| 6 | 6 |
| 7 #include "base/json/json_writer.h" | 7 #include "base/json/json_writer.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h" | 10 #include "chrome/browser/extensions/api/permissions/permissions_api_helpers.h" |
| 11 #include "chrome/browser/extensions/event_router.h" | 11 #include "chrome/browser/extensions/event_router.h" |
| 12 #include "chrome/browser/extensions/extension_prefs.h" | 12 #include "chrome/browser/extensions/extension_prefs.h" |
| 13 #include "chrome/browser/extensions/extension_service.h" | 13 #include "chrome/browser/extensions/extension_service.h" |
| 14 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 15 #include "chrome/browser/signin/token_service.h" | 15 #include "chrome/browser/signin/token_service.h" |
| 16 #include "chrome/browser/signin/token_service_factory.h" | 16 #include "chrome/browser/signin/token_service_factory.h" |
| 17 #include "chrome/common/chrome_notification_types.h" |
| 17 #include "chrome/common/extensions/api/permissions.h" | 18 #include "chrome/common/extensions/api/permissions.h" |
| 18 #include "chrome/common/chrome_notification_types.h" | |
| 19 #include "chrome/common/extensions/extension.h" | 19 #include "chrome/common/extensions/extension.h" |
| 20 #include "chrome/common/extensions/extension_messages.h" | 20 #include "chrome/common/extensions/extension_messages.h" |
| 21 #include "chrome/common/net/gaia/oauth2_mint_token_flow.h" | |
| 22 #include "content/public/browser/notification_service.h" | 21 #include "content/public/browser/notification_service.h" |
| 23 #include "content/public/browser/render_process_host.h" | 22 #include "content/public/browser/render_process_host.h" |
| 23 #include "google_apis/gaia/oauth2_mint_token_flow.h" |
| 24 | 24 |
| 25 using content::RenderProcessHost; | 25 using content::RenderProcessHost; |
| 26 using extensions::permissions_api_helpers::PackPermissionSet; | 26 using extensions::permissions_api_helpers::PackPermissionSet; |
| 27 using extensions::PermissionSet; | 27 using extensions::PermissionSet; |
| 28 | 28 |
| 29 namespace extensions { | 29 namespace extensions { |
| 30 | 30 |
| 31 namespace { | 31 namespace { |
| 32 | 32 |
| 33 const char kOnAdded[] = "permissions.onAdded"; | 33 const char kOnAdded[] = "permissions.onAdded"; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 168 | 168 |
| 169 // Trigger the onAdded and onRemoved events in the extension. | 169 // Trigger the onAdded and onRemoved events in the extension. |
| 170 DispatchEvent(extension->id(), event_name, changed); | 170 DispatchEvent(extension->id(), event_name, changed); |
| 171 } | 171 } |
| 172 | 172 |
| 173 ExtensionPrefs* PermissionsUpdater::GetExtensionPrefs() { | 173 ExtensionPrefs* PermissionsUpdater::GetExtensionPrefs() { |
| 174 return profile_->GetExtensionService()->extension_prefs(); | 174 return profile_->GetExtensionService()->extension_prefs(); |
| 175 } | 175 } |
| 176 | 176 |
| 177 } // namespace extensions | 177 } // namespace extensions |
| OLD | NEW |