summaryrefslogtreecommitdiffstats
path: root/ui/aura
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 18:50:45 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-06-27 18:50:45 +0000
commitebc1dea7ab6f535eac8db6de630d7c509d57b6d8 (patch)
tree828fcb3eca002347745a2c754f194060e7af265a /ui/aura
parentf70e426254b0dda5540398aa47202d8d8c817196 (diff)
downloadchromium_src-ebc1dea7ab6f535eac8db6de630d7c509d57b6d8.zip
chromium_src-ebc1dea7ab6f535eac8db6de630d7c509d57b6d8.tar.gz
chromium_src-ebc1dea7ab6f535eac8db6de630d7c509d57b6d8.tar.bz2
Rename the remaining usage of Monitor to Display
BUG=none TEST=none Review URL: https://chromiumcodereview.appspot.com/10675011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@144499 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/aura')
-rw-r--r--ui/aura/aura.gyp12
-rw-r--r--ui/aura/bench/bench_main.cc8
-rw-r--r--ui/aura/demo/demo_main.cc6
-rw-r--r--ui/aura/display_change_observer_x11.cc (renamed from ui/aura/monitor_change_observer_x11.cc)24
-rw-r--r--ui/aura/display_change_observer_x11.h (renamed from ui/aura/monitor_change_observer_x11.h)20
-rw-r--r--ui/aura/display_manager.cc (renamed from ui/aura/monitor_manager.cc)32
-rw-r--r--ui/aura/display_manager.h (renamed from ui/aura/monitor_manager.h)46
-rw-r--r--ui/aura/display_observer.h8
-rw-r--r--ui/aura/env.cc14
-rw-r--r--ui/aura/env.h14
-rw-r--r--ui/aura/root_window.cc14
-rw-r--r--ui/aura/single_display_manager.cc (renamed from ui/aura/single_monitor_manager.cc)32
-rw-r--r--ui/aura/single_display_manager.h (renamed from ui/aura/single_monitor_manager.h)24
-rw-r--r--ui/aura/test/aura_test_helper.cc8
-rw-r--r--ui/aura/window.cc2
-rw-r--r--ui/aura/window.h2
16 files changed, 133 insertions, 133 deletions
diff --git a/ui/aura/aura.gyp b/ui/aura/aura.gyp
index ff85629..8befbdd 100644
--- a/ui/aura/aura.gyp
+++ b/ui/aura/aura.gyp
@@ -87,10 +87,10 @@
'focus_manager.h',
'layout_manager.cc',
'layout_manager.h',
- 'monitor_change_observer_x11.cc',
- 'monitor_change_observer_x11.h',
- 'monitor_manager.cc',
- 'monitor_manager.h',
+ 'display_change_observer_x11.cc',
+ 'display_change_observer_x11.h',
+ 'display_manager.cc',
+ 'display_manager.h',
'root_window_host.h',
'root_window_host_linux.cc',
'root_window_host_linux.h',
@@ -110,8 +110,8 @@
'shared/input_method_event_filter.h',
'shared/root_window_capture_client.cc',
'shared/root_window_capture_client.h',
- 'single_monitor_manager.cc',
- 'single_monitor_manager.h',
+ 'single_display_manager.cc',
+ 'single_display_manager.h',
'ui_controls_win.cc',
'ui_controls_x11.cc',
'window.cc',
diff --git a/ui/aura/bench/bench_main.cc b/ui/aura/bench/bench_main.cc
index 92a837e..be3465b 100644
--- a/ui/aura/bench/bench_main.cc
+++ b/ui/aura/bench/bench_main.cc
@@ -14,7 +14,7 @@
#include "ui/aura/env.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/single_monitor_manager.h"
+#include "ui/aura/single_display_manager.h"
#include "ui/aura/window.h"
#include "ui/base/hit_test.h"
#include "ui/base/resource/resource_bundle.h"
@@ -282,11 +282,11 @@ int main(int argc, char** argv) {
MessageLoop message_loop(MessageLoop::TYPE_UI);
ui::CompositorTestSupport::Initialize();
- aura::SingleMonitorManager* manager = new aura::SingleMonitorManager;
+ aura::SingleDisplayManager* manager = new aura::SingleDisplayManager;
manager->set_use_fullscreen_host_window(true);
- aura::Env::GetInstance()->SetMonitorManager(manager);
+ aura::Env::GetInstance()->SetDisplayManager(manager);
scoped_ptr<aura::RootWindow> root_window(
- aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
+ aura::DisplayManager::CreateRootWindowForPrimaryDisplay());
// add layers
ColoredLayer background(SK_ColorRED);
diff --git a/ui/aura/demo/demo_main.cc b/ui/aura/demo/demo_main.cc
index 050acb0..b1908e8 100644
--- a/ui/aura/demo/demo_main.cc
+++ b/ui/aura/demo/demo_main.cc
@@ -12,7 +12,7 @@
#include "ui/aura/env.h"
#include "ui/aura/event.h"
#include "ui/aura/root_window.h"
-#include "ui/aura/single_monitor_manager.h"
+#include "ui/aura/single_display_manager.h"
#include "ui/aura/window.h"
#include "ui/aura/window_delegate.h"
#include "ui/base/hit_test.h"
@@ -120,9 +120,9 @@ int main(int argc, char** argv) {
// Create the message-loop here before creating the root window.
MessageLoop message_loop(MessageLoop::TYPE_UI);
ui::CompositorTestSupport::Initialize();
- aura::Env::GetInstance()->SetMonitorManager(new aura::SingleMonitorManager);
+ aura::Env::GetInstance()->SetDisplayManager(new aura::SingleDisplayManager);
scoped_ptr<aura::RootWindow> root_window(
- aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
+ aura::DisplayManager::CreateRootWindowForPrimaryDisplay());
scoped_ptr<DemoStackingClient> stacking_client(new DemoStackingClient(
root_window.get()));
diff --git a/ui/aura/monitor_change_observer_x11.cc b/ui/aura/display_change_observer_x11.cc
index 5afe527..85b4aec 100644
--- a/ui/aura/monitor_change_observer_x11.cc
+++ b/ui/aura/display_change_observer_x11.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/aura/monitor_change_observer_x11.h"
+#include "ui/aura/display_change_observer_x11.h"
#include <algorithm>
#include <map>
@@ -14,7 +14,7 @@
#include "base/message_pump_aurax11.h"
#include "ui/aura/dispatcher_linux.h"
#include "ui/aura/env.h"
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include "ui/compositor/dip_util.h"
#include "ui/gfx/display.h"
@@ -30,7 +30,7 @@ namespace {
// please update the bug (crosbug.com/31628) first and make sure that the
// driver will use the same value.
// This value also has to be kept in sync with the value in
-// chromeos/monitor/output_configurator.cc. See crbug.com/130188
+// chromeos/display/output_configurator.cc. See crbug.com/130188
const unsigned int kHighDensityDIPThreshold = 160;
// 1 inch in mm.
@@ -51,7 +51,7 @@ bool CompareDisplayY(const gfx::Display& lhs, const gfx::Display& rhs) {
} // namespace
-MonitorChangeObserverX11::MonitorChangeObserverX11()
+DisplayChangeObserverX11::DisplayChangeObserverX11()
: xdisplay_(base::MessagePumpAuraX11::GetDefaultXDisplay()),
x_root_window_(DefaultRootWindow(xdisplay_)),
xrandr_event_base_(0) {
@@ -61,21 +61,21 @@ MonitorChangeObserverX11::MonitorChangeObserverX11()
AddDispatcherForRootWindow(this);
}
-MonitorChangeObserverX11::~MonitorChangeObserverX11() {
+DisplayChangeObserverX11::~DisplayChangeObserverX11() {
static_cast<DispatcherLinux*>(Env::GetInstance()->GetDispatcher())->
RemoveDispatcherForRootWindow(this);
}
-bool MonitorChangeObserverX11::Dispatch(const base::NativeEvent& event) {
+bool DisplayChangeObserverX11::Dispatch(const base::NativeEvent& event) {
if (event->type - xrandr_event_base_ == RRScreenChangeNotify) {
NotifyDisplayChange();
}
return true;
}
-void MonitorChangeObserverX11::NotifyDisplayChange() {
- if (!MonitorManager::use_fullscreen_host_window())
- return; // Use the default monitor that monitor manager determined.
+void DisplayChangeObserverX11::NotifyDisplayChange() {
+ if (!DisplayManager::use_fullscreen_host_window())
+ return; // Use the default display that display manager determined.
XRRScreenResources* screen_resources =
XRRGetScreenResources(xdisplay_, x_root_window_);
@@ -106,10 +106,10 @@ void MonitorChangeObserverX11::NotifyDisplayChange() {
}
XRRModeInfo* mode = FindMode(screen_resources, crtc_info->mode);
CHECK(mode);
- // Mirrored monitors have the same y coordinates.
+ // Mirrored displays have the same y coordinates.
if (y_coords.find(crtc_info->y) != y_coords.end())
continue;
- // TODO(oshima): Create unique ID for the monitor.
+ // TODO(oshima): Create unique ID for the display.
displays.push_back(gfx::Display(
0,
gfx::Rect(crtc_info->x, crtc_info->y, mode->width, mode->height)));
@@ -141,7 +141,7 @@ void MonitorChangeObserverX11::NotifyDisplayChange() {
iter != displays.end(); ++iter, ++id)
(*iter).set_id(id);
- Env::GetInstance()->monitor_manager()->OnNativeMonitorsChanged(displays);
+ Env::GetInstance()->display_manager()->OnNativeDisplaysChanged(displays);
}
} // namespace internal
diff --git a/ui/aura/monitor_change_observer_x11.h b/ui/aura/display_change_observer_x11.h
index 4160860..caf3be7 100644
--- a/ui/aura/monitor_change_observer_x11.h
+++ b/ui/aura/display_change_observer_x11.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H
-#define UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H
+#ifndef UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H
+#define UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H
#pragma once
#include <X11/Xlib.h>
@@ -17,18 +17,18 @@
namespace aura {
namespace internal {
-// An object that observes changes in monitor configuration and
-// update MonitorManagers.
-class MonitorChangeObserverX11 : public MessageLoop::Dispatcher {
+// An object that observes changes in display configuration and
+// update DisplayManagers.
+class DisplayChangeObserverX11 : public MessageLoop::Dispatcher {
public:
- MonitorChangeObserverX11();
- virtual ~MonitorChangeObserverX11();
+ DisplayChangeObserverX11();
+ virtual ~DisplayChangeObserverX11();
// Overridden from Dispatcher overrides:
virtual bool Dispatch(const base::NativeEvent& xev) OVERRIDE;
// Reads display configurations from the system and notifies
- // |monitor_manager_| about the change.
+ // |display_manager_| about the change.
void NotifyDisplayChange();
private:
@@ -38,10 +38,10 @@ class MonitorChangeObserverX11 : public MessageLoop::Dispatcher {
int xrandr_event_base_;
- DISALLOW_COPY_AND_ASSIGN(MonitorChangeObserverX11);
+ DISALLOW_COPY_AND_ASSIGN(DisplayChangeObserverX11);
};
} // namespace internal
} // namespace aura
-#endif // UI_AURA_MONITOR_CHANGE_OBSERVER_X11_H
+#endif // UI_AURA_DISPLAY_CHANGE_OBSERVER_X11_H
diff --git a/ui/aura/monitor_manager.cc b/ui/aura/display_manager.cc
index aba7bcc..af1e848 100644
--- a/ui/aura/monitor_manager.cc
+++ b/ui/aura/display_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include <stdio.h>
@@ -16,7 +16,7 @@
namespace aura {
namespace {
-// Default bounds for a monitor.
+// Default bounds for a display.
const int kDefaultHostWindowX = 200;
const int kDefaultHostWindowY = 200;
const int kDefaultHostWindowWidth = 1280;
@@ -24,11 +24,11 @@ const int kDefaultHostWindowHeight = 1024;
} // namespace
// static
-bool MonitorManager::use_fullscreen_host_window_ = false;
+bool DisplayManager::use_fullscreen_host_window_ = false;
// static
-gfx::Display MonitorManager::CreateMonitorFromSpec(const std::string& spec) {
- static int synthesized_monitor_id = 1000;
+gfx::Display DisplayManager::CreateDisplayFromSpec(const std::string& spec) {
+ static int synthesized_display_id = 1000;
gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY,
kDefaultHostWindowWidth, kDefaultHostWindowHeight);
int x = 0, y = 0, width, height;
@@ -41,46 +41,46 @@ gfx::Display MonitorManager::CreateMonitorFromSpec(const std::string& spec) {
} else if (use_fullscreen_host_window_) {
bounds = gfx::Rect(aura::RootWindowHost::GetNativeScreenSize());
}
- gfx::Display display(synthesized_monitor_id++);
+ gfx::Display display(synthesized_display_id++);
display.SetScaleAndBounds(scale, bounds);
DVLOG(1) << "Display bounds=" << bounds.ToString() << ", scale=" << scale;
return display;
}
// static
-RootWindow* MonitorManager::CreateRootWindowForPrimaryMonitor() {
- MonitorManager* manager = aura::Env::GetInstance()->monitor_manager();
+RootWindow* DisplayManager::CreateRootWindowForPrimaryDisplay() {
+ DisplayManager* manager = aura::Env::GetInstance()->display_manager();
RootWindow* root =
- manager->CreateRootWindowForMonitor(manager->GetDisplayAt(0));
+ manager->CreateRootWindowForDisplay(manager->GetDisplayAt(0));
if (use_fullscreen_host_window_)
root->ConfineCursorToWindow();
return root;
}
-MonitorManager::MonitorManager() {
+DisplayManager::DisplayManager() {
}
-MonitorManager::~MonitorManager() {
+DisplayManager::~DisplayManager() {
}
-void MonitorManager::AddObserver(DisplayObserver* observer) {
+void DisplayManager::AddObserver(DisplayObserver* observer) {
observers_.AddObserver(observer);
}
-void MonitorManager::RemoveObserver(DisplayObserver* observer) {
+void DisplayManager::RemoveObserver(DisplayObserver* observer) {
observers_.RemoveObserver(observer);
}
-void MonitorManager::NotifyBoundsChanged(const gfx::Display& display) {
+void DisplayManager::NotifyBoundsChanged(const gfx::Display& display) {
FOR_EACH_OBSERVER(DisplayObserver, observers_,
OnDisplayBoundsChanged(display));
}
-void MonitorManager::NotifyDisplayAdded(const gfx::Display& display) {
+void DisplayManager::NotifyDisplayAdded(const gfx::Display& display) {
FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayAdded(display));
}
-void MonitorManager::NotifyDisplayRemoved(const gfx::Display& display) {
+void DisplayManager::NotifyDisplayRemoved(const gfx::Display& display) {
FOR_EACH_OBSERVER(DisplayObserver, observers_, OnDisplayRemoved(display));
}
diff --git a/ui/aura/monitor_manager.h b/ui/aura/display_manager.h
index 40e6bbf..1d889c4 100644
--- a/ui/aura/monitor_manager.h
+++ b/ui/aura/display_manager.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_AURA_MONITOR_MANAGER_H_
-#define UI_AURA_MONITOR_MANAGER_H_
+#ifndef UI_AURA_DISPLAY_MANAGER_H_
+#define UI_AURA_DISPLAY_MANAGER_H_
#pragma once
#include <string>
@@ -24,11 +24,11 @@ class DisplayObserver;
class RootWindow;
class Window;
-// MonitorManager creates, deletes and updates Monitor objects when
-// monitor configuration changes, and notifies DisplayObservers about
+// DisplayManager creates, deletes and updates Display objects when
+// display configuration changes, and notifies DisplayObservers about
// the change. This is owned by Env and its lifetime is longer than
// any windows.
-class AURA_EXPORT MonitorManager {
+class AURA_EXPORT DisplayManager {
public:
static void set_use_fullscreen_host_window(bool use_fullscreen) {
use_fullscreen_host_window_ = use_fullscreen;
@@ -37,34 +37,34 @@ class AURA_EXPORT MonitorManager {
return use_fullscreen_host_window_;
}
- // Creates a monitor from string spec. 100+200-1440x800 creates monitor
+ // Creates a display from string spec. 100+200-1440x800 creates display
// whose size is 1440x800 at the location (100, 200) in screen's coordinates.
// The location can be omitted and be just "1440x800", which creates
- // monitor at the origin of the screen. An empty string creates
- // the monitor with default size.
+ // display at the origin of the screen. An empty string creates
+ // the display with default size.
// The device scale factor can be specified by "*", like "1280x780*2",
// or will use the value of |gfx::Display::GetForcedDeviceScaleFactor()| if
// --force-device-scale-factor is specified.
- static gfx::Display CreateMonitorFromSpec(const std::string& spec);
+ static gfx::Display CreateDisplayFromSpec(const std::string& spec);
- // A utility function to create a root window for primary monitor.
- static RootWindow* CreateRootWindowForPrimaryMonitor();
+ // A utility function to create a root window for primary display.
+ static RootWindow* CreateRootWindowForPrimaryDisplay();
- MonitorManager();
- virtual ~MonitorManager();
+ DisplayManager();
+ virtual ~DisplayManager();
// Adds/removes DisplayObservers.
void AddObserver(DisplayObserver* observer);
void RemoveObserver(DisplayObserver* observer);
- // Called when monitor configuration has changed. The new monitor
- // configurations is passed as a vector of Monitor object, which
- // contains each monitor's new infomration.
- virtual void OnNativeMonitorsChanged(
+ // Called when display configuration has changed. The new display
+ // configurations is passed as a vector of Display object, which
+ // contains each display's new infomration.
+ virtual void OnNativeDisplaysChanged(
const std::vector<gfx::Display>& display) = 0;
- // Create a root window for given |monitor|.
- virtual RootWindow* CreateRootWindowForMonitor(
+ // Create a root window for given |display|.
+ virtual RootWindow* CreateRootWindowForDisplay(
const gfx::Display& display) = 0;
// Returns the display at |index|. The display at 0 is considered "primary".
@@ -76,7 +76,7 @@ class AURA_EXPORT MonitorManager {
virtual const gfx::Display& GetDisplayNearestWindow(
const Window* window) const = 0;
- // Returns the monitor object nearest given |pint|.
+ // Returns the display object nearest given |pint|.
virtual const gfx::Display& GetDisplayNearestPoint(
const gfx::Point& point) const = 0;
@@ -88,14 +88,14 @@ class AURA_EXPORT MonitorManager {
private:
// If set before the RootWindow is created, the host window will cover the
- // entire monitor. Note that this can still be overridden via the
+ // entire display. Note that this can still be overridden via the
// switches::kAuraHostWindowSize flag.
static bool use_fullscreen_host_window_;
ObserverList<DisplayObserver> observers_;
- DISALLOW_COPY_AND_ASSIGN(MonitorManager);
+ DISALLOW_COPY_AND_ASSIGN(DisplayManager);
};
} // namespace aura
-#endif // UI_AURA_MONITOR_MANAGER_H_
+#endif // UI_AURA_DISPLAY_MANAGER_H_
diff --git a/ui/aura/display_observer.h b/ui/aura/display_observer.h
index 282241d..0399ae6 100644
--- a/ui/aura/display_observer.h
+++ b/ui/aura/display_observer.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_AURA_MONITOR_OBSERVER_H_
-#define UI_AURA_MONITOR_OBSERVER_H_
+#ifndef UI_AURA_DISPLAY_OBSERVER_H_
+#define UI_AURA_DISPLAY_OBSERVER_H_
#pragma once
#include "ui/aura/aura_export.h"
@@ -20,7 +20,7 @@ class AURA_EXPORT DisplayObserver {
// Called when the |display|'s bound has changed.
virtual void OnDisplayBoundsChanged(const gfx::Display& display) = 0;
- // Called when |new_monitor| has been added.
+ // Called when |new_display| has been added.
virtual void OnDisplayAdded(const gfx::Display& new_display) = 0;
// Called when |old_display| has been removed.
@@ -32,4 +32,4 @@ class AURA_EXPORT DisplayObserver {
} // namespace aura
-#endif // UI_AURA_MONITOR_OBSERVER_H_
+#endif // UI_AURA_DISPLAY_OBSERVER_H_
diff --git a/ui/aura/env.cc b/ui/aura/env.cc
index 18aac53..d65a318 100644
--- a/ui/aura/env.cc
+++ b/ui/aura/env.cc
@@ -7,13 +7,13 @@
#include "ui/aura/cursor_manager.h"
#include "ui/aura/env_observer.h"
#include "ui/aura/event_filter.h"
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include "ui/aura/root_window_host.h"
#include "ui/aura/window.h"
#include "ui/compositor/compositor.h"
#if defined(USE_X11)
-#include "ui/aura/monitor_change_observer_x11.h"
+#include "ui/aura/display_change_observer_x11.h"
#endif
namespace aura {
@@ -57,11 +57,11 @@ void Env::RemoveObserver(EnvObserver* observer) {
observers_.RemoveObserver(observer);
}
-void Env::SetMonitorManager(MonitorManager* monitor_manager) {
- monitor_manager_.reset(monitor_manager);
+void Env::SetDisplayManager(DisplayManager* display_manager) {
+ display_manager_.reset(display_manager);
#if defined(USE_X11)
- // Update the monitor manager with latest info.
- monitor_change_observer_->NotifyDisplayChange();
+ // Update the display manager with latest info.
+ display_change_observer_->NotifyDisplayChange();
#endif
}
@@ -83,7 +83,7 @@ void Env::Init() {
dispatcher_.reset(CreateDispatcher());
#endif
#if defined(USE_X11)
- monitor_change_observer_.reset(new internal::MonitorChangeObserverX11);
+ display_change_observer_.reset(new internal::DisplayChangeObserverX11);
#endif
ui::Compositor::Initialize(false);
}
diff --git a/ui/aura/env.h b/ui/aura/env.h
index e8e787d8..bef9483 100644
--- a/ui/aura/env.h
+++ b/ui/aura/env.h
@@ -17,11 +17,11 @@ namespace aura {
class CursorManager;
class EnvObserver;
class EventFilter;
-class MonitorManager;
+class DisplayManager;
class Window;
namespace internal {
-class MonitorChangeObserverX11;
+class DisplayChangeObserverX11;
}
#if !defined(OS_MACOSX)
@@ -56,10 +56,10 @@ class AURA_EXPORT Env {
stacking_client_ = stacking_client;
}
- // Gets/sets MonitorManager. The MonitorManager's ownership is
+ // Gets/sets DisplayManager. The DisplayManager's ownership is
// transfered.
- MonitorManager* monitor_manager() { return monitor_manager_.get(); }
- void SetMonitorManager(MonitorManager* monitor_manager);
+ DisplayManager* display_manager() { return display_manager_.get(); }
+ void SetDisplayManager(DisplayManager* display_manager);
// Env takes ownership of the EventFilter.
EventFilter* event_filter() { return event_filter_.get(); }
@@ -92,12 +92,12 @@ class AURA_EXPORT Env {
int mouse_button_flags_;
bool is_touch_down_;
client::StackingClient* stacking_client_;
- scoped_ptr<MonitorManager> monitor_manager_;
+ scoped_ptr<DisplayManager> display_manager_;
scoped_ptr<EventFilter> event_filter_;
CursorManager cursor_manager_;
#if defined(USE_X11)
- scoped_ptr<internal::MonitorChangeObserverX11> monitor_change_observer_;
+ scoped_ptr<internal::DisplayChangeObserverX11> display_change_observer_;
#endif
DISALLOW_COPY_AND_ASSIGN(Env);
diff --git a/ui/aura/root_window.cc b/ui/aura/root_window.cc
index 6728fa4..85a1247 100644
--- a/ui/aura/root_window.cc
+++ b/ui/aura/root_window.cc
@@ -19,7 +19,7 @@
#include "ui/aura/event.h"
#include "ui/aura/event_filter.h"
#include "ui/aura/focus_manager.h"
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include "ui/aura/root_window_host.h"
#include "ui/aura/root_window_observer.h"
#include "ui/aura/window.h"
@@ -64,9 +64,9 @@ void GetEventFiltersToNotify(Window* target, EventFilters* filters) {
filters->push_back(Env::GetInstance()->event_filter());
}
-float GetDeviceScaleFactorFromMonitor(const aura::Window* window) {
- MonitorManager* monitor_manager = Env::GetInstance()->monitor_manager();
- return monitor_manager->GetDisplayNearestWindow(window).device_scale_factor();
+float GetDeviceScaleFactorFromDisplay(const aura::Window* window) {
+ DisplayManager* display_manager = Env::GetInstance()->display_manager();
+ return display_manager->GetDisplayNearestWindow(window).device_scale_factor();
}
Window* ConsumerToWindow(ui::GestureConsumer* consumer) {
@@ -154,7 +154,7 @@ RootWindow* RootWindow::GetForAcceleratedWidget(
}
void RootWindow::Init() {
- compositor()->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this),
+ compositor()->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this),
host_->GetBounds().size());
Window::Init(ui::LAYER_NOT_DRAWN);
last_mouse_location_ =
@@ -390,8 +390,8 @@ bool RootWindow::DispatchGestureEvent(GestureEvent* event) {
void RootWindow::OnHostResized(const gfx::Size& size_in_pixel) {
DispatchHeldMouseMove();
// The compositor should have the same size as the native root window host.
- // Get the latest scale from monitor because it might have been changed.
- compositor_->SetScaleAndSize(GetDeviceScaleFactorFromMonitor(this),
+ // Get the latest scale from display because it might have been changed.
+ compositor_->SetScaleAndSize(GetDeviceScaleFactorFromDisplay(this),
size_in_pixel);
gfx::Size old(bounds().size());
// The layer, and all the observers should be notified of the
diff --git a/ui/aura/single_monitor_manager.cc b/ui/aura/single_display_manager.cc
index e099341..3ffc80b 100644
--- a/ui/aura/single_monitor_manager.cc
+++ b/ui/aura/single_display_manager.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "ui/aura/single_monitor_manager.h"
+#include "ui/aura/single_display_manager.h"
#include <string>
@@ -18,24 +18,24 @@ namespace aura {
using std::string;
namespace {
-// Default bounds for the primary monitor.
+// Default bounds for the primary display.
const int kDefaultHostWindowX = 200;
const int kDefaultHostWindowY = 200;
const int kDefaultHostWindowWidth = 1280;
const int kDefaultHostWindowHeight = 1024;
} // namespace
-SingleMonitorManager::SingleMonitorManager()
+SingleDisplayManager::SingleDisplayManager()
: root_window_(NULL) {
Init();
}
-SingleMonitorManager::~SingleMonitorManager() {
- // All monitors must have been deleted when monitor manager is deleted.
+SingleDisplayManager::~SingleDisplayManager() {
+ // All displays must have been deleted when display manager is deleted.
CHECK(!root_window_);
}
-void SingleMonitorManager::OnNativeMonitorsChanged(
+void SingleDisplayManager::OnNativeDisplaysChanged(
const std::vector<gfx::Display>& displays) {
DCHECK(displays.size() > 0);
if (use_fullscreen_host_window()) {
@@ -44,7 +44,7 @@ void SingleMonitorManager::OnNativeMonitorsChanged(
}
}
-RootWindow* SingleMonitorManager::CreateRootWindowForMonitor(
+RootWindow* SingleDisplayManager::CreateRootWindowForDisplay(
const gfx::Display& display) {
DCHECK(!root_window_);
DCHECK_EQ(display_.id(), display.id());
@@ -54,25 +54,25 @@ RootWindow* SingleMonitorManager::CreateRootWindowForMonitor(
return root_window_;
}
-const gfx::Display& SingleMonitorManager::GetDisplayAt(size_t index) {
+const gfx::Display& SingleDisplayManager::GetDisplayAt(size_t index) {
return display_;
}
-size_t SingleMonitorManager::GetNumDisplays() const {
+size_t SingleDisplayManager::GetNumDisplays() const {
return 1;
}
-const gfx::Display& SingleMonitorManager::GetDisplayNearestWindow(
+const gfx::Display& SingleDisplayManager::GetDisplayNearestWindow(
const Window* window) const {
return display_;
}
-const gfx::Display& SingleMonitorManager::GetDisplayNearestPoint(
+const gfx::Display& SingleDisplayManager::GetDisplayNearestPoint(
const gfx::Point& point) const {
return display_;
}
-void SingleMonitorManager::OnWindowBoundsChanged(
+void SingleDisplayManager::OnWindowBoundsChanged(
Window* window, const gfx::Rect& old_bounds, const gfx::Rect& new_bounds) {
if (!use_fullscreen_host_window()) {
Update(new_bounds.size());
@@ -80,18 +80,18 @@ void SingleMonitorManager::OnWindowBoundsChanged(
}
}
-void SingleMonitorManager::OnWindowDestroying(Window* window) {
+void SingleDisplayManager::OnWindowDestroying(Window* window) {
if (root_window_ == window)
root_window_ = NULL;
}
-void SingleMonitorManager::Init() {
+void SingleDisplayManager::Init() {
const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kAuraHostWindowSize);
- display_ = CreateMonitorFromSpec(size_str);
+ display_ = CreateDisplayFromSpec(size_str);
}
-void SingleMonitorManager::Update(const gfx::Size size) {
+void SingleDisplayManager::Update(const gfx::Size size) {
display_.SetSize(size);
}
diff --git a/ui/aura/single_monitor_manager.h b/ui/aura/single_display_manager.h
index 46ef34c..d7b8265 100644
--- a/ui/aura/single_monitor_manager.h
+++ b/ui/aura/single_display_manager.h
@@ -2,13 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef UI_AURA_SINGLE_MONITOR_MANAGER_H_
-#define UI_AURA_SINGLE_MONITOR_MANAGER_H_
+#ifndef UI_AURA_SINGLE_DISPLAY_MANAGER_H_
+#define UI_AURA_SINGLE_DISPLAY_MANAGER_H_
#pragma once
#include "base/compiler_specific.h"
#include "ui/aura/aura_export.h"
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include "ui/aura/window_observer.h"
#include "ui/gfx/display.h"
@@ -18,17 +18,17 @@ class Rect;
namespace aura {
-// A monitor manager assuming there is one monitor.
-class AURA_EXPORT SingleMonitorManager : public MonitorManager,
+// A display manager assuming there is one display.
+class AURA_EXPORT SingleDisplayManager : public DisplayManager,
public WindowObserver {
public:
- SingleMonitorManager();
- virtual ~SingleMonitorManager();
+ SingleDisplayManager();
+ virtual ~SingleDisplayManager();
- // MonitorManager overrides:
- virtual void OnNativeMonitorsChanged(
+ // DisplayManager overrides:
+ virtual void OnNativeDisplaysChanged(
const std::vector<gfx::Display>& display) OVERRIDE;
- virtual RootWindow* CreateRootWindowForMonitor(
+ virtual RootWindow* CreateRootWindowForDisplay(
const gfx::Display& display) OVERRIDE;
virtual const gfx::Display& GetDisplayAt(size_t index) OVERRIDE;
@@ -52,9 +52,9 @@ class AURA_EXPORT SingleMonitorManager : public MonitorManager,
RootWindow* root_window_;
gfx::Display display_;
- DISALLOW_COPY_AND_ASSIGN(SingleMonitorManager);
+ DISALLOW_COPY_AND_ASSIGN(SingleDisplayManager);
};
} // namespace aura
-#endif // UI_AURA_SINGLE_MONITOR_MANAGER_H_
+#endif // UI_AURA_SINGLE_DISPLAY_MANAGER_H_
diff --git a/ui/aura/test/aura_test_helper.cc b/ui/aura/test/aura_test_helper.cc
index c8549ba..1dabfd4 100644
--- a/ui/aura/test/aura_test_helper.cc
+++ b/ui/aura/test/aura_test_helper.cc
@@ -8,10 +8,10 @@
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/env.h"
#include "ui/aura/focus_manager.h"
-#include "ui/aura/monitor_manager.h"
+#include "ui/aura/display_manager.h"
#include "ui/aura/root_window.h"
#include "ui/aura/shared/root_window_capture_client.h"
-#include "ui/aura/single_monitor_manager.h"
+#include "ui/aura/single_display_manager.h"
#include "ui/aura/test/test_activation_client.h"
#include "ui/aura/test/test_screen.h"
#include "ui/aura/test/test_stacking_client.h"
@@ -43,8 +43,8 @@ AuraTestHelper::~AuraTestHelper() {
void AuraTestHelper::SetUp() {
setup_called_ = true;
- Env::GetInstance()->SetMonitorManager(new SingleMonitorManager);
- root_window_.reset(aura::MonitorManager::CreateRootWindowForPrimaryMonitor());
+ Env::GetInstance()->SetDisplayManager(new SingleDisplayManager);
+ root_window_.reset(aura::DisplayManager::CreateRootWindowForPrimaryDisplay());
gfx::Screen::SetInstance(new aura::TestScreen(root_window_.get()));
ui_controls::InstallUIControlsAura(CreateUIControlsAura(root_window_.get()));
diff --git a/ui/aura/window.cc b/ui/aura/window.cc
index 6a9c3ee0..437b75d 100644
--- a/ui/aura/window.cc
+++ b/ui/aura/window.cc
@@ -233,7 +233,7 @@ bool Window::IsVisible() const {
gfx::Rect Window::GetBoundsInRootWindow() const {
// TODO(beng): There may be a better way to handle this, and the existing code
- // is likely wrong anyway in a multi-monitor world, but this will
+ // is likely wrong anyway in a multi-display world, but this will
// do for now.
if (!GetRootWindow())
return bounds();
diff --git a/ui/aura/window.h b/ui/aura/window.h
index 34a5702..a8c0d72 100644
--- a/ui/aura/window.h
+++ b/ui/aura/window.h
@@ -135,7 +135,7 @@ class AURA_EXPORT Window : public ui::LayerDelegate,
// Returns the window's bounds in screen coordinates. In ash, this is
// effectively screen bounds.
//
- // TODO(oshima): Fix this to return screen's coordinate for multi-monitor
+ // TODO(oshima): Fix this to return screen's coordinate for multi-display
// support.
gfx::Rect GetBoundsInRootWindow() const;