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

Side by Side Diff: chrome/browser/automation/testing_automation_provider_chromeos.cc

Issue 8091002: PART2: Make SignedSettings use proper Value types instead of string all around the place. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments and fixed an issue with user whitelist checks. Created 9 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/automation/testing_automation_provider.h" 5 #include "chrome/browser/automation/testing_automation_provider.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/i18n/time_formatting.h" 8 #include "base/i18n/time_formatting.h"
9 #include "base/stringprintf.h" 9 #include "base/stringprintf.h"
10 #include "base/time.h" 10 #include "base/time.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 for (size_t i = 0; i < arraysize(settings); ++i) { 512 for (size_t i = 0; i < arraysize(settings); ++i) {
513 const Value* setting = GetProxySetting(settings[i]); 513 const Value* setting = GetProxySetting(settings[i]);
514 if (setting) 514 if (setting)
515 return_value->Set(settings[i], setting->DeepCopy()); 515 return_value->Set(settings[i], setting->DeepCopy());
516 } 516 }
517 517
518 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get()); 518 AutomationJSONReply(this, reply_message).SendSuccess(return_value.get());
519 } 519 }
520 520
521 void TestingAutomationProvider::SetProxySettings(DictionaryValue* args, 521 void TestingAutomationProvider::SetProxySettings(DictionaryValue* args,
522 IPC::Message* reply_message) { 522 IPC::Message* reply_message) {
523 AutomationJSONReply reply(this, reply_message); 523 AutomationJSONReply reply(this, reply_message);
524 std::string key; 524 std::string key;
525 Value* value; 525 base::Value* value;
526 if (!args->GetString("key", &key) || !args->Get("value", &value)) { 526 if (!args->GetString("key", &key) || !args->Get("value", &value)) {
527 reply.SendError("Invalid or missing args."); 527 reply.SendError("Invalid or missing args.");
528 return; 528 return;
529 } 529 }
530 530
531 std::string setting_path = "cros.session.proxy."; 531 std::string setting_path = "cros.session.proxy.";
532 setting_path.append(key); 532 setting_path.append(key);
533 533
534 // ProxyCrosSettingsProvider will own the Value* passed to Set(). 534 chromeos::CrosSettings::Get()->Set(setting_path, *value);
535 chromeos::CrosSettings::Get()->Set(setting_path, value->DeepCopy());
536 reply.SendSuccess(NULL); 535 reply.SendSuccess(NULL);
537 } 536 }
538 537
539 void TestingAutomationProvider::ConnectToCellularNetwork( 538 void TestingAutomationProvider::ConnectToCellularNetwork(
540 DictionaryValue* args, IPC::Message* reply_message) { 539 DictionaryValue* args, IPC::Message* reply_message) {
541 if (!EnsureCrosLibraryLoaded(this, reply_message)) 540 if (!EnsureCrosLibraryLoaded(this, reply_message))
542 return; 541 return;
543 542
544 std::string service_path; 543 std::string service_path;
545 if (!args->GetString("service_path", &service_path)) { 544 if (!args->GetString("service_path", &service_path)) {
(...skipping 631 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 1176
1178 // Set up an observer (it will delete itself). 1177 // Set up an observer (it will delete itself).
1179 take_photo_dialog->AddObserver(new PhotoCaptureObserver( 1178 take_photo_dialog->AddObserver(new PhotoCaptureObserver(
1180 this, reply_message)); 1179 this, reply_message));
1181 1180
1182 views::Widget* window = browser::CreateViewsWindow( 1181 views::Widget* window = browser::CreateViewsWindow(
1183 browser->window()->GetNativeHandle(), take_photo_dialog); 1182 browser->window()->GetNativeHandle(), take_photo_dialog);
1184 window->SetAlwaysOnTop(true); 1183 window->SetAlwaysOnTop(true);
1185 window->Show(); 1184 window->Show();
1186 } 1185 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/cros_settings.h » ('j') | chrome/browser/chromeos/cros_settings.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698