| OLD | NEW |
| 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 "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" | 5 #include "chrome/browser/extensions/api/automation_internal/automation_internal_
api.h" |
| 6 | 6 |
| 7 #include <vector> | 7 #include <vector> |
| 8 | 8 |
| 9 #include "base/strings/string16.h" | 9 #include "base/strings/string16.h" |
| 10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 137 const GURL& url = contents->GetURL(); | 137 const GURL& url = contents->GetURL(); |
| 138 // TODO(aboxhall): check for webstore URL | 138 // TODO(aboxhall): check for webstore URL |
| 139 if (automation_info->matches.MatchesURL(url)) | 139 if (automation_info->matches.MatchesURL(url)) |
| 140 return true; | 140 return true; |
| 141 | 141 |
| 142 int tab_id = ExtensionTabUtil::GetTabId(contents); | 142 int tab_id = ExtensionTabUtil::GetTabId(contents); |
| 143 content::RenderProcessHost* process = contents->GetRenderProcessHost(); | 143 content::RenderProcessHost* process = contents->GetRenderProcessHost(); |
| 144 int process_id = process ? process->GetID() : -1; | 144 int process_id = process ? process->GetID() : -1; |
| 145 std::string unused_error; | 145 std::string unused_error; |
| 146 return extension->permissions_data()->CanAccessPage( | 146 return extension->permissions_data()->CanAccessPage( |
| 147 extension, url, url, tab_id, process_id, &unused_error); | 147 extension, url, tab_id, process_id, &unused_error); |
| 148 } | 148 } |
| 149 | 149 |
| 150 // Helper class that implements an action adapter for a |RenderFrameHost|. | 150 // Helper class that implements an action adapter for a |RenderFrameHost|. |
| 151 class RenderFrameHostActionAdapter : public AutomationActionAdapter { | 151 class RenderFrameHostActionAdapter : public AutomationActionAdapter { |
| 152 public: | 152 public: |
| 153 explicit RenderFrameHostActionAdapter(content::RenderFrameHost* rfh) | 153 explicit RenderFrameHostActionAdapter(content::RenderFrameHost* rfh) |
| 154 : rfh_(rfh) {} | 154 : rfh_(rfh) {} |
| 155 | 155 |
| 156 virtual ~RenderFrameHostActionAdapter() {} | 156 virtual ~RenderFrameHostActionAdapter() {} |
| 157 | 157 |
| (...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 int result_acc_obj_id) { | 400 int result_acc_obj_id) { |
| 401 if (!error.empty()) { | 401 if (!error.empty()) { |
| 402 Respond(Error(error)); | 402 Respond(Error(error)); |
| 403 return; | 403 return; |
| 404 } | 404 } |
| 405 | 405 |
| 406 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); | 406 Respond(OneArgument(new base::FundamentalValue(result_acc_obj_id))); |
| 407 } | 407 } |
| 408 | 408 |
| 409 } // namespace extensions | 409 } // namespace extensions |
| OLD | NEW |