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 755 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 766 } |
767 | 767 |
768 void DevToolsUIBindings::SendMessageToBrowser(const std::string& message) { | 768 void DevToolsUIBindings::SendMessageToBrowser(const std::string& message) { |
769 if (agent_host_.get()) | 769 if (agent_host_.get()) |
770 agent_host_->DispatchProtocolMessage(message); | 770 agent_host_->DispatchProtocolMessage(message); |
771 } | 771 } |
772 | 772 |
773 void DevToolsUIBindings::RecordEnumeratedHistogram(const std::string& name, | 773 void DevToolsUIBindings::RecordEnumeratedHistogram(const std::string& name, |
774 int sample, | 774 int sample, |
775 int boundary_value) { | 775 int boundary_value) { |
776 if (!(boundary_value >= 0 && boundary_value < 100 && sample >= 0 && | 776 if (!(boundary_value >= 0 && boundary_value <= 100 && sample >= 0 && |
777 sample < boundary_value)) { | 777 sample < boundary_value)) { |
778 frontend_host_->BadMessageRecieved(); | 778 frontend_host_->BadMessageRecieved(); |
779 return; | 779 return; |
780 } | 780 } |
781 // Each histogram name must follow a different code path in | 781 // Each histogram name must follow a different code path in |
782 // order to UMA_HISTOGRAM_ENUMERATION work correctly. | 782 // order to UMA_HISTOGRAM_ENUMERATION work correctly. |
783 if (name == kDevToolsActionTakenHistogram) | 783 if (name == kDevToolsActionTakenHistogram) |
784 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); | 784 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); |
785 else if (name == kDevToolsPanelShownHistogram) | 785 else if (name == kDevToolsPanelShownHistogram) |
786 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); | 786 UMA_HISTOGRAM_ENUMERATION(name, sample, boundary_value); |
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 if (frontend_loaded_) | 1049 if (frontend_loaded_) |
1050 return; | 1050 return; |
1051 frontend_loaded_ = true; | 1051 frontend_loaded_ = true; |
1052 | 1052 |
1053 // Call delegate first - it seeds importants bit of information. | 1053 // Call delegate first - it seeds importants bit of information. |
1054 delegate_->OnLoadCompleted(); | 1054 delegate_->OnLoadCompleted(); |
1055 | 1055 |
1056 UpdateTheme(); | 1056 UpdateTheme(); |
1057 AddDevToolsExtensionsToClient(); | 1057 AddDevToolsExtensionsToClient(); |
1058 } | 1058 } |
OLD | NEW |