| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/extension_test_notification_observer.h" | 5 #include "chrome/browser/extensions/extension_test_notification_observer.h" |
| 6 | 6 |
| 7 #include "base/callback_list.h" | 7 #include "base/callback_list.h" |
| 8 #include "chrome/browser/extensions/extension_action_test_util.h" | 8 #include "chrome/browser/extensions/extension_action_test_util.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/profiles/profile_manager.h" | 10 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 132 WaitForCondition( | 132 WaitForCondition( |
| 133 base::Bind(&HasPageActionVisibilityReachedTarget, browser_, count), | 133 base::Bind(&HasPageActionVisibilityReachedTarget, browser_, count), |
| 134 NULL); | 134 NULL); |
| 135 extensions::ExtensionActionAPI::Get(GetProfile())-> | 135 extensions::ExtensionActionAPI::Get(GetProfile())-> |
| 136 RemoveObserver(this); | 136 RemoveObserver(this); |
| 137 return true; | 137 return true; |
| 138 } | 138 } |
| 139 | 139 |
| 140 bool ExtensionTestNotificationObserver::WaitForExtensionViewsToLoad() { | 140 bool ExtensionTestNotificationObserver::WaitForExtensionViewsToLoad() { |
| 141 extensions::ProcessManager* manager = | 141 extensions::ProcessManager* manager = |
| 142 extensions::ExtensionSystem::Get(GetProfile())->process_manager(); | 142 extensions::ProcessManager::Get(GetProfile()); |
| 143 NotificationSet notification_set; | 143 NotificationSet notification_set; |
| 144 notification_set.Add(content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 144 notification_set.Add(content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
| 145 notification_set.Add(content::NOTIFICATION_LOAD_STOP); | 145 notification_set.Add(content::NOTIFICATION_LOAD_STOP); |
| 146 WaitForCondition( | 146 WaitForCondition( |
| 147 base::Bind(&HaveAllExtensionRenderViewHostsFinishedLoading, manager), | 147 base::Bind(&HaveAllExtensionRenderViewHostsFinishedLoading, manager), |
| 148 ¬ification_set); | 148 ¬ification_set); |
| 149 return true; | 149 return true; |
| 150 } | 150 } |
| 151 | 151 |
| 152 bool ExtensionTestNotificationObserver::WaitForExtensionInstall() { | 152 bool ExtensionTestNotificationObserver::WaitForExtensionInstall() { |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 280 runner->Run(); | 280 runner->Run(); |
| 281 | 281 |
| 282 condition_.Reset(); | 282 condition_.Reset(); |
| 283 quit_closure_.Reset(); | 283 quit_closure_.Reset(); |
| 284 } | 284 } |
| 285 | 285 |
| 286 void ExtensionTestNotificationObserver::MaybeQuit() { | 286 void ExtensionTestNotificationObserver::MaybeQuit() { |
| 287 if (condition_.Run()) | 287 if (condition_.Run()) |
| 288 quit_closure_.Run(); | 288 quit_closure_.Run(); |
| 289 } | 289 } |
| OLD | NEW |