| 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 (GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) && | 196 if (!NTP4Enabled() && |
| 197 GetProfile()->GetPrefs()->GetBoolean(prefs::kEnableBookmarkBar) && |
| 197 browser_defaults::bookmarks_enabled) { | 198 browser_defaults::bookmarks_enabled) { |
| 198 set_force_bookmark_bar_visible(true); | 199 set_force_bookmark_bar_visible(true); |
| 199 } | 200 } |
| 200 | 201 |
| 201 focus_location_bar_by_default_ = true; | 202 focus_location_bar_by_default_ = true; |
| 202 should_hide_url_ = true; | 203 should_hide_url_ = true; |
| 203 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); | 204 overridden_title_ = l10n_util::GetStringUTF16(IDS_NEW_TAB_TITLE); |
| 204 | 205 |
| 205 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more | 206 // We count all link clicks as AUTO_BOOKMARK, so that site can be ranked more |
| 206 // highly. Note this means we're including clicks on not only most visited | 207 // 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... |
| 463 SendResponse(request_id, html_bytes); | 464 SendResponse(request_id, html_bytes); |
| 464 } | 465 } |
| 465 | 466 |
| 466 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { | 467 std::string NewTabUI::NewTabHTMLSource::GetMimeType(const std::string&) const { |
| 467 return "text/html"; | 468 return "text/html"; |
| 468 } | 469 } |
| 469 | 470 |
| 470 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { | 471 bool NewTabUI::NewTabHTMLSource::ShouldReplaceExistingSource() const { |
| 471 return false; | 472 return false; |
| 472 } | 473 } |
| OLD | NEW |