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_util.h" | 10 #include "ash/display/display_manager.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 "chrome/grit/generated_resources.h" | 17 #include "chrome/grit/generated_resources.h" |
18 #include "content/public/browser/web_ui.h" | 18 #include "content/public/browser/web_ui.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" |
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 LOG(ERROR) << "Can't find ID"; | 108 LOG(ERROR) << "Can't find ID"; |
109 return; | 109 return; |
110 } | 110 } |
111 | 111 |
112 if (!base::StringToInt64(id_value, &display_id) || | 112 if (!base::StringToInt64(id_value, &display_id) || |
113 display_id == gfx::Display::kInvalidDisplayID) { | 113 display_id == gfx::Display::kInvalidDisplayID) { |
114 LOG(ERROR) << "Invalid parameter: " << id_value; | 114 LOG(ERROR) << "Invalid parameter: " << id_value; |
115 return; | 115 return; |
116 } | 116 } |
117 | 117 |
118 const gfx::Display& display = ash::ScreenUtil::GetDisplayForId(display_id); | 118 const gfx::Display& display = |
| 119 ash::Shell::GetInstance()->display_manager()->GetDisplayForId(display_id); |
119 DCHECK(display.is_valid()); | 120 DCHECK(display.is_valid()); |
120 if (!display.is_valid()) | 121 if (!display.is_valid()) |
121 return; | 122 return; |
122 | 123 |
123 ash::DisplayController* display_controller = | 124 ash::DisplayController* display_controller = |
124 ash::Shell::GetInstance()->display_controller(); | 125 ash::Shell::GetInstance()->display_controller(); |
125 overscan_calibrator_.reset(new OverscanCalibrator( | 126 overscan_calibrator_.reset(new OverscanCalibrator( |
126 display, | 127 display, |
127 display_controller->GetOverscanInsets(display_id))); | 128 display_controller->GetOverscanInsets(display_id))); |
128 } | 129 } |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
200 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal | 201 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal |
201 << "' or '" << kOrientationVertical << "': " | 202 << "' or '" << kOrientationVertical << "': " |
202 << orientation; | 203 << orientation; |
203 return; | 204 return; |
204 } | 205 } |
205 overscan_calibrator_->UpdateInsets(insets); | 206 overscan_calibrator_->UpdateInsets(insets); |
206 } | 207 } |
207 | 208 |
208 } // namespace options | 209 } // namespace options |
209 } // namespace chromeos | 210 } // namespace chromeos |
OLD | NEW |