| 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/sync/test/integration/extensions_helper.h" | 5 #include "chrome/browser/sync/test/integration/extensions_helper.h" |
| 6 | 6 |
| 7 #include <cstring> | 7 #include <cstring> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( | 105 return SyncExtensionHelper::GetInstance()->IncognitoDisableExtension( |
| 106 profile, CreateFakeExtensionName(index)); | 106 profile, CreateFakeExtensionName(index)); |
| 107 } | 107 } |
| 108 | 108 |
| 109 bool IsIncognitoEnabled(Profile* profile, int index) { | 109 bool IsIncognitoEnabled(Profile* profile, int index) { |
| 110 return SyncExtensionHelper::GetInstance()->IsIncognitoEnabled( | 110 return SyncExtensionHelper::GetInstance()->IsIncognitoEnabled( |
| 111 profile, CreateFakeExtensionName(index)); | 111 profile, CreateFakeExtensionName(index)); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void InstallExtensionsPendingForSync(Profile* profile) { | 114 void InstallExtensionsPendingForSync(Profile* profile) { |
| 115 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync( | 115 SyncExtensionHelper::GetInstance()->InstallExtensionsPendingForSync(profile); |
| 116 profile, extensions::Extension::TYPE_EXTENSION); | |
| 117 } | 116 } |
| 118 | 117 |
| 119 std::string CreateFakeExtensionName(int index) { | 118 std::string CreateFakeExtensionName(int index) { |
| 120 return extension_name_prefix + base::IntToString(index); | 119 return extension_name_prefix + base::IntToString(index); |
| 121 } | 120 } |
| 122 | 121 |
| 123 bool ExtensionNameToIndex(const std::string& name, int* index) { | 122 bool ExtensionNameToIndex(const std::string& name, int* index) { |
| 124 if (!StartsWithASCII(name, extension_name_prefix, true) || | 123 if (!StartsWithASCII(name, extension_name_prefix, true) || |
| 125 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) { | 124 !base::StringToInt(name.substr(strlen(extension_name_prefix)), index)) { |
| 126 LOG(WARNING) << "Unable to convert extension name \"" << name | 125 LOG(WARNING) << "Unable to convert extension name \"" << name |
| 127 << "\" to index"; | 126 << "\" to index"; |
| 128 return false; | 127 return false; |
| 129 } | 128 } |
| 130 return true; | 129 return true; |
| 131 } | 130 } |
| 132 | 131 |
| 133 } // namespace extensions_helper | 132 } // namespace extensions_helper |
| OLD | NEW |