OLD | NEW |
---|---|
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
8 | 8 |
9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
178 | 178 |
179 NewTabHTMLSource::NewTabHTMLSource() | 179 NewTabHTMLSource::NewTabHTMLSource() |
180 : DataSource(kNewTabHost, MessageLoop::current()) { | 180 : DataSource(kNewTabHost, MessageLoop::current()) { |
181 } | 181 } |
182 | 182 |
183 void NewTabHTMLSource::StartDataRequest(const std::string& path, | 183 void NewTabHTMLSource::StartDataRequest(const std::string& path, |
184 int request_id) { | 184 int request_id) { |
185 if (!path.empty()) { | 185 if (!path.empty()) { |
186 // A path under new-tab was requested; it's likely a bad relative | 186 // A path under new-tab was requested; it's likely a bad relative |
187 // URL from the new tab page, but in any case it's an error. | 187 // URL from the new tab page, but in any case it's an error. |
188 #if defined(OS_WIN) | |
189 // TODO(port): re-enable this when the %DISTRIBUTION% replacement is done | |
190 // as a build step. | |
188 NOTREACHED(); | 191 NOTREACHED(); |
192 #endif | |
TVL
2009/02/26 18:07:21
nit- #else NOTIMPL?
| |
189 return; | 193 return; |
190 } | 194 } |
191 | 195 |
192 // Show the profile name in the title and most visited labels if the current | 196 // Show the profile name in the title and most visited labels if the current |
193 // profile is not the default. | 197 // profile is not the default. |
194 std::wstring title; | 198 std::wstring title; |
195 std::wstring most_visited; | 199 std::wstring most_visited; |
196 if (UserDataManager::Get()->is_current_profile_default()) { | 200 if (UserDataManager::Get()->is_current_profile_default()) { |
197 title = l10n_util::GetString(IDS_NEW_TAB_TITLE); | 201 title = l10n_util::GetString(IDS_NEW_TAB_TITLE); |
198 most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED); | 202 most_visited = l10n_util::GetString(IDS_NEW_TAB_MOST_VISITED); |
(...skipping 676 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
875 const GURL&, | 879 const GURL&, |
876 WindowOpenDisposition disposition) { | 880 WindowOpenDisposition disposition) { |
877 // The user opened a URL on the page (including "open in new window"). | 881 // The user opened a URL on the page (including "open in new window"). |
878 // We count all such clicks as AUTO_BOOKMARK, which increments the site's | 882 // We count all such clicks as AUTO_BOOKMARK, which increments the site's |
879 // visit count (which is used for ranking the most visited entries). | 883 // visit count (which is used for ranking the most visited entries). |
880 // Note this means we're including clicks on not only most visited | 884 // Note this means we're including clicks on not only most visited |
881 // thumbnails, but also clicks on recently bookmarked. | 885 // thumbnails, but also clicks on recently bookmarked. |
882 get_contents()->OpenURL(url, GURL(), disposition, | 886 get_contents()->OpenURL(url, GURL(), disposition, |
883 PageTransition::AUTO_BOOKMARK); | 887 PageTransition::AUTO_BOOKMARK); |
884 } | 888 } |
OLD | NEW |