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 195 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 void NewTabUI::RegisterProfilePrefs( | 206 void NewTabUI::RegisterProfilePrefs( |
207 user_prefs::PrefRegistrySyncable* registry) { | 207 user_prefs::PrefRegistrySyncable* registry) { |
208 CoreAppLauncherHandler::RegisterProfilePrefs(registry); | 208 CoreAppLauncherHandler::RegisterProfilePrefs(registry); |
209 NewTabPageHandler::RegisterProfilePrefs(registry); | 209 NewTabPageHandler::RegisterProfilePrefs(registry); |
210 } | 210 } |
211 | 211 |
212 // static | 212 // static |
213 bool NewTabUI::ShouldShowApps() { | 213 bool NewTabUI::ShouldShowApps() { |
214 // Ash shows apps in app list thus should not show apps page in NTP4. | 214 // Ash shows apps in app list thus should not show apps page in NTP4. |
215 #if defined(USE_ASH) | 215 #if defined(USE_ASH) |
216 return chrome::GetActiveDesktop() != chrome::HOST_DESKTOP_TYPE_ASH; | 216 return chrome::GetActiveDesktop() != ui::HOST_DESKTOP_TYPE_ASH; |
217 #else | 217 #else |
218 return true; | 218 return true; |
219 #endif | 219 #endif |
220 } | 220 } |
221 | 221 |
222 // static | 222 // static |
223 void NewTabUI::SetUrlTitleAndDirection(base::DictionaryValue* dictionary, | 223 void NewTabUI::SetUrlTitleAndDirection(base::DictionaryValue* dictionary, |
224 const base::string16& title, | 224 const base::string16& title, |
225 const GURL& gurl) { | 225 const GURL& gurl) { |
226 dictionary->SetString("url", gurl.spec()); | 226 dictionary->SetString("url", gurl.spec()); |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
340 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, | 340 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, |
341 const char* mime_type, | 341 const char* mime_type, |
342 int resource_id) { | 342 int resource_id) { |
343 DCHECK(resource); | 343 DCHECK(resource); |
344 DCHECK(mime_type); | 344 DCHECK(mime_type); |
345 resource_map_[std::string(resource)] = | 345 resource_map_[std::string(resource)] = |
346 std::make_pair(std::string(mime_type), resource_id); | 346 std::make_pair(std::string(mime_type), resource_id); |
347 } | 347 } |
348 | 348 |
349 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} | 349 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} |
OLD | NEW |