summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/shell.cc5
-rw-r--r--ash/shell.h3
-rw-r--r--chrome/browser/ui/webui/ntp/new_tab_ui.cc9
3 files changed, 16 insertions, 1 deletions
diff --git a/ash/shell.cc b/ash/shell.cc
index 32f7897..1041a3d 100644
--- a/ash/shell.cc
+++ b/ash/shell.cc
@@ -352,6 +352,11 @@ Shell* Shell::GetInstance() {
}
// static
+bool Shell::HasInstance() {
+ return !!instance_;
+}
+
+// static
void Shell::DeleteInstance() {
delete instance_;
instance_ = NULL;
diff --git a/ash/shell.h b/ash/shell.h
index fd66891..239df7d 100644
--- a/ash/shell.h
+++ b/ash/shell.h
@@ -117,6 +117,9 @@ class ASH_EXPORT Shell {
// Should never be called before |CreateInstance()|.
static Shell* GetInstance();
+ // Returns true if the ash shell has been instantiated.
+ static bool HasInstance();
+
static void DeleteInstance();
// Get the singleton RootWindow used by the Shell.
diff --git a/chrome/browser/ui/webui/ntp/new_tab_ui.cc b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
index 5b77f8e..9fe4427 100644
--- a/chrome/browser/ui/webui/ntp/new_tab_ui.cc
+++ b/chrome/browser/ui/webui/ntp/new_tab_ui.cc
@@ -59,6 +59,10 @@
#include "chrome/browser/ui/webui/ntp/new_tab_page_sync_handler.h"
#endif
+#if defined(USE_AURA)
+#include "ash/shell.h"
+#endif
+
using content::BrowserThread;
using content::UserMetricsAction;
using content::WebContents;
@@ -293,7 +297,10 @@ bool NewTabUI::ShouldShowAppInstallHint() {
// static
bool NewTabUI::ShouldShowAppsPage() {
#if defined(USE_AURA)
- // Ash shows apps in app list thus should not show apps page in NTP4.
+ // Ash shows apps in app list thus should not show apps page in NTP4 unless
+ // it is running in compact mode (crbug.com/116852).
+ if (ash::Shell::HasInstance())
+ return ash::Shell::GetInstance()->IsWindowModeCompact();
return false;
#else
return true;