| 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/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/scoped_user_pref_update.h" | 10 #include "base/prefs/scoped_user_pref_update.h" |
| 11 #include "base/strings/string_number_conversions.h" | 11 #include "base/strings/string_number_conversions.h" |
| 12 #include "base/strings/string_util.h" | 12 #include "base/strings/string_util.h" |
| 13 #include "base/strings/stringprintf.h" | 13 #include "base/strings/stringprintf.h" |
| 14 #include "base/strings/utf_string_conversions.h" | 14 #include "base/strings/utf_string_conversions.h" |
| 15 #include "base/values.h" | 15 #include "base/values.h" |
| 16 #include "chrome/browser/chrome_notification_types.h" | 16 #include "chrome/browser/chrome_notification_types.h" |
| 17 #include "chrome/browser/devtools/devtools_file_watcher.h" |
| 17 #include "chrome/browser/devtools/devtools_protocol.h" | 18 #include "chrome/browser/devtools/devtools_protocol.h" |
| 18 #include "chrome/browser/devtools/devtools_target_impl.h" | 19 #include "chrome/browser/devtools/devtools_target_impl.h" |
| 19 #include "chrome/browser/devtools/global_confirm_info_bar.h" | 20 #include "chrome/browser/devtools/global_confirm_info_bar.h" |
| 20 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" | 21 #include "chrome/browser/extensions/chrome_extension_web_contents_observer.h" |
| 21 #include "chrome/browser/infobars/infobar_service.h" | 22 #include "chrome/browser/infobars/infobar_service.h" |
| 22 #include "chrome/browser/profiles/profile.h" | 23 #include "chrome/browser/profiles/profile.h" |
| 23 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
| 24 #include "chrome/browser/ui/browser_iterator.h" | 25 #include "chrome/browser/ui/browser_iterator.h" |
| 25 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
| 26 #include "chrome/browser/ui/browser_window.h" | 27 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 961 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 988 file_system_value.get(), NULL, NULL); | 989 file_system_value.get(), NULL, NULL); |
| 989 } | 990 } |
| 990 | 991 |
| 991 void DevToolsUIBindings::FileSystemRemoved( | 992 void DevToolsUIBindings::FileSystemRemoved( |
| 992 const std::string& file_system_path) { | 993 const std::string& file_system_path) { |
| 993 base::StringValue file_system_path_value(file_system_path); | 994 base::StringValue file_system_path_value(file_system_path); |
| 994 CallClientFunction("DevToolsAPI.fileSystemRemoved", | 995 CallClientFunction("DevToolsAPI.fileSystemRemoved", |
| 995 &file_system_path_value, NULL, NULL); | 996 &file_system_path_value, NULL, NULL); |
| 996 } | 997 } |
| 997 | 998 |
| 999 void DevToolsUIBindings::FileChanged(const std::string& file_path) { |
| 1000 base::StringValue file_path_value(file_path); |
| 1001 CallClientFunction("DevToolsAPI.fileSystemFileChanged", |
| 1002 &file_path_value, NULL, NULL); |
| 1003 } |
| 1004 |
| 998 void DevToolsUIBindings::IndexingTotalWorkCalculated( | 1005 void DevToolsUIBindings::IndexingTotalWorkCalculated( |
| 999 int request_id, | 1006 int request_id, |
| 1000 const std::string& file_system_path, | 1007 const std::string& file_system_path, |
| 1001 int total_work) { | 1008 int total_work) { |
| 1002 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1009 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
| 1003 base::FundamentalValue request_id_value(request_id); | 1010 base::FundamentalValue request_id_value(request_id); |
| 1004 base::StringValue file_system_path_value(file_system_path); | 1011 base::StringValue file_system_path_value(file_system_path); |
| 1005 base::FundamentalValue total_work_value(total_work); | 1012 base::FundamentalValue total_work_value(total_work); |
| 1006 CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated", | 1013 CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated", |
| 1007 &request_id_value, &file_system_path_value, | 1014 &request_id_value, &file_system_path_value, |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1164 return; | 1171 return; |
| 1165 frontend_loaded_ = true; | 1172 frontend_loaded_ = true; |
| 1166 | 1173 |
| 1167 // Call delegate first - it seeds importants bit of information. | 1174 // Call delegate first - it seeds importants bit of information. |
| 1168 delegate_->OnLoadCompleted(); | 1175 delegate_->OnLoadCompleted(); |
| 1169 | 1176 |
| 1170 AddDevToolsExtensionsToClient(); | 1177 AddDevToolsExtensionsToClient(); |
| 1171 if (g_web_socket_api_channel) | 1178 if (g_web_socket_api_channel) |
| 1172 g_web_socket_api_channel->AttachedToBindings(this); | 1179 g_web_socket_api_channel->AttachedToBindings(this); |
| 1173 } | 1180 } |
| OLD | NEW |