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 <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <memory> | 9 #include <memory> |
10 #include <utility> | 10 #include <utility> |
(...skipping 1042 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1053 int boundary_value) { | 1053 int boundary_value) { |
1054 if (!frontend_host_) | 1054 if (!frontend_host_) |
1055 return; | 1055 return; |
1056 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 && | 1056 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 && |
1057 sample < boundary_value)) { | 1057 sample < boundary_value)) { |
1058 // TODO(nick): Replace with chrome::bad_message::ReceivedBadMessage(). | 1058 // TODO(nick): Replace with chrome::bad_message::ReceivedBadMessage(). |
1059 frontend_host_->BadMessageRecieved(); | 1059 frontend_host_->BadMessageRecieved(); |
1060 return; | 1060 return; |
1061 } | 1061 } |
1062 // Each histogram name must follow a different code path in | 1062 // Each histogram name must follow a different code path in |
1063 // order to UMA_HISTOGRAM_ENUMERATION work correctly. | 1063 // order to UMA_HISTOGRAM_EXACT_LINEAR work correctly. |
1064 if (name == kDevToolsActionTakenHistogram) | 1064 if (name == kDevToolsActionTakenHistogram) |
1065 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); | 1065 UMA_HISTOGRAM_EXACT_LINEAR(name, sample, boundary_value); |
1066 else if (name == kDevToolsPanelShownHistogram) | 1066 else if (name == kDevToolsPanelShownHistogram) |
1067 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); | 1067 UMA_HISTOGRAM_EXACT_LINEAR(name, sample, boundary_value); |
1068 else | 1068 else |
1069 frontend_host_->BadMessageRecieved(); | 1069 frontend_host_->BadMessageRecieved(); |
1070 } | 1070 } |
1071 | 1071 |
1072 void DevToolsUIBindings::SendJsonRequest(const DispatchCallback& callback, | 1072 void DevToolsUIBindings::SendJsonRequest(const DispatchCallback& callback, |
1073 const std::string& browser_id, | 1073 const std::string& browser_id, |
1074 const std::string& url) { | 1074 const std::string& url) { |
1075 if (!android_bridge_) { | 1075 if (!android_bridge_) { |
1076 callback.Run(nullptr); | 1076 callback.Run(nullptr); |
1077 return; | 1077 return; |
(...skipping 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1369 void DevToolsUIBindings::FrontendLoaded() { | 1369 void DevToolsUIBindings::FrontendLoaded() { |
1370 if (frontend_loaded_) | 1370 if (frontend_loaded_) |
1371 return; | 1371 return; |
1372 frontend_loaded_ = true; | 1372 frontend_loaded_ = true; |
1373 | 1373 |
1374 // Call delegate first - it seeds importants bit of information. | 1374 // Call delegate first - it seeds importants bit of information. |
1375 delegate_->OnLoadCompleted(); | 1375 delegate_->OnLoadCompleted(); |
1376 | 1376 |
1377 AddDevToolsExtensionsToClient(); | 1377 AddDevToolsExtensionsToClient(); |
1378 } | 1378 } |
OLD | NEW |