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

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

Issue 14080004: Remove some chrome-specific methods from content::WebUI. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: review comments and fix null check Created 7 years, 8 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 unified diff | Download patch | Annotate | Revision Log
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 "apps/app_launcher.h" 9 #include "apps/app_launcher.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 71
72 } // namespace 72 } // namespace
73 73
74 /////////////////////////////////////////////////////////////////////////////// 74 ///////////////////////////////////////////////////////////////////////////////
75 // NewTabUI 75 // NewTabUI
76 76
77 NewTabUI::NewTabUI(content::WebUI* web_ui) 77 NewTabUI::NewTabUI(content::WebUI* web_ui)
78 : WebUIController(web_ui), 78 : WebUIController(web_ui),
79 showing_sync_bubble_(false) { 79 showing_sync_bubble_(false) {
80 g_live_new_tabs.Pointer()->insert(this); 80 g_live_new_tabs.Pointer()->insert(this);
81 // Override some options on the Web UI.
82 web_ui->HideFavicon();
83
84 web_ui->FocusLocationBarByDefault();
85 web_ui->HideURL();
86 web_ui->OverrideTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE)); 81 web_ui->OverrideTitle(l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE));
87 82
88 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more 83 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more
89 // highly. Note this means we're including clicks on not only most visited 84 // highly. Note this means we're including clicks on not only most visited
90 // thumbnails, but also clicks on recently bookmarked. 85 // thumbnails, but also clicks on recently bookmarked.
91 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK); 86 web_ui->SetLinkTransitionType(content::PAGE_TRANSITION_AUTO_BOOKMARK);
92 87
93 if (!GetProfile()->IsOffTheRecord()) { 88 if (!GetProfile()->IsOffTheRecord()) {
94 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler()); 89 web_ui->AddMessageHandler(new browser_sync::ForeignSessionHandler());
95 web_ui->AddMessageHandler(new MostVisitedHandler()); 90 web_ui->AddMessageHandler(new MostVisitedHandler());
(...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after
377 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 372 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
378 const char* mime_type, 373 const char* mime_type,
379 int resource_id) { 374 int resource_id) {
380 DCHECK(resource); 375 DCHECK(resource);
381 DCHECK(mime_type); 376 DCHECK(mime_type);
382 resource_map_[std::string(resource)] = 377 resource_map_[std::string(resource)] =
383 std::make_pair(std::string(mime_type), resource_id); 378 std::make_pair(std::string(mime_type), resource_id);
384 } 379 }
385 380
386 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 381 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698