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

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

Issue 2490323003: Improve monitor compatibility error, move feedback link into button (Closed)
Patch Set: Rename variable |optional_field| -> |data| Created 4 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
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | ash/display/display_error_observer_chromeos.cc » ('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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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_configuration_controller.h" 5 #include "ash/display/display_configuration_controller.h"
6 6
7 #include "ash/display/display_animator.h" 7 #include "ash/display/display_animator.h"
8 #include "ash/display/display_util.h" 8 #include "ash/display/display_util.h"
9 #include "ash/rotator/screen_rotation_animator.h" 9 #include "ash/rotator/screen_rotation_animator.h"
10 #include "base/time/time.h" 10 #include "base/time/time.h"
11 #include "ui/display/display_layout.h" 11 #include "ui/display/display_layout.h"
12 #include "ui/display/manager/display_manager.h" 12 #include "ui/display/manager/display_manager.h"
13 13
14 #if defined(OS_CHROMEOS) 14 #if defined(OS_CHROMEOS)
15 #include "ash/display/display_animator_chromeos.h" 15 #include "ash/display/display_animator_chromeos.h"
16 #include "base/sys_info.h" 16 #include "base/sys_info.h"
17 #include "grit/ash_strings.h" 17 #include "grit/ash_strings.h"
18 #include "ui/base/l10n/l10n_util.h"
18 #endif 19 #endif
19 20
20 namespace { 21 namespace {
21 22
22 // Specifies how long the display change should have been disabled 23 // Specifies how long the display change should have been disabled
23 // after each display change operations. 24 // after each display change operations.
24 // |kCycleDisplayThrottleTimeoutMs| is set to be longer to avoid 25 // |kCycleDisplayThrottleTimeoutMs| is set to be longer to avoid
25 // changing the settings while the system is still configurating 26 // changing the settings while the system is still configurating
26 // displays. It will be overriden by |kAfterDisplayChangeThrottleTimeoutMs| 27 // displays. It will be overriden by |kAfterDisplayChangeThrottleTimeoutMs|
27 // when the display change happens, so the actual timeout is much shorter. 28 // when the display change happens, so the actual timeout is much shorter.
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 weak_ptr_factory_.GetWeakPtr(), base::Passed(&layout))); 78 weak_ptr_factory_.GetWeakPtr(), base::Passed(&layout)));
78 } else { 79 } else {
79 SetDisplayLayoutImpl(std::move(layout)); 80 SetDisplayLayoutImpl(std::move(layout));
80 } 81 }
81 } 82 }
82 83
83 void DisplayConfigurationController::SetMirrorMode(bool mirror, 84 void DisplayConfigurationController::SetMirrorMode(bool mirror,
84 bool user_action) { 85 bool user_action) {
85 if (display_manager_->num_connected_displays() > 2) { 86 if (display_manager_->num_connected_displays() > 2) {
86 #if defined(OS_CHROMEOS) 87 #if defined(OS_CHROMEOS)
87 if (user_action) 88 if (user_action) {
88 ShowDisplayErrorNotification(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED); 89 ShowDisplayErrorNotification(
90 l10n_util::GetStringUTF16(IDS_ASH_DISPLAY_MIRRORING_NOT_SUPPORTED),
91 false);
92 }
89 #endif 93 #endif
90 return; 94 return;
91 } 95 }
92 if (display_manager_->num_connected_displays() <= 1 || 96 if (display_manager_->num_connected_displays() <= 1 ||
93 display_manager_->IsInMirrorMode() == mirror || IsLimited()) { 97 display_manager_->IsInMirrorMode() == mirror || IsLimited()) {
94 return; 98 return;
95 } 99 }
96 SetThrottleTimeout(kCycleDisplayThrottleTimeoutMs); 100 SetThrottleTimeout(kCycleDisplayThrottleTimeoutMs);
97 if (user_action && display_animator_) { 101 if (user_action && display_animator_) {
98 display_animator_->StartFadeOutAnimation( 102 display_animator_->StartFadeOutAnimation(
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
169 } 173 }
170 174
171 void DisplayConfigurationController::SetPrimaryDisplayIdImpl( 175 void DisplayConfigurationController::SetPrimaryDisplayIdImpl(
172 int64_t display_id) { 176 int64_t display_id) {
173 window_tree_host_manager_->SetPrimaryDisplayId(display_id); 177 window_tree_host_manager_->SetPrimaryDisplayId(display_id);
174 if (display_animator_) 178 if (display_animator_)
175 display_animator_->StartFadeInAnimation(); 179 display_animator_->StartFadeInAnimation();
176 } 180 }
177 181
178 } // namespace ash 182 } // namespace ash
OLDNEW
« no previous file with comments | « ash/ash_chromeos_strings.grdp ('k') | ash/display/display_error_observer_chromeos.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698