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

Side by Side Diff: chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_handler.cc

Issue 2823073003: Make Use of Value::GetList API
Patch Set: Further Usages Created 3 years, 8 months 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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/chromeos/emulator/device_emulator_message_hand ler.h" 5 #include "chrome/browser/ui/webui/chromeos/emulator/device_emulator_message_hand ler.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 #include <utility> 8 #include <utility>
9 9
10 #include "ash/shell.h" 10 #include "ash/shell.h"
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after
404 if (args->GetInteger(0, &new_time)) { 404 if (args->GetInteger(0, &new_time)) {
405 power_manager::PowerSupplyProperties props = 405 power_manager::PowerSupplyProperties props =
406 fake_power_manager_client_->props(); 406 fake_power_manager_client_->props();
407 props.set_battery_time_to_full_sec(new_time); 407 props.set_battery_time_to_full_sec(new_time);
408 fake_power_manager_client_->UpdatePowerProperties(props); 408 fake_power_manager_client_->UpdatePowerProperties(props);
409 } 409 }
410 } 410 }
411 411
412 void DeviceEmulatorMessageHandler::UpdatePowerSources( 412 void DeviceEmulatorMessageHandler::UpdatePowerSources(
413 const base::ListValue* args) { 413 const base::ListValue* args) {
414 const base::ListValue* sources; 414 const base::ListValue* sources =
415 CHECK(args->GetList(0, &sources)); 415 static_cast<const base::ListValue*>(&args->base::Value::GetList()[0]);
416 power_manager::PowerSupplyProperties props = 416 power_manager::PowerSupplyProperties props =
417 fake_power_manager_client_->props(); 417 fake_power_manager_client_->props();
418 418
419 std::string selected_id = props.external_power_source_id(); 419 std::string selected_id = props.external_power_source_id();
420 420
421 props.clear_available_external_power_source(); 421 props.clear_available_external_power_source();
422 props.set_external_power_source_id(""); 422 props.set_external_power_source_id("");
423 423
424 // Try to find the previously selected source in the list. 424 // Try to find the previously selected source in the list.
425 const power_manager::PowerSupplyProperties_PowerSource* selected_source = 425 const power_manager::PowerSupplyProperties_PowerSource* selected_source =
(...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after
633 } 633 }
634 634
635 void DeviceEmulatorMessageHandler::MouseExists(bool exists) { 635 void DeviceEmulatorMessageHandler::MouseExists(bool exists) {
636 if (!IsJavascriptAllowed()) 636 if (!IsJavascriptAllowed())
637 return; 637 return;
638 web_ui()->CallJavascriptFunctionUnsafe(kMouseExistsCallback, 638 web_ui()->CallJavascriptFunctionUnsafe(kMouseExistsCallback,
639 base::Value(exists)); 639 base::Value(exists));
640 } 640 }
641 641
642 } // namespace chromeos 642 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698