OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "chrome/browser/ui/webui/options/chromeos/display_overscan_handler.h" | 5 #include "chrome/browser/ui/webui/options/chromeos/display_overscan_handler.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "ash/display/display_controller.h" | 9 #include "ash/display/display_controller.h" |
10 #include "ash/screen_ash.h" | 10 #include "ash/screen_util.h" |
11 #include "ash/shell.h" | 11 #include "ash/shell.h" |
12 #include "base/bind.h" | 12 #include "base/bind.h" |
13 #include "base/logging.h" | 13 #include "base/logging.h" |
14 #include "base/strings/string_number_conversions.h" | 14 #include "base/strings/string_number_conversions.h" |
15 #include "base/values.h" | 15 #include "base/values.h" |
16 #include "chrome/browser/chromeos/display/overscan_calibrator.h" | 16 #include "chrome/browser/chromeos/display/overscan_calibrator.h" |
17 #include "content/public/browser/web_ui.h" | 17 #include "content/public/browser/web_ui.h" |
18 #include "grit/generated_resources.h" | 18 #include "grit/generated_resources.h" |
19 #include "ui/base/l10n/l10n_util.h" | 19 #include "ui/base/l10n/l10n_util.h" |
20 #include "ui/gfx/display.h" | 20 #include "ui/gfx/display.h" |
| 21 #include "ui/gfx/screen.h" |
21 | 22 |
22 namespace chromeos { | 23 namespace chromeos { |
23 namespace options { | 24 namespace options { |
24 namespace { | 25 namespace { |
25 | 26 |
26 // The value for the orientation of overscan operations. | 27 // The value for the orientation of overscan operations. |
27 const char kOrientationHorizontal[] = "horizontal"; | 28 const char kOrientationHorizontal[] = "horizontal"; |
28 const char kOrientationVertical[] = "vertical"; | 29 const char kOrientationVertical[] = "vertical"; |
29 | 30 |
30 } | 31 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 LOG(ERROR) << "Can't find ID"; | 102 LOG(ERROR) << "Can't find ID"; |
102 return; | 103 return; |
103 } | 104 } |
104 | 105 |
105 if (!base::StringToInt64(id_value, &display_id) || | 106 if (!base::StringToInt64(id_value, &display_id) || |
106 display_id == gfx::Display::kInvalidDisplayID) { | 107 display_id == gfx::Display::kInvalidDisplayID) { |
107 LOG(ERROR) << "Invalid parameter: " << id_value; | 108 LOG(ERROR) << "Invalid parameter: " << id_value; |
108 return; | 109 return; |
109 } | 110 } |
110 | 111 |
111 const gfx::Display& display = ash::ScreenAsh::GetDisplayForId(display_id); | 112 const gfx::Display& display = ash::ScreenUtil::GetDisplayForId(display_id); |
112 DCHECK(display.is_valid()); | 113 DCHECK(display.is_valid()); |
113 if (!display.is_valid()) | 114 if (!display.is_valid()) |
114 return; | 115 return; |
115 | 116 |
116 ash::DisplayController* display_controller = | 117 ash::DisplayController* display_controller = |
117 ash::Shell::GetInstance()->display_controller(); | 118 ash::Shell::GetInstance()->display_controller(); |
118 overscan_calibrator_.reset(new OverscanCalibrator( | 119 overscan_calibrator_.reset(new OverscanCalibrator( |
119 display, | 120 display, |
120 display_controller->GetOverscanInsets(display_id))); | 121 display_controller->GetOverscanInsets(display_id))); |
121 } | 122 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
193 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal | 194 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal |
194 << "' or '" << kOrientationVertical << "': " | 195 << "' or '" << kOrientationVertical << "': " |
195 << orientation; | 196 << orientation; |
196 return; | 197 return; |
197 } | 198 } |
198 overscan_calibrator_->UpdateInsets(insets); | 199 overscan_calibrator_->UpdateInsets(insets); |
199 } | 200 } |
200 | 201 |
201 } // namespace options | 202 } // namespace options |
202 } // namespace chromeos | 203 } // namespace chromeos |
OLD | NEW |