Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(553)

Side by Side Diff: chrome/browser/ui/panels/base_panel_browser_test.cc

Issue 10051020: Move full-screen detection logic from PanelManager to DisplaySettingsProvider. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix per feedback Created 8 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/ui/panels/display_settings_provider.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
Dmitry Titov 2012/04/12 01:18:59 Does it make sense to add DCHECK(!display_area_ob
97 ObserverListBase<DisplaySettingsProvider::DesktopBarObserver>::Iterator
98 desktop_bar_observer_iter(old_provider->desktop_bar_observers());
99 AddDesktopBarObserver(desktop_bar_observer_iter.GetNext());
100
101 ObserverListBase<DisplaySettingsProvider::FullScreenObserver>::Iterator
102 full_screen_observer_iter(old_provider->full_screen_observers());
103 AddFullScreenObserver(full_screen_observer_iter.GetNext());
104
94 panel_manager->set_display_settings_provider(this); 105 panel_manager->set_display_settings_provider(this);
95 106
96 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars)); 107 memset(mock_desktop_bars, 0, sizeof(mock_desktop_bars));
97 } 108 }
98 109
99 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const { 110 gfx::Rect MockDisplaySettingsProviderImpl::GetWorkArea() const {
100 // Some test might want to use the actual work area, that is indicated by 111 // Some test might want to use the actual work area, that is indicated by
101 // passing empty testing work area. 112 // passing empty testing work area.
102 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea() 113 return testing_work_area_.IsEmpty() ? DisplaySettingsProvider::GetWorkArea()
103 : testing_work_area_; 114 : testing_work_area_;
(...skipping 377 matching lines...) Expand 10 before | Expand all | Expand 10 after
481 } 492 }
482 493
483 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) { 494 void BasePanelBrowserTest::MoveMouse(const gfx::Point& position) {
484 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position); 495 PanelManager::GetInstance()->mouse_watcher()->NotifyMouseMovement(position);
485 } 496 }
486 497
487 std::string BasePanelBrowserTest::MakePanelName(int index) { 498 std::string BasePanelBrowserTest::MakePanelName(int index) {
488 std::string panel_name("Panel"); 499 std::string panel_name("Panel");
489 return panel_name + base::IntToString(index); 500 return panel_name + base::IntToString(index);
490 } 501 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/panels/display_settings_provider.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698