| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/test/live_sync/live_themes_sync_test.h" | 5 #include "chrome/test/live_sync/live_themes_sync_test.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "chrome/browser/extensions/extensions_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 #include "chrome/browser/themes/browser_theme_provider.h" | 12 #include "chrome/browser/themes/browser_theme_provider.h" |
| 13 #include "chrome/common/extensions/extension.h" | 13 #include "chrome/common/extensions/extension.h" |
| 14 | 14 |
| 15 LiveThemesSyncTest::LiveThemesSyncTest(TestType test_type) | 15 LiveThemesSyncTest::LiveThemesSyncTest(TestType test_type) |
| 16 : LiveExtensionsSyncTestBase(test_type) {} | 16 : LiveExtensionsSyncTestBase(test_type) {} |
| 17 | 17 |
| 18 LiveThemesSyncTest::~LiveThemesSyncTest() {} | 18 LiveThemesSyncTest::~LiveThemesSyncTest() {} |
| 19 | 19 |
| 20 void LiveThemesSyncTest::SetTheme( | 20 void LiveThemesSyncTest::SetTheme( |
| (...skipping 25 matching lines...) Expand all Loading... |
| 46 // and we're not using the default theme. | 46 // and we're not using the default theme. |
| 47 return | 47 return |
| 48 !profile->GetTheme() && | 48 !profile->GetTheme() && |
| 49 (!kHasDistinctNativeTheme || | 49 (!kHasDistinctNativeTheme || |
| 50 !profile->GetThemeProvider()->UsingDefaultTheme()); | 50 !profile->GetThemeProvider()->UsingDefaultTheme()); |
| 51 } | 51 } |
| 52 | 52 |
| 53 bool LiveThemesSyncTest::ExtensionIsPendingInstall( | 53 bool LiveThemesSyncTest::ExtensionIsPendingInstall( |
| 54 Profile* profile, const Extension* extension) { | 54 Profile* profile, const Extension* extension) { |
| 55 const PendingExtensionMap& pending_extensions = | 55 const PendingExtensionMap& pending_extensions = |
| 56 profile->GetExtensionsService()->pending_extensions(); | 56 profile->GetExtensionService()->pending_extensions(); |
| 57 return pending_extensions.find(extension->id()) != pending_extensions.end(); | 57 return pending_extensions.find(extension->id()) != pending_extensions.end(); |
| 58 } | 58 } |
| 59 | 59 |
| 60 bool LiveThemesSyncTest::HasOrWillHaveCustomTheme( | 60 bool LiveThemesSyncTest::HasOrWillHaveCustomTheme( |
| 61 Profile* profile, const Extension* theme) { | 61 Profile* profile, const Extension* theme) { |
| 62 return | 62 return |
| 63 (GetCustomTheme(profile) == theme) || | 63 (GetCustomTheme(profile) == theme) || |
| 64 ExtensionIsPendingInstall(profile, theme); | 64 ExtensionIsPendingInstall(profile, theme); |
| 65 } | 65 } |
| OLD | NEW |