Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(93)

Side by Side Diff: chrome/browser/ui/webui/ntp/new_tab_ui.cc

Issue 12095052: Move app_launcher.* out of chrome/browser/extensions and into apps/ (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Beserk Q. More rebase Created 7 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 "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
11 #include "apps/app_launcher.h"
11 #include "base/bind.h" 12 #include "base/bind.h"
12 #include "base/bind_helpers.h" 13 #include "base/bind_helpers.h"
13 #include "base/command_line.h" 14 #include "base/command_line.h"
14 #include "base/i18n/rtl.h" 15 #include "base/i18n/rtl.h"
15 #include "base/lazy_instance.h" 16 #include "base/lazy_instance.h"
16 #include "base/memory/singleton.h" 17 #include "base/memory/singleton.h"
17 #include "base/metrics/histogram.h" 18 #include "base/metrics/histogram.h"
18 #include "base/prefs/pref_service.h" 19 #include "base/prefs/pref_service.h"
19 #include "base/strings/string_number_conversions.h" 20 #include "base/strings/string_number_conversions.h"
20 #include "base/threading/thread.h" 21 #include "base/threading/thread.h"
21 #include "base/utf_string_conversions.h" 22 #include "base/utf_string_conversions.h"
22 #include "chrome/browser/defaults.h" 23 #include "chrome/browser/defaults.h"
23 #include "chrome/browser/extensions/app_launcher.h"
24 #include "chrome/browser/prefs/pref_registry_syncable.h" 24 #include "chrome/browser/prefs/pref_registry_syncable.h"
25 #include "chrome/browser/profiles/profile.h" 25 #include "chrome/browser/profiles/profile.h"
26 #include "chrome/browser/sessions/session_types.h" 26 #include "chrome/browser/sessions/session_types.h"
27 #include "chrome/browser/sync/profile_sync_service.h" 27 #include "chrome/browser/sync/profile_sync_service.h"
28 #include "chrome/browser/themes/theme_service.h" 28 #include "chrome/browser/themes/theme_service.h"
29 #include "chrome/browser/themes/theme_service_factory.h" 29 #include "chrome/browser/themes/theme_service_factory.h"
30 #include "chrome/browser/ui/browser.h" 30 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/webui/metrics_handler.h" 31 #include "chrome/browser/ui/webui/metrics_handler.h"
32 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h" 32 #include "chrome/browser/ui/webui/ntp/favicon_webui_handler.h"
33 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h" 33 #include "chrome/browser/ui/webui/ntp/foreign_session_handler.h"
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
293 browser_sync::ForeignSessionHandler::RegisterUserPrefs(registry); 293 browser_sync::ForeignSessionHandler::RegisterUserPrefs(registry);
294 } 294 }
295 295
296 // static 296 // static
297 bool NewTabUI::ShouldShowApps() { 297 bool NewTabUI::ShouldShowApps() {
298 #if defined(OS_ANDROID) 298 #if defined(OS_ANDROID)
299 // Ash shows apps in app list thus should not show apps page in NTP4. 299 // Ash shows apps in app list thus should not show apps page in NTP4.
300 // Android does not have apps. 300 // Android does not have apps.
301 return false; 301 return false;
302 #else 302 #else
303 return !extensions::IsAppLauncherEnabled(); 303 // This needs to be synchronous, so we use the value the last time it
304 // was checked.
305 return !apps::WasAppLauncherEnabled();
304 #endif 306 #endif
305 } 307 }
306 308
307 // static 309 // static
308 bool NewTabUI::IsDiscoveryInNTPEnabled() { 310 bool NewTabUI::IsDiscoveryInNTPEnabled() {
309 // TODO(beaudoin): The flag was removed during a clean-up pass. We leave that 311 // TODO(beaudoin): The flag was removed during a clean-up pass. We leave that
310 // here to easily enable it back when we will explore this option again. 312 // here to easily enable it back when we will explore this option again.
311 return false; 313 return false;
312 } 314 }
313 315
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after
428 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource, 430 void NewTabUI::NewTabHTMLSource::AddResource(const char* resource,
429 const char* mime_type, 431 const char* mime_type,
430 int resource_id) { 432 int resource_id) {
431 DCHECK(resource); 433 DCHECK(resource);
432 DCHECK(mime_type); 434 DCHECK(mime_type);
433 resource_map_[std::string(resource)] = 435 resource_map_[std::string(resource)] =
434 std::make_pair(std::string(mime_type), resource_id); 436 std::make_pair(std::string(mime_type), resource_id);
435 } 437 }
436 438
437 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {} 439 NewTabUI::NewTabHTMLSource::~NewTabHTMLSource() {}
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/ntp/new_tab_page_handler.cc ('k') | chrome/browser/ui/webui/ntp/ntp_resource_cache.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698