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

Side by Side Diff: ash/system/chromeos/tray_display.cc

Issue 12217120: Add IsInternal property to gfx::Display (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: 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 unified diff | Download patch
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 "ash/system/chromeos/tray_display.h" 5 #include "ash/system/chromeos/tray_display.h"
6 6
7 #include "ash/display/display_controller.h" 7 #include "ash/display/display_controller.h"
8 #include "ash/display/display_manager.h" 8 #include "ash/display/display_manager.h"
9 #include "ash/screen_ash.h" 9 #include "ash/screen_ash.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 default: 79 default:
80 NOTREACHED(); 80 NOTREACHED();
81 } 81 }
82 } 82 }
83 83
84 private: 84 private:
85 // Returns the name of the currently connected external display. 85 // Returns the name of the currently connected external display.
86 string16 GetExternalDisplayName() { 86 string16 GetExternalDisplayName() {
87 #if defined(USE_X11) 87 #if defined(USE_X11)
88 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); 88 DisplayManager* display_manager = Shell::GetInstance()->display_manager();
89 int64 internal_display_id = display_manager->internal_display_id(); 89 int64 internal_display_id = gfx::Display::internal_display_id();
90 int64 primary_display_id = 90 int64 primary_display_id =
91 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().id(); 91 gfx::Screen::GetNativeScreen()->GetPrimaryDisplay().id();
92 92
93 // Use xrandr features rather than DisplayManager to find out the external 93 // Use xrandr features rather than DisplayManager to find out the external
94 // display's name. DisplayManager's API doesn't work well in mirroring mode 94 // display's name. DisplayManager's API doesn't work well in mirroring mode
95 // since it's based on gfx::Display but in mirroring mode there's only one 95 // since it's based on gfx::Display but in mirroring mode there's only one
96 // gfx::Display instance which represents both displays. 96 // gfx::Display instance which represents both displays.
97 std::vector<XID> outputs; 97 std::vector<XID> outputs;
98 ui::GetOutputDeviceHandles(&outputs); 98 ui::GetOutputDeviceHandles(&outputs);
99 for (size_t i = 0; i < outputs.size(); ++i) { 99 for (size_t i = 0; i < outputs.size(); ++i) {
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 default_->Update(); 183 default_->Update();
184 } 184 }
185 185
186 void TrayDisplay::OnDisplayModeChanged() { 186 void TrayDisplay::OnDisplayModeChanged() {
187 if (default_) 187 if (default_)
188 default_->Update(); 188 default_->Update();
189 } 189 }
190 190
191 } // namespace internal 191 } // namespace internal
192 } // namespace ash 192 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698