OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/new_tab_ui.h" | 5 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/i18n/rtl.h" | 9 #include "base/i18n/rtl.h" |
10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 } | 221 } |
222 | 222 |
223 void NewTabUI::OnShowBookmarkBarChanged() { | 223 void NewTabUI::OnShowBookmarkBarChanged() { |
224 StringValue attached( | 224 StringValue attached( |
225 GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? | 225 GetProfile()->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar) ? |
226 "true" : "false"); | 226 "true" : "false"); |
227 web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached); | 227 web_ui()->CallJavascriptFunction("ntp.setBookmarkBarAttached", attached); |
228 } | 228 } |
229 | 229 |
230 // static | 230 // static |
231 void NewTabUI::RegisterUserPrefs(PrefRegistrySyncable* registry) { | 231 void NewTabUI::RegisterUserPrefs(user_prefs::PrefRegistrySyncable* registry) { |
232 #if !defined(OS_ANDROID) | 232 #if !defined(OS_ANDROID) |
233 AppLauncherHandler::RegisterUserPrefs(registry); | 233 AppLauncherHandler::RegisterUserPrefs(registry); |
234 NewTabPageHandler::RegisterUserPrefs(registry); | 234 NewTabPageHandler::RegisterUserPrefs(registry); |
235 if (NewTabUI::IsDiscoveryInNTPEnabled()) | 235 if (NewTabUI::IsDiscoveryInNTPEnabled()) |
236 SuggestionsHandler::RegisterUserPrefs(registry); | 236 SuggestionsHandler::RegisterUserPrefs(registry); |
237 #endif | 237 #endif |
238 MostVisitedHandler::RegisterUserPrefs(registry); | 238 MostVisitedHandler::RegisterUserPrefs(registry); |
239 browser_sync::ForeignSessionHandler::RegisterUserPrefs(registry); | 239 browser_sync::ForeignSessionHandler::RegisterUserPrefs(registry); |
240 } | 240 } |
241 | 241 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, | 381 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |
382 const char* mime_type, | 382 const char* mime_type, |
383 int resource_id) { | 383 int resource_id) { |
384 DCHECK(resource); | 384 DCHECK(resource); |
385 DCHECK(mime_type); | 385 DCHECK(mime_type); |
386 resource_map_[std::string(resource)] = | 386 resource_map_[std::string(resource)] = |
387 std::make_pair(std::string(mime_type), resource_id); | 387 std::make_pair(std::string(mime_type), resource_id); |
388 } | 388 } |
389 | 389 |
390 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} | 390 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} |
OLD | NEW |