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

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

Issue 10514013: Filtered events. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix 80 char 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());
941 if ((*it)->extra_info_spec & 942 if ((*it)->extra_info_spec &
942 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) { 943 (ExtraInfoSpec::BLOCKING | ExtraInfoSpec::ASYNC_BLOCKING)) {
943 (*it)->blocked_requests.insert(request->identifier()); 944 (*it)->blocked_requests.insert(request->identifier());
944 ++num_handlers_blocking; 945 ++num_handlers_blocking;
945 946
946 request->SetLoadStateParam( 947 request->SetLoadStateParam(
947 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION, 948 l10n_util::GetStringFUTF16(IDS_LOAD_STATE_PARAMETER_EXTENSION,
948 UTF8ToUTF16((*it)->extension_name))); 949 UTF8ToUTF16((*it)->extension_name)));
949 } 950 }
950 } 951 }
(...skipping 817 matching lines...) Expand 10 before | Expand all | Expand 10 after
1768 } else if ((*it)->name().find("AdBlock") != std::string::npos) { 1769 } else if ((*it)->name().find("AdBlock") != std::string::npos) {
1769 adblock = true; 1770 adblock = true;
1770 } else { 1771 } else {
1771 other = true; 1772 other = true;
1772 } 1773 }
1773 } 1774 }
1774 } 1775 }
1775 1776
1776 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other)); 1777 host->Send(new ExtensionMsg_UsingWebRequestAPI(adblock, adblock_plus, other));
1777 } 1778 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698