| 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/screen_util.h" |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 web_ui()->RegisterMessageCallback( | 74 web_ui()->RegisterMessageCallback( |
| 75 "move", | 75 "move", |
| 76 base::Bind(&DisplayOverscanHandler::HandleMove, | 76 base::Bind(&DisplayOverscanHandler::HandleMove, |
| 77 base::Unretained(this))); | 77 base::Unretained(this))); |
| 78 web_ui()->RegisterMessageCallback( | 78 web_ui()->RegisterMessageCallback( |
| 79 "resize", | 79 "resize", |
| 80 base::Bind(&DisplayOverscanHandler::HandleResize, | 80 base::Bind(&DisplayOverscanHandler::HandleResize, |
| 81 base::Unretained(this))); | 81 base::Unretained(this))); |
| 82 } | 82 } |
| 83 | 83 |
| 84 void DisplayOverscanHandler::OnDisplayBoundsChanged( | |
| 85 const gfx::Display& display) { | |
| 86 } | |
| 87 | |
| 88 void DisplayOverscanHandler::OnDisplayAdded(const gfx::Display& new_display) { | 84 void DisplayOverscanHandler::OnDisplayAdded(const gfx::Display& new_display) { |
| 89 web_ui()->CallJavascriptFunction( | 85 web_ui()->CallJavascriptFunction( |
| 90 "options.DisplayOverscan.onOverscanCanceled"); | 86 "options.DisplayOverscan.onOverscanCanceled"); |
| 91 } | 87 } |
| 92 | 88 |
| 93 void DisplayOverscanHandler::OnDisplayRemoved(const gfx::Display& old_display) { | 89 void DisplayOverscanHandler::OnDisplayRemoved(const gfx::Display& old_display) { |
| 94 web_ui()->CallJavascriptFunction( | 90 web_ui()->CallJavascriptFunction( |
| 95 "options.DisplayOverscan.onOverscanCanceled"); | 91 "options.DisplayOverscan.onOverscanCanceled"); |
| 96 } | 92 } |
| 97 | 93 |
| 94 void DisplayOverscanHandler::OnDisplayMetricsChanged( |
| 95 const gfx::Display&, DisplayObserver::DisplayMetrics) { |
| 96 } |
| 97 |
| 98 void DisplayOverscanHandler::HandleStart(const base::ListValue* args) { | 98 void DisplayOverscanHandler::HandleStart(const base::ListValue* args) { |
| 99 int64 display_id = gfx::Display::kInvalidDisplayID; | 99 int64 display_id = gfx::Display::kInvalidDisplayID; |
| 100 std::string id_value; | 100 std::string id_value; |
| 101 if (!args->GetString(0, &id_value)) { | 101 if (!args->GetString(0, &id_value)) { |
| 102 LOG(ERROR) << "Can't find ID"; | 102 LOG(ERROR) << "Can't find ID"; |
| 103 return; | 103 return; |
| 104 } | 104 } |
| 105 | 105 |
| 106 if (!base::StringToInt64(id_value, &display_id) || | 106 if (!base::StringToInt64(id_value, &display_id) || |
| 107 display_id == gfx::Display::kInvalidDisplayID) { | 107 display_id == gfx::Display::kInvalidDisplayID) { |
| (...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal | 194 LOG(ERROR) << "The orientation must be '" << kOrientationHorizontal |
| 195 << "' or '" << kOrientationVertical << "': " | 195 << "' or '" << kOrientationVertical << "': " |
| 196 << orientation; | 196 << orientation; |
| 197 return; | 197 return; |
| 198 } | 198 } |
| 199 overscan_calibrator_->UpdateInsets(insets); | 199 overscan_calibrator_->UpdateInsets(insets); |
| 200 } | 200 } |
| 201 | 201 |
| 202 } // namespace options | 202 } // namespace options |
| 203 } // namespace chromeos | 203 } // namespace chromeos |
| OLD | NEW |