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

Side by Side Diff: chrome/browser/extensions/api/web_request/web_request_api.cc

Issue 10661038: Revert 143896 - Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 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 | Annotate | Revision Log
OLDNEW
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/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 919 matching lines...) Expand 10 before | Expand all | Expand 10 after
930 CHECK(args_filtered->GetDictionary(0, &dict) && dict); 930 CHECK(args_filtered->GetDictionary(0, &dict) && dict);
931 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS)) 931 if (!((*it)->extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS))
932 dict->Remove(keys::kRequestHeadersKey, NULL); 932 dict->Remove(keys::kRequestHeadersKey, NULL);
933 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS)) 933 if (!((*it)->extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS))
934 dict->Remove(keys::kResponseHeadersKey, NULL); 934 dict->Remove(keys::kResponseHeadersKey, NULL);
935 935
936 base::JSONWriter::Write(args_filtered.get(), &json_args); 936 base::JSONWriter::Write(args_filtered.get(), &json_args);
937 937
938 ExtensionEventRouter::DispatchEvent( 938 ExtensionEventRouter::DispatchEvent(
939 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name, 939 (*it)->ipc_sender.get(), (*it)->extension_id, (*it)->sub_event_name,
940 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN, 940 json_args, GURL(), ExtensionEventRouter::USER_GESTURE_UNKNOWN);
941 EventFilteringInfo());
942 if ((*it)->extra_info_spec & 941 if ((*it)->extra_info_spec &
943 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { 942 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) {
944 (*it)->blocked_requests.insert(request->identifier()); 943 (*it)->blocked_requests.insert(request->identifier());
945 ++num_handlers_blocking; 944 ++num_handlers_blocking;
946 945
947 request->SetLoadStateParam( 946 request->SetLoadStateParam(
948 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, 947 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION,
949 UTF8ToUTF16((*it)->extension_name))); 948 UTF8ToUTF16((*it)->extension_name)));
950 } 949 }
951 } 950 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1769 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 1768 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
1770 adblock = true; 1769 adblock = true;
1771 } else { 1770 } else {
1772 other = true; 1771 other = true;
1773 } 1772 }
1774 } 1773 }
1775 } 1774 }
1776 1775
1777 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 1776 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
1778 } 1777 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/web_navigation/web_navigation_apitest.cc ('k') | chrome/browser/extensions/event_listener_map.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698