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

Unified Diff: chrome/browser/android/omnibox/autocomplete_controller_android.cc

Issue 2790993003: Add Generic Implementation of ClipboardRecentContent (Closed)
Patch Set: blank line Created 3 years, 9 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/android/omnibox/autocomplete_controller_android.cc
diff --git a/chrome/browser/android/omnibox/autocomplete_controller_android.cc b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
index f5755af2bae463fcee1d38970802367a1230591a..91949c39eed0b5c04e6617f688820e8e0b28a92b 100644
--- a/chrome/browser/android/omnibox/autocomplete_controller_android.cc
+++ b/chrome/browser/android/omnibox/autocomplete_controller_android.cc
@@ -10,6 +10,7 @@
#include "base/android/jni_array.h"
#include "base/android/jni_string.h"
#include "base/memory/ptr_util.h"
+#include "base/metrics/histogram_macros.h"
#include "base/strings/string16.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
@@ -42,6 +43,7 @@
#include "components/omnibox/browser/omnibox_field_trial.h"
#include "components/omnibox/browser/omnibox_log.h"
#include "components/omnibox/browser/search_provider.h"
+#include "components/open_from_clipboard/clipboard_recent_content.h"
#include "components/prefs/pref_service.h"
#include "components/search_engines/template_url_service.h"
#include "components/toolbar/toolbar_model.h"
@@ -226,6 +228,12 @@ void AutocompleteControllerAndroid::OnSuggestionSelected(
content::WebContents* web_contents =
content::WebContents::FromJavaWebContents(j_web_contents);
+ if (autocomplete_controller_->result().match_at(selected_index).type ==
Mark P 2017/04/01 05:21:04 For context, this call should be analogous to this
+ AutocompleteMatchType::CLIPBOARD) {
+ UMA_HISTOGRAM_LONG_TIMES_100(
+ "MobileOmnibox.PressedClipboardSuggestionAge",
+ ClipboardRecentContent::GetInstance()->GetClipboardContentAge());
+ }
OmniboxLog log(
// For zero suggest, record an empty input string instead of the
// current URL.

Powered by Google App Engine
This is Rietveld 408576698