OLD | NEW |
---|---|
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 Loading... | |
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) { |
Mattias Nissler (ping if slow)
2011/10/07 11:02:57
drive-by nit: indentation?
pastarmovj
2011/10/13 11:25:06
Done.
| |
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 // ProxyCrosSettingsProvider will own the Value* passed to Set(). |
535 chromeos::CrosSettings::Get()->Set(setting_path, value->DeepCopy()); | 535 chromeos::CrosSettings::Get()->Set(setting_path, *value); |
Mattias Nissler (ping if slow)
2011/10/07 11:02:57
Either the code is wrong or the comment is wrong.
pastarmovj
2011/10/13 11:25:06
Comment is wrong the object is not owned by the pr
| |
536 reply.SendSuccess(NULL); | 536 reply.SendSuccess(NULL); |
537 } | 537 } |
538 | 538 |
539 void TestingAutomationProvider::ConnectToWifiNetwork( | 539 void TestingAutomationProvider::ConnectToWifiNetwork( |
540 DictionaryValue* args, IPC::Message* reply_message) { | 540 DictionaryValue* args, IPC::Message* reply_message) { |
541 if (!EnsureCrosLibraryLoaded(this, reply_message)) | 541 if (!EnsureCrosLibraryLoaded(this, reply_message)) |
542 return; | 542 return; |
543 | 543 |
544 AutomationJSONReply reply(this, reply_message); | 544 AutomationJSONReply reply(this, reply_message); |
545 std::string service_path, password; | 545 std::string service_path, password; |
(...skipping 583 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1129 | 1129 |
1130 // Set up an observer (it will delete itself). | 1130 // Set up an observer (it will delete itself). |
1131 take_photo_dialog->AddObserver(new PhotoCaptureObserver( | 1131 take_photo_dialog->AddObserver(new PhotoCaptureObserver( |
1132 this, reply_message)); | 1132 this, reply_message)); |
1133 | 1133 |
1134 views::Widget* window = browser::CreateViewsWindow( | 1134 views::Widget* window = browser::CreateViewsWindow( |
1135 browser->window()->GetNativeHandle(), take_photo_dialog); | 1135 browser->window()->GetNativeHandle(), take_photo_dialog); |
1136 window->SetAlwaysOnTop(true); | 1136 window->SetAlwaysOnTop(true); |
1137 window->Show(); | 1137 window->Show(); |
1138 } | 1138 } |
OLD | NEW |