| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/devtools_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
| 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 773 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 784 int result, | 784 int result, |
| 785 const std::string& message) { | 785 const std::string& message) { |
| 786 if (result != net::OK) { | 786 if (result != net::OK) { |
| 787 callback.Run(nullptr); | 787 callback.Run(nullptr); |
| 788 return; | 788 return; |
| 789 } | 789 } |
| 790 base::StringValue message_value(message); | 790 base::StringValue message_value(message); |
| 791 callback.Run(&message_value); | 791 callback.Run(&message_value); |
| 792 } | 792 } |
| 793 | 793 |
| 794 void DevToolsUIBindings::OpenWorkerInspector(const std::string& id) { |
| 795 if (agent_host_) |
| 796 agent_host_->OpenWorkerInspector(profile(), id); |
| 797 } |
| 798 |
| 794 void DevToolsUIBindings::OnURLFetchComplete(const net::URLFetcher* source) { | 799 void DevToolsUIBindings::OnURLFetchComplete(const net::URLFetcher* source) { |
| 795 DCHECK(source); | 800 DCHECK(source); |
| 796 PendingRequestsMap::iterator it = pending_requests_.find(source); | 801 PendingRequestsMap::iterator it = pending_requests_.find(source); |
| 797 DCHECK(it != pending_requests_.end()); | 802 DCHECK(it != pending_requests_.end()); |
| 798 | 803 |
| 799 base::DictionaryValue response; | 804 base::DictionaryValue response; |
| 800 base::DictionaryValue* headers = new base::DictionaryValue(); | 805 base::DictionaryValue* headers = new base::DictionaryValue(); |
| 801 net::HttpResponseHeaders* rh = source->GetResponseHeaders(); | 806 net::HttpResponseHeaders* rh = source->GetResponseHeaders(); |
| 802 response.SetInteger("statusCode", rh ? rh->response_code() : 200); | 807 response.SetInteger("statusCode", rh ? rh->response_code() : 200); |
| 803 response.Set("headers", headers); | 808 response.Set("headers", headers); |
| (...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1028 if (frontend_loaded_) | 1033 if (frontend_loaded_) |
| 1029 return; | 1034 return; |
| 1030 frontend_loaded_ = true; | 1035 frontend_loaded_ = true; |
| 1031 | 1036 |
| 1032 // Call delegate first - it seeds importants bit of information. | 1037 // Call delegate first - it seeds importants bit of information. |
| 1033 delegate_->OnLoadCompleted(); | 1038 delegate_->OnLoadCompleted(); |
| 1034 | 1039 |
| 1035 UpdateTheme(); | 1040 UpdateTheme(); |
| 1036 AddDevToolsExtensionsToClient(); | 1041 AddDevToolsExtensionsToClient(); |
| 1037 } | 1042 } |
| OLD | NEW |