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

Side by Side Diff: extensions/renderer/api/automation/automation_api_helper.cc

Issue 2034153002: Makes RenderFrameObserver/RenderViewObserver::OnDestruct pure virtual. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments. Created 4 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "extensions/renderer/api/automation/automation_api_helper.h" 5 #include "extensions/renderer/api/automation/automation_api_helper.h"
6 6
7 #include "content/public/renderer/render_view.h" 7 #include "content/public/renderer/render_view.h"
8 #include "extensions/common/extension_messages.h" 8 #include "extensions/common/extension_messages.h"
9 #include "third_party/WebKit/public/web/WebAXObject.h" 9 #include "third_party/WebKit/public/web/WebAXObject.h"
10 #include "third_party/WebKit/public/web/WebDocument.h" 10 #include "third_party/WebKit/public/web/WebDocument.h"
(...skipping 14 matching lines...) Expand all
25 25
26 bool AutomationApiHelper::OnMessageReceived(const IPC::Message& message) { 26 bool AutomationApiHelper::OnMessageReceived(const IPC::Message& message) {
27 bool handled = true; 27 bool handled = true;
28 IPC_BEGIN_MESSAGE_MAP(AutomationApiHelper, message) 28 IPC_BEGIN_MESSAGE_MAP(AutomationApiHelper, message)
29 IPC_MESSAGE_HANDLER(ExtensionMsg_AutomationQuerySelector, OnQuerySelector) 29 IPC_MESSAGE_HANDLER(ExtensionMsg_AutomationQuerySelector, OnQuerySelector)
30 IPC_MESSAGE_UNHANDLED(handled = false) 30 IPC_MESSAGE_UNHANDLED(handled = false)
31 IPC_END_MESSAGE_MAP() 31 IPC_END_MESSAGE_MAP()
32 return handled; 32 return handled;
33 } 33 }
34 34
35 void AutomationApiHelper::OnDestruct() {
36 delete this;
37 }
38
35 void AutomationApiHelper::OnQuerySelector(int request_id, 39 void AutomationApiHelper::OnQuerySelector(int request_id,
36 int acc_obj_id, 40 int acc_obj_id,
37 const base::string16& selector) { 41 const base::string16& selector) {
38 ExtensionHostMsg_AutomationQuerySelector_Error error; 42 ExtensionHostMsg_AutomationQuerySelector_Error error;
39 if (!render_view() || !render_view()->GetWebView() || 43 if (!render_view() || !render_view()->GetWebView() ||
40 !render_view()->GetWebView()->mainFrame()) { 44 !render_view()->GetWebView()->mainFrame()) {
41 error.value = ExtensionHostMsg_AutomationQuerySelector_Error::kNoMainFrame; 45 error.value = ExtensionHostMsg_AutomationQuerySelector_Error::kNoMainFrame;
42 Send(new ExtensionHostMsg_AutomationQuerySelector_Result( 46 Send(new ExtensionHostMsg_AutomationQuerySelector_Result(
43 routing_id(), request_id, error, 0)); 47 routing_id(), request_id, error, 0));
44 return; 48 return;
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 result_acc_obj = result_acc_obj.parentObject(); 84 result_acc_obj = result_acc_obj.parentObject();
81 85
82 result_acc_obj_id = result_acc_obj.axID(); 86 result_acc_obj_id = result_acc_obj.axID();
83 } 87 }
84 } 88 }
85 Send(new ExtensionHostMsg_AutomationQuerySelector_Result( 89 Send(new ExtensionHostMsg_AutomationQuerySelector_Result(
86 routing_id(), request_id, error, result_acc_obj_id)); 90 routing_id(), request_id, error, result_acc_obj_id));
87 } 91 }
88 92
89 } // namespace extensions 93 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/renderer/api/automation/automation_api_helper.h ('k') | extensions/renderer/extension_frame_helper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698