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

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 70083009: Record NewTabPage.MostVisited histogram on Android. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: != null nit Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/resources/ntp_android/ntp_android.js ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/webui/ntp/new_tab_ui.h" 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
6 6
7 #include <set> 7 #include <set>
8 8
9 #include "base/i18n/rtl.h" 9 #include "base/i18n/rtl.h"
10 #include "base/lazy_instance.h" 10 #include "base/lazy_instance.h"
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after
99 NTPUserDataLogger::FromWebContents(web_contents())->set_ntp_url( 99 NTPUserDataLogger::FromWebContents(web_contents())->set_ntp_url(
100 GURL(chrome::kChromeUINewTabURL)); 100 GURL(chrome::kChromeUINewTabURL));
101 101
102 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more 102 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more
103 // highly. Note this means we're including clicks on not only most visited 103 // highly. Note this means we're including clicks on not only most visited
104 // thumbnails, but also clicks on recently bookmarked. 104 // thumbnails, but also clicks on recently bookmarked.
105 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK); 105 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK);
106 106
107 if (!GetProfile()->IsOffTheRecord()) { 107 if (!GetProfile()->IsOffTheRecord()) {
108 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler()); 108 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler());
109 web_ui->AddMessageHandler(new MetricsHandler());
109 web_ui->AddMessageHandler(new MostVisitedHandler()); 110 web_ui->AddMessageHandler(new MostVisitedHandler());
110 web_ui->AddMessageHandler(new RecentlyClosedTabsHandler()); 111 web_ui->AddMessageHandler(new RecentlyClosedTabsHandler());
111 #if !defined(OS_ANDROID) 112 #if !defined(OS_ANDROID)
112 web_ui->AddMessageHandler(new FaviconWebUIHandler()); 113 web_ui->AddMessageHandler(new FaviconWebUIHandler());
113 web_ui->AddMessageHandler(new MetricsHandler());
114 web_ui->AddMessageHandler(new NewTabPageHandler()); 114 web_ui->AddMessageHandler(new NewTabPageHandler());
115 web_ui->AddMessageHandler(new CoreAppLauncherHandler()); 115 web_ui->AddMessageHandler(new CoreAppLauncherHandler());
116 if (NewTabUI::IsDiscoveryInNTPEnabled()) 116 if (NewTabUI::IsDiscoveryInNTPEnabled())
117 web_ui->AddMessageHandler(new SuggestionsHandler()); 117 web_ui->AddMessageHandler(new SuggestionsHandler());
118 // Android doesn't have a sync promo/username on NTP. 118 // Android doesn't have a sync promo/username on NTP.
119 web_ui->AddMessageHandler(new NewTabPageSyncHandler()); 119 web_ui->AddMessageHandler(new NewTabPageSyncHandler());
120 120
121 if (MightShowApps()) { 121 if (MightShowApps()) {
122 ExtensionService* service = GetProfile()->GetExtensionService(); 122 ExtensionService* service = GetProfile()->GetExtensionService();
123 // We might not have an ExtensionService (on ChromeOS when not logged in 123 // We might not have an ExtensionService (on ChromeOS when not logged in
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
425 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 425 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
426 const char* mime_type, 426 const char* mime_type,
427 int resource_id) { 427 int resource_id) {
428 DCHECK(resource); 428 DCHECK(resource);
429 DCHECK(mime_type); 429 DCHECK(mime_type);
430 resource_map_[std::string(resource)] = 430 resource_map_[std::string(resource)] =
431 std::make_pair(std::string(mime_type), resource_id); 431 std::make_pair(std::string(mime_type), resource_id);
432 } 432 }
433 433
434 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 434 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/resources/ntp_android/ntp_android.js ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698