| OLD | NEW |
| 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 <set> | 9 #include <set> |
| 10 | 10 |
| (...skipping 175 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 186 } // namespace | 186 } // namespace |
| 187 | 187 |
| 188 /////////////////////////////////////////////////////////////////////////////// | 188 /////////////////////////////////////////////////////////////////////////////// |
| 189 // NewTabUI | 189 // NewTabUI |
| 190 | 190 |
| 191 NewTabUI::NewTabUI(TabContents* contents) | 191 NewTabUI::NewTabUI(TabContents* contents) |
| 192 : ChromeWebUI(contents) { | 192 : ChromeWebUI(contents) { |
| 193 // Override some options on the Web UI. | 193 // Override some options on the Web UI. |
| 194 hide_favicon_ = true; | 194 hide_favicon_ = true; |
| 195 | 195 |
| 196 if (!NTP4Enabled() && | 196 if (GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) && |
| 197 GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) && | |
| 198 browser_defaults::bookmarks_enabled) { | 197 browser_defaults::bookmarks_enabled) { |
| 199 set_force_bookmark_bar_visible(true); | 198 set_force_bookmark_bar_visible(true); |
| 200 } | 199 } |
| 201 | 200 |
| 202 focus_location_bar_by_default_ = true; | 201 focus_location_bar_by_default_ = true; |
| 203 should_hide_url_ = true; | 202 should_hide_url_ = true; |
| 204 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); | 203 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
| 205 | 204 |
| 206 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more | 205 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more |
| 207 // highly. Note this means we're including clicks on not only most visited | 206 // highly. Note this means we're including clicks on not only most visited |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 464 SendResponse(request_id, html_bytes); | 463 SendResponse(request_id, html_bytes); |
| 465 } | 464 } |
| 466 | 465 |
| 467 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 466 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 468 return "text/html"; | 467 return "text/html"; |
| 469 } | 468 } |
| 470 | 469 |
| 471 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 470 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 472 return false; | 471 return false; |
| 473 } | 472 } |
| OLD | NEW |