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 <map> | 7 #include <map> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1999 snapshot_taker->Start(); | 1999 snapshot_taker->Start(); |
2000 } else { | 2000 } else { |
2001 LOG(ERROR) << "Could not get render view for tab handle"; | 2001 LOG(ERROR) << "Could not get render view for tab handle"; |
2002 AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams(reply_message, | 2002 AutomationMsg_CaptureEntirePageAsPNG::WriteReplyParams(reply_message, |
2003 false); | 2003 false); |
2004 Send(reply_message); | 2004 Send(reply_message); |
2005 } | 2005 } |
2006 } | 2006 } |
2007 | 2007 |
2008 void TestingAutomationProvider::SendJSONRequest(int handle, | 2008 void TestingAutomationProvider::SendJSONRequest(int handle, |
2009 std::string json_request, | 2009 const std::string& json_request, |
2010 IPC::Message* reply_message) { | 2010 IPC::Message* reply_message) { |
2011 scoped_ptr<Value> values; | 2011 scoped_ptr<Value> values; |
2012 base::JSONReader reader; | 2012 base::JSONReader reader; |
2013 std::string error; | 2013 std::string error; |
2014 values.reset(reader.ReadAndReturnError(json_request, true, NULL, &error)); | 2014 values.reset(reader.ReadAndReturnError(json_request, true, NULL, &error)); |
2015 if (!error.empty()) { | 2015 if (!error.empty()) { |
2016 AutomationJSONReply(this, reply_message).SendError(error); | 2016 AutomationJSONReply(this, reply_message).SendError(error); |
2017 return; | 2017 return; |
2018 } | 2018 } |
2019 | 2019 |
(...skipping 3180 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
5200 // If you change this, update Observer for NotificationType::SESSION_END | 5200 // If you change this, update Observer for NotificationType::SESSION_END |
5201 // below. | 5201 // below. |
5202 MessageLoop::current()->PostTask(FROM_HERE, | 5202 MessageLoop::current()->PostTask(FROM_HERE, |
5203 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); | 5203 NewRunnableMethod(this, &TestingAutomationProvider::OnRemoveProvider)); |
5204 } | 5204 } |
5205 } | 5205 } |
5206 | 5206 |
5207 void TestingAutomationProvider::OnRemoveProvider() { | 5207 void TestingAutomationProvider::OnRemoveProvider() { |
5208 AutomationProviderList::GetInstance()->RemoveProvider(this); | 5208 AutomationProviderList::GetInstance()->RemoveProvider(this); |
5209 } | 5209 } |
OLD | NEW |