| 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 "chrome/browser/ui/webui/ntp/most_visited_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/callback.h" | 9 #include "base/callback.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 284 url.url); | 284 url.url); |
| 285 if (!url.favicon_url.is_empty()) | 285 if (!url.favicon_url.is_empty()) |
| 286 page_value->SetString("faviconUrl", url.favicon_url.spec()); | 286 page_value->SetString("faviconUrl", url.favicon_url.spec()); |
| 287 | 287 |
| 288 // Special case for prepopulated pages: thumbnailUrl is different from url. | 288 // Special case for prepopulated pages: thumbnailUrl is different from url. |
| 289 if (url.url.spec() == l10n_util::GetStringUTF8(IDS_CHROME_WELCOME_URL)) { | 289 if (url.url.spec() == l10n_util::GetStringUTF8(IDS_CHROME_WELCOME_URL)) { |
| 290 page_value->SetString("thumbnailUrl", | 290 page_value->SetString("thumbnailUrl", |
| 291 "chrome://theme/IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL"); | 291 "chrome://theme/IDR_NEWTAB_CHROME_WELCOME_PAGE_THUMBNAIL"); |
| 292 page_value->SetString("faviconDominantColor", "rgb(0, 147, 60)"); | 292 page_value->SetString("faviconDominantColor", "rgb(0, 147, 60)"); |
| 293 } else if (url.url.spec() == | 293 } else if (url.url.spec() == |
| 294 l10n_util::GetStringUTF8(IDS_THEMES_GALLERY_URL)) { | 294 l10n_util::GetStringUTF8(IDS_WEBSTORE_URL)) { |
| 295 page_value->SetString("thumbnailUrl", | 295 page_value->SetString("thumbnailUrl", |
| 296 "chrome://theme/IDR_NEWTAB_THEMES_GALLERY_THUMBNAIL"); | 296 "chrome://theme/IDR_NEWTAB_WEBSTORE_THUMBNAIL"); |
| 297 page_value->SetString("faviconDominantColor", "rgb(63, 132, 197)"); | 297 page_value->SetString("faviconDominantColor", "rgb(63, 132, 197)"); |
| 298 } | 298 } |
| 299 | 299 |
| 300 history::TopSites* ts = web_ui_->GetProfile()->GetTopSites(); | 300 history::TopSites* ts = web_ui_->GetProfile()->GetTopSites(); |
| 301 if (ts && ts->IsURLPinned(url.url)) | 301 if (ts && ts->IsURLPinned(url.url)) |
| 302 page_value->SetBoolean("pinned", true); | 302 page_value->SetBoolean("pinned", true); |
| 303 pages_value_->Append(page_value); | 303 pages_value_->Append(page_value); |
| 304 } | 304 } |
| 305 } | 305 } |
| 306 | 306 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 332 return base::MD5String(url); | 332 return base::MD5String(url); |
| 333 } | 333 } |
| 334 | 334 |
| 335 // static | 335 // static |
| 336 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { | 336 void MostVisitedHandler::RegisterUserPrefs(PrefService* prefs) { |
| 337 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist, | 337 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedURLsBlacklist, |
| 338 PrefService::UNSYNCABLE_PREF); | 338 PrefService::UNSYNCABLE_PREF); |
| 339 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs, | 339 prefs->RegisterDictionaryPref(prefs::kNTPMostVisitedPinnedURLs, |
| 340 PrefService::UNSYNCABLE_PREF); | 340 PrefService::UNSYNCABLE_PREF); |
| 341 } | 341 } |
| OLD | NEW |