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

Side by Side Diff: ash/display/display_change_observer_chromeos.cc

Issue 615133002: Add support for a virtual display on ChromeOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Remove ash/ dep from content Created 5 years, 9 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
« no previous file with comments | « ash/ash_strings.grd ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/display/display_change_observer_chromeos.h" 5 #include "ash/display/display_change_observer_chromeos.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <map> 8 #include <map>
9 #include <set> 9 #include <set>
10 #include <string> 10 #include <string>
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
204 } 204 }
205 } else { 205 } else {
206 DisplayMode mode; 206 DisplayMode mode;
207 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId( 207 if (Shell::GetInstance()->display_manager()->GetSelectedModeForDisplayId(
208 state.display->display_id(), &mode)) { 208 state.display->display_id(), &mode)) {
209 device_scale_factor = mode.device_scale_factor; 209 device_scale_factor = mode.device_scale_factor;
210 } 210 }
211 } 211 }
212 gfx::Rect display_bounds(state.display->origin(), mode_info->size()); 212 gfx::Rect display_bounds(state.display->origin(), mode_info->size());
213 213
214 std::string name = 214 std::string name;
215 state.display->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL ? 215 switch (state.display->type()) {
216 l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME) : 216 case ui::DISPLAY_CONNECTION_TYPE_INTERNAL:
217 state.display->display_name(); 217 name = l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME);
218 break;
219 case ui::DISPLAY_CONNECTION_TYPE_VIRTUAL:
220 name = l10n_util::GetStringUTF8(IDS_ASH_VIRTUAL_DISPLAY_NAME);
221 break;
222 default:
223 name = state.display->display_name();
224 }
225
218 if (name.empty()) 226 if (name.empty())
219 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); 227 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME);
220 228
221 bool has_overscan = state.display->has_overscan(); 229 bool has_overscan = state.display->has_overscan();
222 int64 id = state.display->display_id(); 230 int64 id = state.display->display_id();
223 ids.insert(id); 231 ids.insert(id);
224 232
225 displays.push_back(DisplayInfo(id, name, has_overscan)); 233 displays.push_back(DisplayInfo(id, name, has_overscan));
226 DisplayInfo& new_info = displays.back(); 234 DisplayInfo& new_info = displays.back();
227 new_info.set_device_scale_factor(device_scale_factor); 235 new_info.set_device_scale_factor(device_scale_factor);
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
281 } 289 }
282 return 1.0f; 290 return 1.0f;
283 } 291 }
284 292
285 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { 293 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() {
286 OnDisplayModeChanged( 294 OnDisplayModeChanged(
287 Shell::GetInstance()->display_configurator()->cached_displays()); 295 Shell::GetInstance()->display_configurator()->cached_displays());
288 } 296 }
289 297
290 } // namespace ash 298 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | chrome/app/generated_resources.grd » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698