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/base_panel_browser_test.h" | 5 #include "chrome/browser/ui/panels/base_panel_browser_test.h" |
6 | 6 |
7 #include "chrome/browser/ui/browser_list.h" | 7 #include "chrome/browser/ui/browser_list.h" |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
82 MockDesktopBar mock_desktop_bars[3]; | 82 MockDesktopBar mock_desktop_bars[3]; |
83 | 83 |
84 DISALLOW_COPY_AND_ASSIGN(MockDisplaySettingsProviderImpl); | 84 DISALLOW_COPY_AND_ASSIGN(MockDisplaySettingsProviderImpl); |
85 }; | 85 }; |
86 | 86 |
87 | 87 |
88 MockDisplaySettingsProviderImpl::MockDisplaySettingsProviderImpl( | 88 MockDisplaySettingsProviderImpl::MockDisplaySettingsProviderImpl( |
89 PanelManager* panel_manager) { | 89 PanelManager* panel_manager) { |
90 DisplaySettingsProvider* old_provider = | 90 DisplaySettingsProvider* old_provider = |
91 panel_manager->display_settings_provider(); | 91 panel_manager->display_settings_provider(); |
92 set_display_area_observer(old_provider->display_area_observer()); | 92 |
93 set_desktop_bar_observer(old_provider->desktop_bar_observer()); | 93 ObserverListBase<DisplaySettingsProvider::DisplayAreaObserver>::Iterator |
| 94 display_area_observers_iter(old_provider->display_area_observers()); |
| 95 AddDisplayAreaObserver(display_area_observers_iter.GetNext()); |
| 96 DCHECK(!display_area_observers_iter.GetNext()); |
| 97 |
| 98 ObserverListBase<DisplaySettingsProvider::DesktopBarObserver>::Iterator |
| 99 desktop_bar_observer_iter(old_provider->desktop_bar_observers()); |
| 100 AddDesktopBarObserver(desktop_bar_observer_iter.GetNext()); |
| 101 DCHECK(!desktop_bar_observer_iter.GetNext()); |
| 102 |
| 103 ObserverListBase<DisplaySettingsProvider::FullScreenObserver>::Iterator |
| 104 full_screen_observer_iter(old_provider->full_screen_observers()); |
| 105 AddFullScreenObserver(full_screen_observer_iter.GetNext()); |
| 106 DCHECK(!full_screen_observer_iter.GetNext()); |
| 107 |
94 panel_manager->set_display_settings_provider(this); | 108 panel_manager->set_display_settings_provider(this); |
95 | 109 |
96 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars)); | 110 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars)); |
97 } | 111 } |
98 | 112 |
99 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const { | 113 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const { |
100 // Some test might want to use the actual work area, that is indicated by | 114 // Some test might want to use the actual work area, that is indicated by |
101 // passing empty testing work area. | 115 // passing empty testing work area. |
102 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea() | 116 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea() |
103 : testing_work_area_; | 117 : testing_work_area_; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
486 } | 500 } |
487 | 501 |
488 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 502 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
489 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 503 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
490 } | 504 } |
491 | 505 |
492 std::string BasePanelBrowserTest::MakePanelName(int index) { | 506 std::string BasePanelBrowserTest::MakePanelName(int index) { |
493 std::string panel_name("Panel"); | 507 std::string panel_name("Panel"); |
494 return panel_name + base::IntToString(index); | 508 return panel_name + base::IntToString(index); |
495 } | 509 } |
OLD | NEW |