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