| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/themes_helper.h" | 5 #include "chrome/browser/sync/test/integration/themes_helper.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/stringprintf.h" | 10 #include "base/strings/stringprintf.h" |
| (...skipping 112 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 123 } | 123 } |
| 124 | 124 |
| 125 bool ThemePendingInstallChecker::IsExitConditionSatisfied() { | 125 bool ThemePendingInstallChecker::IsExitConditionSatisfied() { |
| 126 return ThemeIsPendingInstall(profile_, theme_); | 126 return ThemeIsPendingInstall(profile_, theme_); |
| 127 } | 127 } |
| 128 | 128 |
| 129 void ThemePendingInstallChecker::Observe( | 129 void ThemePendingInstallChecker::Observe( |
| 130 int type, | 130 int type, |
| 131 const content::NotificationSource& source, | 131 const content::NotificationSource& source, |
| 132 const content::NotificationDetails& details) { | 132 const content::NotificationDetails& details) { |
| 133 DCHECK_EQ(chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, type); | 133 DCHECK_EQ(extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, type); |
| 134 CheckExitCondition(); | 134 CheckExitCondition(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 void ThemePendingInstallChecker::Wait() { | 137 void ThemePendingInstallChecker::Wait() { |
| 138 // We'll check to see if the condition is met whenever the extension system | 138 // We'll check to see if the condition is met whenever the extension system |
| 139 // tries to contact the web store. | 139 // tries to contact the web store. |
| 140 registrar_.Add(this, | 140 registrar_.Add(this, |
| 141 chrome::NOTIFICATION_EXTENSION_UPDATING_STARTED, | 141 extensions::NOTIFICATION_EXTENSION_UPDATING_STARTED, |
| 142 content::Source<Profile>(profile_)); | 142 content::Source<Profile>(profile_)); |
| 143 | 143 |
| 144 if (IsExitConditionSatisfied()) { | 144 if (IsExitConditionSatisfied()) { |
| 145 return; | 145 return; |
| 146 } | 146 } |
| 147 | 147 |
| 148 StartBlockingWait(); | 148 StartBlockingWait(); |
| 149 } | 149 } |
| 150 | 150 |
| 151 } // namespace | 151 } // namespace |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 254 bool AwaitUsingDefaultTheme(Profile* profile) { | 254 bool AwaitUsingDefaultTheme(Profile* profile) { |
| 255 ThemeConditionChecker checker( | 255 ThemeConditionChecker checker( |
| 256 profile, | 256 profile, |
| 257 std::string("Waiting until profile is using default theme"), | 257 std::string("Waiting until profile is using default theme"), |
| 258 base::Bind(&UsingDefaultThemeFunc)); | 258 base::Bind(&UsingDefaultThemeFunc)); |
| 259 checker.Wait(); | 259 checker.Wait(); |
| 260 return !checker.TimedOut(); | 260 return !checker.TimedOut(); |
| 261 } | 261 } |
| 262 | 262 |
| 263 } // namespace themes_helper | 263 } // namespace themes_helper |
| OLD | NEW |