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

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

Issue 9003014: Replace WebUI::tab_contents() with web_contents() and switch all users to use web_contents.h inst... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "build/build_config.h" 5 #include "build/build_config.h"
6 6
7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 7 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/bind_helpers.h" 10 #include "base/bind_helpers.h"
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
44 #include "content/browser/tab_contents/tab_contents.h" 44 #include "content/browser/tab_contents/tab_contents.h"
45 #include "content/public/browser/browser_thread.h" 45 #include "content/public/browser/browser_thread.h"
46 #include "content/public/browser/notification_service.h" 46 #include "content/public/browser/notification_service.h"
47 #include "content/public/browser/user_metrics.h" 47 #include "content/public/browser/user_metrics.h"
48 #include "grit/generated_resources.h" 48 #include "grit/generated_resources.h"
49 #include "grit/theme_resources.h" 49 #include "grit/theme_resources.h"
50 #include "ui/base/l10n/l10n_util.h" 50 #include "ui/base/l10n/l10n_util.h"
51 51
52 using content::BrowserThread; 52 using content::BrowserThread;
53 using content::UserMetricsAction; 53 using content::UserMetricsAction;
54 using content::WebContents;
54 55
55 namespace { 56 namespace {
56 57
57 // The amount of time there must be no painting for us to consider painting 58 // The amount of time there must be no painting for us to consider painting
58 // finished. Observed times are in the ~1200ms range on Windows. 59 // finished. Observed times are in the ~1200ms range on Windows.
59 const int kTimeoutMs = 2000; 60 const int kTimeoutMs = 2000;
60 61
61 // Strings sent to the page via jstemplates used to set the direction of the 62 // Strings sent to the page via jstemplates used to set the direction of the
62 // HTML document based on locale. 63 // HTML document based on locale.
63 const char kRTLHtmlTextDirection[] = "rtl"; 64 const char kRTLHtmlTextDirection[] = "rtl";
64 const char kLTRHtmlTextDirection[] = "ltr"; 65 const char kLTRHtmlTextDirection[] = "ltr";
65 66
66 } // namespace 67 } // namespace
67 68
68 /////////////////////////////////////////////////////////////////////////////// 69 ///////////////////////////////////////////////////////////////////////////////
69 // NewTabUI 70 // NewTabUI
70 71
71 NewTabUI::NewTabUI(TabContents* contents) 72 NewTabUI::NewTabUI(WebContents* contents)
72 : ChromeWebUI(contents) { 73 : ChromeWebUI(contents) {
73 // Override some options on the Web UI. 74 // Override some options on the Web UI.
74 hide_favicon_ = true; 75 hide_favicon_ = true;
75 76
76 focus_location_bar_by_default_ = true; 77 focus_location_bar_by_default_ = true;
77 should_hide_url_ = true; 78 should_hide_url_ = true;
78 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); 79 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE);
79 80
80 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more 81 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more
81 // highly. Note this means we're including clicks on not only most visited 82 // highly. Note this means we're including clicks on not only most visited
(...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 SendResponse(request_id, html_bytes); 272 SendResponse(request_id, html_bytes);
272 } 273 }
273 274
274 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { 275 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const {
275 return "text/html"; 276 return "text/html";
276 } 277 }
277 278
278 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { 279 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const {
279 return false; 280 return false;
280 } 281 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_ui.h ('k') | chrome/browser/ui/webui/ntp/ntp_login_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698