OLD | NEW |
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/resolution_notification_controller.h" | 5 #include "ash/display/resolution_notification_controller.h" |
6 | 6 |
7 #include <utility> | 7 #include <utility> |
8 | 8 |
9 #include "ash/common/system/system_notifier.h" | 9 #include "ash/common/system/system_notifier.h" |
10 #include "ash/display/display_manager.h" | |
11 #include "ash/shell.h" | 10 #include "ash/shell.h" |
12 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
13 #include "grit/ash_resources.h" | 12 #include "grit/ash_resources.h" |
14 #include "grit/ash_strings.h" | 13 #include "grit/ash_strings.h" |
15 #include "ui/base/l10n/l10n_util.h" | 14 #include "ui/base/l10n/l10n_util.h" |
16 #include "ui/base/l10n/time_format.h" | 15 #include "ui/base/l10n/time_format.h" |
17 #include "ui/base/resource/resource_bundle.h" | 16 #include "ui/base/resource/resource_bundle.h" |
18 #include "ui/display/display.h" | 17 #include "ui/display/display.h" |
| 18 #include "ui/display/manager/display_manager.h" |
19 #include "ui/display/manager/managed_display_info.h" | 19 #include "ui/display/manager/managed_display_info.h" |
20 #include "ui/display/screen.h" | 20 #include "ui/display/screen.h" |
21 #include "ui/message_center/message_center.h" | 21 #include "ui/message_center/message_center.h" |
22 #include "ui/message_center/notification.h" | 22 #include "ui/message_center/notification.h" |
23 #include "ui/message_center/notification_delegate.h" | 23 #include "ui/message_center/notification_delegate.h" |
24 | 24 |
25 using message_center::Notification; | 25 using message_center::Notification; |
26 | 26 |
27 namespace ash { | 27 namespace ash { |
28 namespace { | 28 namespace { |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
131 ResolutionNotificationController::ResolutionChangeInfo::ResolutionChangeInfo( | 131 ResolutionNotificationController::ResolutionChangeInfo::ResolutionChangeInfo( |
132 int64_t display_id, | 132 int64_t display_id, |
133 const scoped_refptr<display::ManagedDisplayMode>& old_resolution, | 133 const scoped_refptr<display::ManagedDisplayMode>& old_resolution, |
134 const scoped_refptr<display::ManagedDisplayMode>& new_resolution, | 134 const scoped_refptr<display::ManagedDisplayMode>& new_resolution, |
135 const base::Closure& accept_callback) | 135 const base::Closure& accept_callback) |
136 : display_id(display_id), | 136 : display_id(display_id), |
137 old_resolution(old_resolution), | 137 old_resolution(old_resolution), |
138 new_resolution(new_resolution), | 138 new_resolution(new_resolution), |
139 accept_callback(accept_callback), | 139 accept_callback(accept_callback), |
140 timeout_count(0) { | 140 timeout_count(0) { |
141 DisplayManager* display_manager = Shell::GetInstance()->display_manager(); | 141 display::DisplayManager* display_manager = |
| 142 Shell::GetInstance()->display_manager(); |
142 if (!display::Display::HasInternalDisplay() && | 143 if (!display::Display::HasInternalDisplay() && |
143 display_manager->num_connected_displays() == 1u) { | 144 display_manager->num_connected_displays() == 1u) { |
144 timeout_count = kTimeoutInSec; | 145 timeout_count = kTimeoutInSec; |
145 } | 146 } |
146 } | 147 } |
147 | 148 |
148 ResolutionNotificationController::ResolutionChangeInfo:: | 149 ResolutionNotificationController::ResolutionChangeInfo:: |
149 ~ResolutionChangeInfo() { | 150 ~ResolutionChangeInfo() { |
150 old_resolution = nullptr; | 151 old_resolution = nullptr; |
151 new_resolution = nullptr; | 152 new_resolution = nullptr; |
(...skipping 157 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
309 change_info_->timer.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this, | 310 change_info_->timer.Start(FROM_HERE, base::TimeDelta::FromSeconds(1), this, |
310 &ResolutionNotificationController::OnTimerTick); | 311 &ResolutionNotificationController::OnTimerTick); |
311 } | 312 } |
312 } | 313 } |
313 | 314 |
314 void ResolutionNotificationController::SuppressTimerForTest() { | 315 void ResolutionNotificationController::SuppressTimerForTest() { |
315 g_use_timer = false; | 316 g_use_timer = false; |
316 } | 317 } |
317 | 318 |
318 } // namespace ash | 319 } // namespace ash |
OLD | NEW |