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 | 92 set_display_area_observer(old_provider->display_area_observer()); |
93 ObserverListBase<DisplaySettingsProvider::DisplayAreaObserver>::Iterator | 93 set_desktop_bar_observer(old_provider->desktop_bar_observer()); |
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 | |
108 panel_manager->set_display_settings_provider(this); | 94 panel_manager->set_display_settings_provider(this); |
109 | 95 |
110 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars)); | 96 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars)); |
111 } | 97 } |
112 | 98 |
113 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const { | 99 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const { |
114 // Some test might want to use the actual work area, that is indicated by | 100 // Some test might want to use the actual work area, that is indicated by |
115 // passing empty testing work area. | 101 // passing empty testing work area. |
116 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea() | 102 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea() |
117 : testing_work_area_; | 103 : testing_work_area_; |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
500 } | 486 } |
501 | 487 |
502 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { | 488 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { |
503 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); | 489 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); |
504 } | 490 } |
505 | 491 |
506 std::string BasePanelBrowserTest::MakePanelName(int index) { | 492 std::string BasePanelBrowserTest::MakePanelName(int index) { |
507 std::string panel_name("Panel"); | 493 std::string panel_name("Panel"); |
508 return panel_name + base::IntToString(index); | 494 return panel_name + base::IntToString(index); |
509 } | 495 } |
OLD | NEW |