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 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 int* tab_id, | 170 int* tab_id, |
171 int* window_id, | 171 int* window_id, |
172 int* render_process_host_id, | 172 int* render_process_host_id, |
173 int* routing_id, | 173 int* routing_id, |
174 ResourceType::Type* resource_type) { | 174 ResourceType::Type* resource_type) { |
175 if (!request->GetUserData(NULL)) | 175 if (!request->GetUserData(NULL)) |
176 return; | 176 return; |
177 | 177 |
178 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); | 178 const ResourceRequestInfo* info = ResourceRequestInfo::ForRequest(request); |
179 ExtensionRendererState::GetInstance()->GetTabAndWindowId( | 179 ExtensionRendererState::GetInstance()->GetTabAndWindowId( |
180 info->GetChildID(), info->GetRouteID(), tab_id, window_id); | 180 info, tab_id, window_id); |
181 *frame_id = info->GetFrameID(); | 181 *frame_id = info->GetFrameID(); |
182 *is_main_frame = info->IsMainFrame(); | 182 *is_main_frame = info->IsMainFrame(); |
183 *parent_frame_id = info->GetParentFrameID(); | 183 *parent_frame_id = info->GetParentFrameID(); |
184 *parent_is_main_frame = info->ParentIsMainFrame(); | 184 *parent_is_main_frame = info->ParentIsMainFrame(); |
185 *render_process_host_id = info->GetChildID(); | 185 *render_process_host_id = info->GetChildID(); |
186 *routing_id = info->GetRouteID(); | 186 *routing_id = info->GetRouteID(); |
187 | 187 |
188 // Restrict the resource type to the values we care about. | 188 // Restrict the resource type to the values we care about. |
189 if (helpers::IsRelevantResourceType(info->GetResourceType())) | 189 if (helpers::IsRelevantResourceType(info->GetResourceType())) |
190 *resource_type = info->GetResourceType(); | 190 *resource_type = info->GetResourceType(); |
(...skipping 2186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2377 } else if ((*it)->name().find("AdBlock") != std::string::npos) { | 2377 } else if ((*it)->name().find("AdBlock") != std::string::npos) { |
2378 adblock = true; | 2378 adblock = true; |
2379 } else { | 2379 } else { |
2380 other = true; | 2380 other = true; |
2381 } | 2381 } |
2382 } | 2382 } |
2383 } | 2383 } |
2384 | 2384 |
2385 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); | 2385 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); |
2386 } | 2386 } |
OLD | NEW |