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

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

Issue 9500020: ProtectorService supports multiple change instances. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 8 years, 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <map> 7 #include <map>
8 #include <set> 8 #include <set>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 3444 matching lines...) Expand 10 before | Expand all | Expand 10 after
3455 AutomationJSONReply reply(this, reply_message); 3455 AutomationJSONReply reply(this, reply_message);
3456 if (!protector::IsEnabled()) { 3456 if (!protector::IsEnabled()) {
3457 reply.SendError("Protector is disabled"); 3457 reply.SendError("Protector is disabled");
3458 return; 3458 return;
3459 } 3459 }
3460 std::string action; 3460 std::string action;
3461 if (!args->GetString("action", &action)) { 3461 if (!args->GetString("action", &action)) {
3462 reply.SendError("Missing 'action' value"); 3462 reply.SendError("Missing 'action' value");
3463 return; 3463 return;
3464 } 3464 }
3465 protector::BaseSettingChange* change =
3466 protector_service->GetLastChange();
3465 if (action == "apply_change") 3467 if (action == "apply_change")
3466 protector_service->ApplyChange(browser); 3468 protector_service->ApplyChange(change, browser);
3467 else if (action == "discard_change") 3469 else if (action == "discard_change")
3468 protector_service->DiscardChange(browser); 3470 protector_service->DiscardChange(change, browser);
3469 else 3471 else
3470 return reply.SendError("Invalid 'action' value"); 3472 return reply.SendError("Invalid 'action' value");
3471 reply.SendSuccess(NULL); 3473 reply.SendSuccess(NULL);
3472 } 3474 }
3473 3475
3474 // Sample json input: { "command": "GetLocalStatePrefsInfo" } 3476 // Sample json input: { "command": "GetLocalStatePrefsInfo" }
3475 // Refer chrome/test/pyautolib/prefs_info.py for sample json output. 3477 // Refer chrome/test/pyautolib/prefs_info.py for sample json output.
3476 void TestingAutomationProvider::GetLocalStatePrefsInfo( 3478 void TestingAutomationProvider::GetLocalStatePrefsInfo(
3477 DictionaryValue* args, 3479 DictionaryValue* args,
3478 IPC::Message* reply_message) { 3480 IPC::Message* reply_message) {
(...skipping 3494 matching lines...) Expand 10 before | Expand all | Expand 10 after
6973 6975
6974 Send(reply_message_); 6976 Send(reply_message_);
6975 redirect_query_ = 0; 6977 redirect_query_ = 0;
6976 reply_message_ = NULL; 6978 reply_message_ = NULL;
6977 } 6979 }
6978 6980
6979 void TestingAutomationProvider::OnRemoveProvider() { 6981 void TestingAutomationProvider::OnRemoveProvider() {
6980 if (g_browser_process) 6982 if (g_browser_process)
6981 g_browser_process->GetAutomationProviderList()->RemoveProvider(this); 6983 g_browser_process->GetAutomationProviderList()->RemoveProvider(this);
6982 } 6984 }
OLDNEW
« no previous file with comments | « chrome/app/chrome_command_ids.h ('k') | chrome/browser/protector/default_search_provider_change.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698