| OLD | NEW |
| 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/extensions/api/web_request/web_request_api.h" | 5 #include "chrome/browser/extensions/api/web_request/web_request_api.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 172 int* window_id, | 172 int* window_id, |
| 173 int* render_process_host_id, | 173 int* render_process_host_id, |
| 174 int* routing_id, | 174 int* routing_id, |
| 175 ResourceType::Type* resource_type) { | 175 ResourceType::Type* resource_type) { |
| 176 if (!request->GetUserData(NULL)) | 176 if (!request->GetUserData(NULL)) |
| 177 return; | 177 return; |
| 178 | 178 |
| 179 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 179 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
| 180 ExtensionRendererState::GetInstance()->GetTabAndWindowId( | 180 ExtensionRendererState::GetInstance()->GetTabAndWindowId( |
| 181 info, tab_id, window_id); | 181 info, tab_id, window_id); |
| 182 *frame_id = info->GetFrameID(); | 182 *frame_id = info->GetRenderFrameID(); |
| 183 *is_main_frame = info->IsMainFrame(); | 183 *is_main_frame = info->IsMainFrame(); |
| 184 *parent_frame_id = info->GetParentFrameID(); | 184 *parent_frame_id = info->GetParentRenderFrameID(); |
| 185 *parent_is_main_frame = info->ParentIsMainFrame(); | 185 *parent_is_main_frame = info->ParentIsMainFrame(); |
| 186 *render_process_host_id = info->GetChildID(); | 186 *render_process_host_id = info->GetChildID(); |
| 187 *routing_id = info->GetRouteID(); | 187 *routing_id = info->GetRouteID(); |
| 188 | 188 |
| 189 // Restrict the resource type to the values we care about. | 189 // Restrict the resource type to the values we care about. |
| 190 if (helpers::IsRelevantResourceType(info->GetResourceType())) | 190 if (helpers::IsRelevantResourceType(info->GetResourceType())) |
| 191 *resource_type = info->GetResourceType(); | 191 *resource_type = info->GetResourceType(); |
| 192 else | 192 else |
| 193 *resource_type = ResourceType::LAST_TYPE; | 193 *resource_type = ResourceType::LAST_TYPE; |
| 194 } | 194 } |
| (...skipping 2185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2380 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2380 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
| 2381 adblock = true; | 2381 adblock = true; |
| 2382 } else { | 2382 } else { |
| 2383 other = true; | 2383 other = true; |
| 2384 } | 2384 } |
| 2385 } | 2385 } |
| 2386 } | 2386 } |
| 2387 | 2387 |
| 2388 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2388 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
| 2389 } | 2389 } |
| OLD | NEW |