| 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 "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/extensions/extension_prefs.h" | 10 #include "chrome/browser/extensions/extension_prefs.h" |
| 11 #include "chrome/browser/extensions/extension_service.h" | 11 #include "chrome/browser/extensions/extension_service.h" |
| 12 #include "chrome/browser/extensions/extension_system.h" | 12 #include "chrome/browser/extensions/extension_system.h" |
| 13 #include "chrome/browser/extensions/extension_util.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 14 #include "chrome/browser/profiles/profile.h" |
| 14 | 15 |
| 15 namespace extensions { | 16 namespace extensions { |
| 16 | 17 |
| 17 namespace extension { | 18 namespace extension { |
| 18 | 19 |
| 19 namespace { | 20 namespace { |
| 20 | 21 |
| 21 // A preference for storing the extension's update URL data. If not empty, the | 22 // A preference for storing the extension's update URL data. If not empty, the |
| 22 // the ExtensionUpdater will append a ap= parameter to the URL when checking if | 23 // the ExtensionUpdater will append a ap= parameter to the URL when checking if |
| (...skipping 21 matching lines...) Expand all Loading... |
| 44 new base::StringValue(data)); | 45 new base::StringValue(data)); |
| 45 return true; | 46 return true; |
| 46 } | 47 } |
| 47 | 48 |
| 48 bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() { | 49 bool ExtensionIsAllowedIncognitoAccessFunction::RunImpl() { |
| 49 ExtensionService* ext_service = | 50 ExtensionService* ext_service = |
| 50 ExtensionSystem::Get(profile())->extension_service(); | 51 ExtensionSystem::Get(profile())->extension_service(); |
| 51 const Extension* extension = GetExtension(); | 52 const Extension* extension = GetExtension(); |
| 52 | 53 |
| 53 SetResult(new base::FundamentalValue( | 54 SetResult(new base::FundamentalValue( |
| 54 ext_service->IsIncognitoEnabled(extension->id()))); | 55 extension_util::IsIncognitoEnabled(extension->id(), ext_service))); |
| 55 return true; | 56 return true; |
| 56 } | 57 } |
| 57 | 58 |
| 58 bool ExtensionIsAllowedFileSchemeAccessFunction::RunImpl() { | 59 bool ExtensionIsAllowedFileSchemeAccessFunction::RunImpl() { |
| 59 ExtensionService* ext_service = | 60 ExtensionService* ext_service = |
| 60 ExtensionSystem::Get(profile())->extension_service(); | 61 ExtensionSystem::Get(profile())->extension_service(); |
| 61 const Extension* extension = GetExtension(); | 62 const Extension* extension = GetExtension(); |
| 62 | 63 |
| 63 SetResult(new base::FundamentalValue( | 64 SetResult(new base::FundamentalValue( |
| 64 ext_service->AllowFileAccess(extension))); | 65 extension_util::AllowFileAccess(extension, ext_service))); |
| 65 return true; | 66 return true; |
| 66 } | 67 } |
| 67 | 68 |
| 68 } // namespace extensions | 69 } // namespace extensions |
| OLD | NEW |