| 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/ui/panels/test_panel_active_state_observer.h" | 5 #include "chrome/browser/ui/panels/test_panel_active_state_observer.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/panels/panel.h" | 7 #include "chrome/browser/ui/panels/panel.h" |
| 8 #include "chrome/common/chrome_notification_types.h" | 8 #include "chrome/common/chrome_notification_types.h" |
| 9 | 9 |
| 10 PanelActiveStateObserver::PanelActiveStateObserver( | 10 PanelActiveStateObserver::PanelActiveStateObserver( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 return panel_->IsActive() == expect_active_; | 34 return panel_->IsActive() == expect_active_; |
| 35 } | 35 } |
| 36 | 36 |
| 37 void PanelActiveStateObserver::Observe( | 37 void PanelActiveStateObserver::Observe( |
| 38 int type, | 38 int type, |
| 39 const content::NotificationSource& source, | 39 const content::NotificationSource& source, |
| 40 const content::NotificationDetails& details) { | 40 const content::NotificationDetails& details) { |
| 41 if (!running_) | 41 if (!running_) |
| 42 return; | 42 return; |
| 43 | 43 |
| 44 EXPECT_EQ(panel_->IsActive(), *content::Details<bool>(details).ptr()); |
| 45 |
| 44 if (AtExpectedState()) { | 46 if (AtExpectedState()) { |
| 45 seen_ = true; | 47 seen_ = true; |
| 46 message_loop_runner_->Quit(); | 48 message_loop_runner_->Quit(); |
| 47 running_ = false; | 49 running_ = false; |
| 48 } | 50 } |
| 49 } | 51 } |
| OLD | NEW |