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::FilePathsChanged( |
| 1000 const std::vector<std::string>& file_paths) { |
| 1001 base::ListValue list; |
| 1002 for (auto path : file_paths) |
| 1003 list.AppendString(path); |
| 1004 CallClientFunction("DevToolsAPI.fileSystemFilesChanged", |
| 1005 &list, NULL, NULL); |
| 1006 } |
| 1007 |
998 void DevToolsUIBindings::IndexingTotalWorkCalculated( | 1008 void DevToolsUIBindings::IndexingTotalWorkCalculated( |
999 int request_id, | 1009 int request_id, |
1000 const std::string& file_system_path, | 1010 const std::string& file_system_path, |
1001 int total_work) { | 1011 int total_work) { |
1002 DCHECK_CURRENTLY_ON(BrowserThread::UI); | 1012 DCHECK_CURRENTLY_ON(BrowserThread::UI); |
1003 base::FundamentalValue request_id_value(request_id); | 1013 base::FundamentalValue request_id_value(request_id); |
1004 base::StringValue file_system_path_value(file_system_path); | 1014 base::StringValue file_system_path_value(file_system_path); |
1005 base::FundamentalValue total_work_value(total_work); | 1015 base::FundamentalValue total_work_value(total_work); |
1006 CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated", | 1016 CallClientFunction("DevToolsAPI.indexingTotalWorkCalculated", |
1007 &request_id_value, &file_system_path_value, | 1017 &request_id_value, &file_system_path_value, |
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1164 return; | 1174 return; |
1165 frontend_loaded_ = true; | 1175 frontend_loaded_ = true; |
1166 | 1176 |
1167 // Call delegate first - it seeds importants bit of information. | 1177 // Call delegate first - it seeds importants bit of information. |
1168 delegate_->OnLoadCompleted(); | 1178 delegate_->OnLoadCompleted(); |
1169 | 1179 |
1170 AddDevToolsExtensionsToClient(); | 1180 AddDevToolsExtensionsToClient(); |
1171 if (g_web_socket_api_channel) | 1181 if (g_web_socket_api_channel) |
1172 g_web_socket_api_channel->AttachedToBindings(this); | 1182 g_web_socket_api_channel->AttachedToBindings(this); |
1173 } | 1183 } |
OLD | NEW |