Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(356)

Unified Diff: chrome/browser/chromeos/input_method/input_method_engine.cc

Issue 561223002: Updates the histograms for IMF and IMEs according to the new design. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed unit_tests. Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/chromeos/input_method/input_method_engine.cc
diff --git a/chrome/browser/chromeos/input_method/input_method_engine.cc b/chrome/browser/chromeos/input_method/input_method_engine.cc
index ddd35079d82aeac5aa61e2f2fa60aff7ba6b5484..23ef4bb8a8c525650f6eaa6a501f3ef8f8e1f875 100644
--- a/chrome/browser/chromeos/input_method/input_method_engine.cc
+++ b/chrome/browser/chromeos/input_method/input_method_engine.cc
@@ -162,8 +162,6 @@ InputMethodEngine::InputMethodEngine()
}
InputMethodEngine::~InputMethodEngine() {
- if (start_time_.ToInternalValue())
- RecordHistogram("WorkingTime", (end_time_ - start_time_).InSeconds());
}
void InputMethodEngine::Initialize(
@@ -176,15 +174,6 @@ void InputMethodEngine::Initialize(
extension_id_ = extension_id;
}
-void InputMethodEngine::RecordHistogram(const char* name, int count) {
- std::string histo_name = base::StringPrintf(
- "InputMethod.%s.%s", name, active_component_id_.c_str());
- base::HistogramBase* counter = base::Histogram::FactoryGet(
- histo_name, 0, 1000000, 50, base::HistogramBase::kNoFlags);
- if (counter)
- counter->Add(count);
-}
-
const std::string& InputMethodEngine::GetActiveComponentId() const {
return active_component_id_;
}
@@ -270,13 +259,10 @@ bool InputMethodEngine::CommitText(int context_id, const char* text,
IMEBridge::Get()->GetInputContextHandler()->CommitText(text);
- // Records times for using input method.
- if (!start_time_.ToInternalValue())
- start_time_ = base::Time::Now();
- end_time_ = base::Time::Now();
- // Records histograms for counts of commits and committed characters.
- RecordHistogram("Commit", 1);
- RecordHistogram("CommitCharacter", GetUtf8StringLength(text));
+ // Records histograms for committed characters.
+ if (!composition_text_->text().empty())
+ UMA_HISTOGRAM_COUNTS("InputMethod.CommitLength",
Seigo Nonaka 2014/09/12 02:15:37 nit: please wrap {} for two-line body.
Shu Chen 2014/09/12 02:57:18 Done.
+ GetUtf8StringLength(text));
return true;
}
@@ -326,6 +312,7 @@ bool InputMethodEngine::SendKeyEvents(
if (details.dispatcher_destroyed)
break;
}
+
return true;
}
@@ -573,18 +560,11 @@ void InputMethodEngine::Enable(const std::string& component_id) {
FocusIn(IMEEngineHandlerInterface::InputContext(
current_input_type_, ui::TEXT_INPUT_MODE_DEFAULT));
EnableInputView();
-
- start_time_ = base::Time();
- end_time_ = base::Time();
- RecordHistogram("Enable", 1);
}
void InputMethodEngine::Disable() {
active_component_id_.clear();
observer_->OnDeactivated(active_component_id_);
-
- if (start_time_.ToInternalValue())
- RecordHistogram("WorkingTime", (end_time_ - start_time_).InSeconds());
}
void InputMethodEngine::PropertyActivate(const std::string& property_name) {

Powered by Google App Engine
This is Rietveld 408576698