OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/extension_webrequest_api.h" | 5 #include "chrome/browser/extensions/extension_webrequest_api.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
(...skipping 602 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
613 dict->SetBoolean(keys::kIsProxyKey, auth_info.is_proxy); | 613 dict->SetBoolean(keys::kIsProxyKey, auth_info.is_proxy); |
614 if (!auth_info.scheme.empty()) | 614 if (!auth_info.scheme.empty()) |
615 dict->SetString(keys::kSchemeKey, auth_info.scheme); | 615 dict->SetString(keys::kSchemeKey, auth_info.scheme); |
616 if (!auth_info.realm.empty()) | 616 if (!auth_info.realm.empty()) |
617 dict->SetString(keys::kRealmKey, auth_info.realm); | 617 dict->SetString(keys::kRealmKey, auth_info.realm); |
618 DictionaryValue* challenger = new DictionaryValue(); | 618 DictionaryValue* challenger = new DictionaryValue(); |
619 challenger->SetString(keys::kHostKey, auth_info.challenger.host()); | 619 challenger->SetString(keys::kHostKey, auth_info.challenger.host()); |
620 challenger->SetInteger(keys::kPortKey, auth_info.challenger.port()); | 620 challenger->SetInteger(keys::kPortKey, auth_info.challenger.port()); |
621 dict->Set(keys::kChallengerKey, challenger); | 621 dict->Set(keys::kChallengerKey, challenger); |
622 dict->SetDouble(keys::kTimeStampKey, time.ToDoubleT() * 1000); | 622 dict->SetDouble(keys::kTimeStampKey, time.ToDoubleT() * 1000); |
623 if (extra_info_spec & ExtraInfoSpec::REQUEST_HEADERS) { | 623 if (extra_info_spec & ExtraInfoSpec::RESPONSE_HEADERS) { |
624 dict->Set(keys::kResponseHeadersKey, | 624 dict->Set(keys::kResponseHeadersKey, |
625 GetResponseHeadersList(request->response_headers())); | 625 GetResponseHeadersList(request->response_headers())); |
626 } | 626 } |
627 if (extra_info_spec & ExtraInfoSpec::STATUS_LINE) | 627 if (extra_info_spec & ExtraInfoSpec::STATUS_LINE) |
628 dict->Set(keys::kStatusLineKey, GetStatusLine(request->response_headers())); | 628 dict->Set(keys::kStatusLineKey, GetStatusLine(request->response_headers())); |
629 args.Append(dict); | 629 args.Append(dict); |
630 | 630 |
631 DispatchEvent(profile, request, listeners, args); | 631 DispatchEvent(profile, request, listeners, args); |
632 } | 632 } |
633 | 633 |
(...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1491 } | 1491 } |
1492 } | 1492 } |
1493 } | 1493 } |
1494 | 1494 |
1495 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( | 1495 ExtensionWebRequestEventRouter::GetInstance()->OnEventHandled( |
1496 profile(), extension_id(), event_name, sub_event_name, request_id, | 1496 profile(), extension_id(), event_name, sub_event_name, request_id, |
1497 response.release()); | 1497 response.release()); |
1498 | 1498 |
1499 return true; | 1499 return true; |
1500 } | 1500 } |
OLD | NEW |