Index: ash/display/display_manager.cc |
diff --git a/ash/display/display_manager.cc b/ash/display/display_manager.cc |
index 8fa1223867a78a62031c2c30a8f23a2adb090c63..97d9d71c92ac29a9ed1c386bae1ff5363770a375 100644 |
--- a/ash/display/display_manager.cc |
+++ b/ash/display/display_manager.cc |
@@ -98,7 +98,6 @@ DEFINE_WINDOW_PROPERTY_KEY(int64, kDisplayIdKey, |
gfx::Display::kInvalidDisplayID); |
DisplayManager::DisplayManager() : |
- internal_display_id_(gfx::Display::kInvalidDisplayID), |
force_bounds_changed_(false) { |
Init(); |
} |
@@ -126,11 +125,11 @@ bool DisplayManager::IsActiveDisplay(const gfx::Display& display) const { |
} |
bool DisplayManager::HasInternalDisplay() const { |
- return internal_display_id_ != gfx::Display::kInvalidDisplayID; |
+ return gfx::Display::InternalDisplayId() != gfx::Display::kInvalidDisplayID; |
} |
bool DisplayManager::IsInternalDisplayId(int64 id) const { |
- return internal_display_id_ == id; |
+ return gfx::Display::InternalDisplayId() == id; |
} |
bool DisplayManager::UpdateWorkAreaOfDisplayNearestWindow( |
@@ -192,11 +191,11 @@ void DisplayManager::OnNativeDisplaysChanged( |
return; |
} |
DisplayList new_displays = updated_displays; |
- if (internal_display_id_ != gfx::Display::kInvalidDisplayID) { |
+ if (HasInternalDisplay()) { |
bool internal_display_connected = false; |
for (DisplayList::const_iterator iter = updated_displays.begin(); |
iter != updated_displays.end(); ++iter) { |
- if ((*iter).id() == internal_display_id_) { |
+ if ((*iter).IsInternal()) { |
internal_display_connected = true; |
// Update the internal display cache. |
internal_display_.reset(new gfx::Display); |
@@ -208,8 +207,9 @@ void DisplayManager::OnNativeDisplaysChanged( |
if (!internal_display_connected) { |
// Internal display may be reported as disconnect during startup time. |
if (!internal_display_.get()) { |
- internal_display_.reset(new gfx::Display(internal_display_id_, |
- gfx::Rect(800, 600))); |
+ internal_display_.reset( |
+ new gfx::Display(gfx::Display::InternalDisplayId(), |
+ gfx::Rect(800, 600))); |
} |
new_displays.push_back(*internal_display_.get()); |
} |
@@ -452,7 +452,8 @@ void DisplayManager::Init() { |
for (size_t i = 0; i < output_names.size(); ++i) { |
if (chromeos::OutputConfigurator::IsInternalOutputName( |
output_names[i])) { |
- internal_display_id_ = GetDisplayIdForOutput(outputs[i], i); |
+ gfx::Display::SetInternalDisplayId( |
+ GetDisplayIdForOutput(outputs[i], i)); |
break; |
} |
} |
@@ -537,10 +538,10 @@ void DisplayManager::AddDisplayFromSpec(const std::string& spec) { |
} |
int64 DisplayManager::SetFirstDisplayAsInternalDisplayForTest() { |
- internal_display_id_ = displays_[0].id(); |
+ gfx::Display::SetInternalDisplayId(displays_[0].id()); |
internal_display_.reset(new gfx::Display); |
*internal_display_ = displays_[0]; |
- return internal_display_id_; |
+ return gfx::Display::InternalDisplayId(); |
} |
void DisplayManager::EnsurePointerInDisplays() { |