| 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" |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 OAuth2Info::GetOAuth2Info(extension).scopes, | 55 OAuth2Info::GetOAuth2Info(extension).scopes, |
| 56 OAuth2MintTokenFlow::MODE_RECORD_GRANT))) { | 56 OAuth2MintTokenFlow::MODE_RECORD_GRANT))) { |
| 57 notification_registrar_.Add(this, | 57 notification_registrar_.Add(this, |
| 58 chrome::NOTIFICATION_PROFILE_DESTROYED, | 58 chrome::NOTIFICATION_PROFILE_DESTROYED, |
| 59 content::Source<Profile>(profile)); | 59 content::Source<Profile>(profile)); |
| 60 | 60 |
| 61 flow_.Start(); | 61 flow_.Start(); |
| 62 } | 62 } |
| 63 | 63 |
| 64 // content::NotificationObserver: | 64 // content::NotificationObserver: |
| 65 void Observe(int type, | 65 virtual void Observe(int type, |
| 66 const content::NotificationSource& source, | 66 const content::NotificationSource& source, |
| 67 const content::NotificationDetails& details) OVERRIDE { | 67 const content::NotificationDetails& details) OVERRIDE { |
| 68 DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_DESTROYED); | 68 DCHECK_EQ(type, chrome::NOTIFICATION_PROFILE_DESTROYED); |
| 69 delete this; | 69 delete this; |
| 70 } | 70 } |
| 71 | 71 |
| 72 // OAuth2MintTokenFlow::Delegate: | 72 // OAuth2MintTokenFlow::Delegate: |
| 73 virtual void OnMintTokenSuccess(const std::string& access_token) OVERRIDE { | 73 virtual void OnMintTokenSuccess(const std::string& access_token) OVERRIDE { |
| 74 delete this; | 74 delete this; |
| 75 } | 75 } |
| (...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 | 225 |
| 226 // Trigger the onAdded and onRemoved events in the extension. | 226 // Trigger the onAdded and onRemoved events in the extension. |
| 227 DispatchEvent(extension->id(), event_name, changed); | 227 DispatchEvent(extension->id(), event_name, changed); |
| 228 } | 228 } |
| 229 | 229 |
| 230 ExtensionPrefs* PermissionsUpdater::GetExtensionPrefs() { | 230 ExtensionPrefs* PermissionsUpdater::GetExtensionPrefs() { |
| 231 return ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); | 231 return ExtensionSystem::Get(profile_)->extension_service()->extension_prefs(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace extensions | 234 } // namespace extensions |
| OLD | NEW |