Record impressions and clicks for site suggestion names by source and origin
This CL introduces the name source and methods to record it.
Most of the changes are then code to forward the new parameter of the
recording method.
The updated signature needs rewiring on:
- Android NTP
chrome/android/
chrome/browser/android/ntp/
- iOS
ios/chrome/browser/
- Chrome Desktop
chrome/browser/resources/
chrome/browser/search/
chrome/browser/ui/search
chrome/common/
chrome/renderer/resources/extensions/
chrome/renderer/searchbox/
Bug: 767402
Cq-Include-Trybots: master.tryserver.chromium.linux:closure_compilation
Change-Id: Id10b344f2280f9859db4c76cafe276e130f5dc53
Reviewed-on: https://chromium-review.googlesource.com/673187
Reviewed-by: Sylvain Defresne <[email protected]>
Reviewed-by: Steven Holte <[email protected]>
Reviewed-by: Ken Buchanan <[email protected]>
Reviewed-by: Bernhard Bauer <[email protected]>
Reviewed-by: Marc Treib <[email protected]>
Commit-Queue: Friedrich Horschig <[email protected]>
Cr-Commit-Position: refs/heads/master@{#505103}
diff --git a/components/ntp_tiles/tile_title_source.h b/components/ntp_tiles/tile_title_source.h
new file mode 100644
index 0000000..ed5fdd90
--- /dev/null
+++ b/components/ntp_tiles/tile_title_source.h
@@ -0,0 +1,40 @@
+// Copyright 2017 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef COMPONENTS_NTP_TILES_TILE_TITLE_SOURCE_H_
+#define COMPONENTS_NTP_TILES_TILE_TITLE_SOURCE_H_
+
+namespace ntp_tiles {
+
+// The source where the displayed title of an NTP tile originates from.
+//
+// These values must stay in sync with the NTPTileTitleSource enums in
+// enums.xml AND in chrome/browser/resources/local_ntp/most_visited_single.js.
+//
+// A Java counterpart will be generated for this enum.
+// GENERATED_JAVA_ENUM_PACKAGE: org.chromium.chrome.browser.suggestions
+enum class TileTitleSource {
+ // The title might be invalid, aggregated, user-set, extracted from history,
+ // not loaded or simply not known.
+ UNKNOWN = 0,
+
+ // The site's manifest contained a usable "(short_)name" attribute.
+ MANIFEST = 1,
+
+ // The site provided a meta tag (e.g. OpenGraph's site_name).
+ META_TAG = 2,
+
+ // The site's title is used as tile title, extracted from the title tag.
+ TITLE_TAG = 3,
+
+ // The title was inferred from multiple signals (e.g. meta tags, url, title).
+ INFERRED = 4,
+
+ // The maximum tile title source value that gets recorded in UMA.
+ LAST = INFERRED
+};
+
+} // namespace ntp_tiles
+
+#endif // COMPONENTS_NTP_TILES_TILE_TITLE_SOURCE_H_