| 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/sync_extension_helper.h" | 5 #include "chrome/browser/sync/test/integration/sync_extension_helper.h" |
| 6 | 6 |
| 7 #include "base/file_path.h" | 7 #include "base/file_path.h" |
| 8 #include "base/file_util.h" | 8 #include "base/file_util.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/values.h" | 10 #include "base/values.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 return names; | 94 return names; |
| 95 } | 95 } |
| 96 | 96 |
| 97 void SyncExtensionHelper::EnableExtension(Profile* profile, | 97 void SyncExtensionHelper::EnableExtension(Profile* profile, |
| 98 const std::string& name) { | 98 const std::string& name) { |
| 99 profile->GetExtensionService()->EnableExtension(NameToId(name)); | 99 profile->GetExtensionService()->EnableExtension(NameToId(name)); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void SyncExtensionHelper::DisableExtension(Profile* profile, | 102 void SyncExtensionHelper::DisableExtension(Profile* profile, |
| 103 const std::string& name) { | 103 const std::string& name) { |
| 104 profile->GetExtensionService()->DisableExtension(NameToId(name)); | 104 profile->GetExtensionService()->DisableExtension( |
| 105 NameToId(name), Extension::DISABLE_USER_ACTION); |
| 105 } | 106 } |
| 106 | 107 |
| 107 bool SyncExtensionHelper::IsExtensionEnabled( | 108 bool SyncExtensionHelper::IsExtensionEnabled( |
| 108 Profile* profile, const std::string& name) const { | 109 Profile* profile, const std::string& name) const { |
| 109 return profile->GetExtensionService()->IsExtensionEnabled(NameToId(name)); | 110 return profile->GetExtensionService()->IsExtensionEnabled(NameToId(name)); |
| 110 } | 111 } |
| 111 | 112 |
| 112 void SyncExtensionHelper::IncognitoEnableExtension( | 113 void SyncExtensionHelper::IncognitoEnableExtension( |
| 113 Profile* profile, const std::string& name) { | 114 Profile* profile, const std::string& name) { |
| 114 profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), true); | 115 profile->GetExtensionService()->SetIsIncognitoEnabled(NameToId(name), true); |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 if (extension->id() != expected_id) { | 345 if (extension->id() != expected_id) { |
| 345 EXPECT_EQ(expected_id, extension->id()); | 346 EXPECT_EQ(expected_id, extension->id()); |
| 346 return NULL; | 347 return NULL; |
| 347 } | 348 } |
| 348 DVLOG(2) << "created extension with name = " | 349 DVLOG(2) << "created extension with name = " |
| 349 << name << ", id = " << expected_id; | 350 << name << ", id = " << expected_id; |
| 350 (it->second)[name] = extension; | 351 (it->second)[name] = extension; |
| 351 id_to_name_[expected_id] = name; | 352 id_to_name_[expected_id] = name; |
| 352 return extension; | 353 return extension; |
| 353 } | 354 } |
| OLD | NEW |