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

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

Issue 1456623002: Add support for virtual displays (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address oshima@ feedback Created 5 years 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 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 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
211 if (size_in_vec.LengthSquared() > k2xThreshouldSizeSquaredFor4KInMm && 211 if (size_in_vec.LengthSquared() > k2xThreshouldSizeSquaredFor4KInMm &&
212 mode_info->size().width() >= kMinimumWidthFor4K) { 212 mode_info->size().width() >= kMinimumWidthFor4K) {
213 // Make sure that additional device scale factors table has 2x. 213 // Make sure that additional device scale factors table has 2x.
214 DCHECK_EQ(2.0f, kAdditionalDeviceScaleFactorsFor4k[1]); 214 DCHECK_EQ(2.0f, kAdditionalDeviceScaleFactorsFor4k[1]);
215 device_scale_factor = 2.0f; 215 device_scale_factor = 2.0f;
216 } 216 }
217 } 217 }
218 } 218 }
219 gfx::Rect display_bounds(state->origin(), mode_info->size()); 219 gfx::Rect display_bounds(state->origin(), mode_info->size());
220 220
221 std::string name = 221 std::string name;
222 state->type() == ui::DISPLAY_CONNECTION_TYPE_INTERNAL 222 switch (state->type()) {
223 ? l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME) 223 case ui::DISPLAY_CONNECTION_TYPE_INTERNAL:
224 : state->display_name(); 224 name = l10n_util::GetStringUTF8(IDS_ASH_INTERNAL_DISPLAY_NAME);
225 break;
226 case ui::DISPLAY_CONNECTION_TYPE_VIRTUAL:
227 name = l10n_util::GetStringUTF8(IDS_ASH_VIRTUAL_DISPLAY_NAME);
228 break;
229 default:
230 name = state->display_name();
231 }
232
225 if (name.empty()) 233 if (name.empty())
226 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME); 234 name = l10n_util::GetStringUTF8(IDS_ASH_STATUS_TRAY_UNKNOWN_DISPLAY_NAME);
227 235
228 bool has_overscan = state->has_overscan(); 236 bool has_overscan = state->has_overscan();
229 int64 id = state->display_id(); 237 int64 id = state->display_id();
230 ids.insert(id); 238 ids.insert(id);
231 239
232 displays.push_back(DisplayInfo(id, name, has_overscan)); 240 displays.push_back(DisplayInfo(id, name, has_overscan));
233 DisplayInfo& new_info = displays.back(); 241 DisplayInfo& new_info = displays.back();
234 new_info.set_device_scale_factor(device_scale_factor); 242 new_info.set_device_scale_factor(device_scale_factor);
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
290 } 298 }
291 return 1.0f; 299 return 1.0f;
292 } 300 }
293 301
294 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() { 302 void DisplayChangeObserver::OnTouchscreenDeviceConfigurationChanged() {
295 OnDisplayModeChanged( 303 OnDisplayModeChanged(
296 Shell::GetInstance()->display_configurator()->cached_displays()); 304 Shell::GetInstance()->display_configurator()->cached_displays());
297 } 305 }
298 306
299 } // namespace ash 307 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_strings.grd ('k') | chrome/app/generated_resources.grd » ('j') | ui/display/DEPS » ('J')

Powered by Google App Engine
This is Rietveld 408576698