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

Unified Diff: ash/display/display_manager.cc

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Get rid of static initializer Created 7 years, 10 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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() {
« no previous file with comments | « ash/display/display_manager.h ('k') | ash/display/event_transformation_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698