| 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/api/module/module.h" | 5 #include "chrome/browser/extensions/api/module/module.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "chrome/browser/extensions/extension_prefs.h" | 9 #include "chrome/browser/extensions/extension_prefs.h" |
| 10 #include "chrome/browser/extensions/extension_service.h" | 10 #include "chrome/browser/extensions/extension_service.h" |
| 11 #include "chrome/browser/profiles/profile.h" | 11 #include "chrome/browser/profiles/profile.h" |
| 12 | 12 |
| 13 namespace extensions { | 13 namespace extensions { |
| 14 | 14 |
| 15 ExtensionPrefs* SetUpdateUrlDataFunction::extension_prefs() { | 15 ExtensionPrefs* ExtensionSetUpdateUrlDataFunction::extension_prefs() { |
| 16 return profile()->GetExtensionService()->extension_prefs(); | 16 return profile()->GetExtensionService()->extension_prefs(); |
| 17 } | 17 } |
| 18 | 18 |
| 19 bool SetUpdateUrlDataFunction::RunImpl() { | 19 bool ExtensionSetUpdateUrlDataFunction::RunImpl() { |
| 20 std::string data; | 20 std::string data; |
| 21 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &data)); | 21 EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &data)); |
| 22 | 22 |
| 23 extension_prefs()->SetUpdateUrlData(extension_id(), data); | 23 extension_prefs()->SetUpdateUrlData(extension_id(), data); |
| 24 return true; | 24 return true; |
| 25 } | 25 } |
| 26 | 26 |
| 27 bool IsAllowedIncognitoAccessFunction::RunImpl() { | 27 bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() { |
| 28 ExtensionService* ext_service = profile()->GetExtensionService(); | 28 ExtensionService* ext_service = profile()->GetExtensionService(); |
| 29 const Extension* extension = GetExtension(); | 29 const Extension* extension = GetExtension(); |
| 30 | 30 |
| 31 SetResult(Value::CreateBooleanValue( | 31 SetResult(Value::CreateBooleanValue( |
| 32 ext_service->IsIncognitoEnabled(extension->id()))); | 32 ext_service->IsIncognitoEnabled(extension->id()))); |
| 33 return true; | 33 return true; |
| 34 } | 34 } |
| 35 | 35 |
| 36 bool IsAllowedFileSchemeAccessFunction::RunImpl() { | 36 bool ExtensionIsAllowedFileSchemeAccessFunction::RunImpl() { |
| 37 ExtensionService* ext_service = profile()->GetExtensionService(); | 37 ExtensionService* ext_service = profile()->GetExtensionService(); |
| 38 const Extension* extension = GetExtension(); | 38 const Extension* extension = GetExtension(); |
| 39 | 39 |
| 40 SetResult(Value::CreateBooleanValue( | 40 SetResult(Value::CreateBooleanValue( |
| 41 ext_service->AllowFileAccess(extension))); | 41 ext_service->AllowFileAccess(extension))); |
| 42 return true; | 42 return true; |
| 43 } | 43 } |
| 44 | 44 |
| 45 } // namespace extensions | 45 } // namespace extensions |
| OLD | NEW |