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

Side by Side Diff: chrome/browser/ui/webui/options/chromeos/display_overscan_handler.cc

Issue 2523723002: Update display::Display::kInvalidDisplayID constant. (Closed)
Patch Set: Fix includes. 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
OLDNEW
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/window_tree_host_manager.h" 9 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/shell.h" 10 #include "ash/shell.h"
11 #include "base/bind.h" 11 #include "base/bind.h"
12 #include "base/logging.h" 12 #include "base/logging.h"
13 #include "base/strings/string_number_conversions.h" 13 #include "base/strings/string_number_conversions.h"
14 #include "base/values.h" 14 #include "base/values.h"
15 #include "chrome/browser/chromeos/display/overscan_calibrator.h" 15 #include "chrome/browser/chromeos/display/overscan_calibrator.h"
16 #include "chrome/grit/generated_resources.h" 16 #include "chrome/grit/generated_resources.h"
17 #include "content/public/browser/web_ui.h" 17 #include "content/public/browser/web_ui.h"
18 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
19 #include "ui/display/display.h" 19 #include "ui/display/display.h"
20 #include "ui/display/manager/display_manager.h" 20 #include "ui/display/manager/display_manager.h"
21 #include "ui/display/screen.h" 21 #include "ui/display/screen.h"
22 #include "ui/display/types/display_constants.h"
22 23
23 namespace chromeos { 24 namespace chromeos {
24 namespace options { 25 namespace options {
25 namespace { 26 namespace {
26 27
27 // The value for the orientation of overscan operations. 28 // The value for the orientation of overscan operations.
28 const char kOrientationHorizontal[] = "horizontal"; 29 const char kOrientationHorizontal[] = "horizontal";
29 const char kOrientationVertical[] = "vertical"; 30 const char kOrientationVertical[] = "vertical";
30 31
31 } 32 }
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 return; 97 return;
97 98
98 web_ui()->CallJavascriptFunctionUnsafe( 99 web_ui()->CallJavascriptFunctionUnsafe(
99 "options.DisplayOverscan.onOverscanCanceled"); 100 "options.DisplayOverscan.onOverscanCanceled");
100 } 101 }
101 102
102 void DisplayOverscanHandler::OnDisplayMetricsChanged(const display::Display&, 103 void DisplayOverscanHandler::OnDisplayMetricsChanged(const display::Display&,
103 uint32_t) {} 104 uint32_t) {}
104 105
105 void DisplayOverscanHandler::HandleStart(const base::ListValue* args) { 106 void DisplayOverscanHandler::HandleStart(const base::ListValue* args) {
106 int64_t display_id = display::Display::kInvalidDisplayID; 107 int64_t display_id = display::kInvalidDisplayId;
107 std::string id_value; 108 std::string id_value;
108 if (!args->GetString(0, &id_value)) { 109 if (!args->GetString(0, &id_value)) {
109 LOG(ERROR) << "Can't find ID"; 110 LOG(ERROR) << "Can't find ID";
110 return; 111 return;
111 } 112 }
112 113
113 if (!base::StringToInt64(id_value, &display_id) || 114 if (!base::StringToInt64(id_value, &display_id) ||
114 display_id == display::Display::kInvalidDisplayID) { 115 display_id == display::kInvalidDisplayId) {
115 LOG(ERROR) << "Invalid parameter: " << id_value; 116 LOG(ERROR) << "Invalid parameter: " << id_value;
116 return; 117 return;
117 } 118 }
118 119
119 const display::Display& display = 120 const display::Display& display =
120 ash::Shell::GetInstance()->display_manager()->GetDisplayForId(display_id); 121 ash::Shell::GetInstance()->display_manager()->GetDisplayForId(display_id);
121 DCHECK(display.is_valid()); 122 DCHECK(display.is_valid());
122 if (!display.is_valid()) 123 if (!display.is_valid())
123 return; 124 return;
124 125
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
201 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal 202 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal
202 << "' or '" << kOrientationVertical << "': " 203 << "' or '" << kOrientationVertical << "': "
203 << orientation; 204 << orientation;
204 return; 205 return;
205 } 206 }
206 overscan_calibrator_->UpdateInsets(insets); 207 overscan_calibrator_->UpdateInsets(insets);
207 } 208 }
208 209
209 } // namespace options 210 } // namespace options
210 } // namespace chromeos 211 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/options/chromeos/display_options_handler.cc ('k') | services/ui/display/platform_screen_ozone.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698