summaryrefslogtreecommitdiffstats
path: root/ash/display/display_controller.cc
diff options
context:
space:
mode:
Diffstat (limited to 'ash/display/display_controller.cc')
-rw-r--r--ash/display/display_controller.cc30
1 files changed, 13 insertions, 17 deletions
diff --git a/ash/display/display_controller.cc b/ash/display/display_controller.cc
index f0ac711..7475379 100644
--- a/ash/display/display_controller.cc
+++ b/ash/display/display_controller.cc
@@ -15,12 +15,11 @@
#include "ash/display/root_window_transformers.h"
#include "ash/host/root_window_host_factory.h"
#include "ash/root_window_controller.h"
+#include "ash/root_window_settings.h"
#include "ash/screen_ash.h"
#include "ash/shell.h"
#include "ash/wm/coordinate_conversion.h"
#include "ash/wm/property_util.h"
-#include "ash/wm/window_properties.h"
-#include "ash/wm/window_util.h"
#include "base/command_line.h"
#include "base/strings/stringprintf.h"
#include "third_party/skia/include/utils/SkMatrix44.h"
@@ -54,8 +53,6 @@
#endif // defined(USE_X11)
#endif // defined(OS_CHROMEOS)
-DECLARE_WINDOW_PROPERTY_TYPE(int64);
-
namespace ash {
namespace {
@@ -133,9 +130,6 @@ void SetDisplayPropertiesOnHostWindow(aura::RootWindow* root,
namespace internal {
-DEFINE_WINDOW_PROPERTY_KEY(int64, kDisplayIdKey,
- gfx::Display::kInvalidDisplayID);
-
// A utility class to store/restore focused/active window
// when the display configuration has changed.
class FocusActivationStore {
@@ -492,11 +486,12 @@ void DisplayController::SetPrimaryDisplay(
DCHECK_NE(primary_root, non_primary_root);
root_windows_[new_primary_display.id()] = primary_root;
- primary_root->SetProperty(internal::kDisplayIdKey, new_primary_display.id());
+ internal::GetRootWindowSettings(primary_root)->display_id =
+ new_primary_display.id();
root_windows_[old_primary_display.id()] = non_primary_root;
- non_primary_root->SetProperty(internal::kDisplayIdKey,
- old_primary_display.id());
+ internal::GetRootWindowSettings(non_primary_root)->display_id =
+ old_primary_display.id();
primary_display_id = new_primary_display.id();
GetDisplayManager()->layout_store()->UpdatePrimaryDisplayId(
@@ -568,7 +563,7 @@ bool DisplayController::UpdateWorkAreaOfDisplayNearestWindow(
const aura::Window* window,
const gfx::Insets& insets) {
const aura::RootWindow* root_window = window->GetRootWindow();
- int64 id = root_window->GetProperty(internal::kDisplayIdKey);
+ int64 id = internal::GetRootWindowSettings(root_window)->display_id;
// if id is |kInvaildDisplayID|, it's being deleted.
DCHECK(id != gfx::Display::kInvalidDisplayID);
return GetDisplayManager()->UpdateWorkAreaOfDisplay(id, insets);
@@ -581,7 +576,7 @@ const gfx::Display& DisplayController::GetDisplayNearestWindow(
const aura::RootWindow* root_window = window->GetRootWindow();
if (!root_window)
return GetPrimaryDisplay();
- int64 id = root_window->GetProperty(internal::kDisplayIdKey);
+ int64 id = internal::GetRootWindowSettings(root_window)->display_id;
// if id is |kInvaildDisplayID|, it's being deleted.
DCHECK(id != gfx::Display::kInvalidDisplayID);
@@ -638,8 +633,8 @@ void DisplayController::OnDisplayAdded(const gfx::Display& display) {
DCHECK(root_windows_.empty());
primary_display_id = display.id();
root_windows_[display.id()] = primary_root_window_for_replace_;
- primary_root_window_for_replace_->SetProperty(
- internal::kDisplayIdKey, display.id());
+ internal::GetRootWindowSettings(primary_root_window_for_replace_)->
+ display_id = display.id();
primary_root_window_for_replace_ = NULL;
const internal::DisplayInfo& display_info =
GetDisplayManager()->GetDisplayInfo(display.id());
@@ -678,11 +673,12 @@ void DisplayController::OnDisplayRemoved(const gfx::Display& display) {
// Delete the other root instead.
root_to_delete = root_windows_[primary_display_id];
- root_to_delete->SetProperty(internal::kDisplayIdKey, display.id());
+ internal::GetRootWindowSettings(root_to_delete)->display_id = display.id();
// Setup primary root.
root_windows_[primary_display_id] = primary_root;
- primary_root->SetProperty(internal::kDisplayIdKey, primary_display_id);
+ internal::GetRootWindowSettings(primary_root)->display_id =
+ primary_display_id;
OnDisplayBoundsChanged(
GetDisplayManager()->GetDisplayForId(primary_display_id));
@@ -778,7 +774,7 @@ aura::RootWindow* DisplayController::AddRootWindowForDisplay(
// No need to remove RootWindowObserver because
// the DisplayController object outlives RootWindow objects.
root_window->AddRootWindowObserver(this);
- root_window->SetProperty(internal::kDisplayIdKey, display.id());
+ internal::InitRootWindowSettings(root_window)->display_id = display.id();
root_window->Init();
root_windows_[display.id()] = root_window;