summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 16:06:24 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-24 16:06:24 +0000
commit441ec71580e34ddb2dd23811771191a6fe6f6f17 (patch)
tree03cd05256d656a72d28f38990366ac69b6d22086 /chrome/browser
parenta8ad46902facb0bbacb80deb5dbae9af15f48f2e (diff)
downloadchromium_src-441ec71580e34ddb2dd23811771191a6fe6f6f17.zip
chromium_src-441ec71580e34ddb2dd23811771191a6fe6f6f17.tar.gz
chromium_src-441ec71580e34ddb2dd23811771191a6fe6f6f17.tar.bz2
Disabling app launcher and enabling apps by default on ChromeOS .
BUG=3218 TEST=Open the new tab, the new new tab should be shown. Any installed app should be showing in there. Review URL: http://codereview.chromium.org/2135011 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48042 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/browser.cc16
-rw-r--r--chrome/browser/defaults.cc2
-rw-r--r--chrome/browser/defaults.h3
-rw-r--r--chrome/browser/dom_ui/new_tab_ui.cc2
-rw-r--r--chrome/browser/dom_ui/shown_sections_handler.cc5
-rw-r--r--chrome/browser/extensions/extension_install_ui.cc9
-rw-r--r--chrome/browser/profile.cc2
-rw-r--r--chrome/browser/views/bookmark_bar_view.cc7
8 files changed, 15 insertions, 31 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index b723a85c..f86a9d0 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1050,17 +1050,13 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
}
bool Browser::OpenAppsPanelAsNewTab() {
-#if defined(OS_CHROMEOS) || defined(OS_WIN)
+#if defined(OS_WIN)
CommandLine* command_line = CommandLine::ForCurrentProcess();
- if (command_line->HasSwitch(switches::kDisableAppsPanel) ||
- (!browser_defaults::kShowAppsPanelForNewTab &&
- !command_line->HasSwitch(switches::kAppsPanel))) {
- return false;
+ if (command_line->HasSwitch(switches::kAppsPanel)) {
+ AppLauncher::ShowForNewTab(this, std::string());
+ return true;
}
- AppLauncher::ShowForNewTab(this, std::string());
- return true;
-#endif // OS_CHROMEOS || OS_WIN
-
+#endif
return false;
}
@@ -2084,7 +2080,7 @@ void Browser::ExecuteCommand(int id) {
TabContents* Browser::AddBlankTab(bool foreground) {
// To make a more "launchy" experience, try to reuse an existing NTP if there
// is one.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) {
+ if (Extension::AppsAreEnabled()) {
for (int i = tabstrip_model_.count() - 1; i >= 0; --i) {
TabContents* contents = tabstrip_model_.GetTabContentsAt(i);
if (StartsWithASCII(contents->GetURL().spec(),
diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc
index ca50e70..a669305 100644
--- a/chrome/browser/defaults.cc
+++ b/chrome/browser/defaults.cc
@@ -25,7 +25,6 @@ const bool kDownloadPageHasShowInFolder = false;
const bool kSizeTabButtonToTopOfTabStrip = true;
const bool kBootstrapSyncAuthentication = true;
const bool kShowOtherBrowsersInAboutMemory = false;
-const bool kShowAppsPanelForNewTab = true;
#elif defined(TOOLKIT_USES_GTK)
@@ -66,7 +65,6 @@ const bool kOSSupportsOtherBrowsers = true;
const bool kSizeTabButtonToTopOfTabStrip = false;
const bool kBootstrapSyncAuthentication = false;
const bool kShowOtherBrowsersInAboutMemory = true;
-const bool kShowAppsPanelForNewTab = false;
#endif
#if defined(OS_MACOSX)
diff --git a/chrome/browser/defaults.h b/chrome/browser/defaults.h
index 8a2b543..11dee1f 100644
--- a/chrome/browser/defaults.h
+++ b/chrome/browser/defaults.h
@@ -67,9 +67,6 @@ extern const bool kBootstrapSyncAuthentication;
// Should other browsers be shown in about:memory page?
extern const bool kShowOtherBrowsersInAboutMemory;
-// Should we show the app panel when a new tab is created?
-extern const bool kShowAppsPanelForNewTab;
-
} // namespace browser_defaults
#endif // CHROME_BROWSER_DEFAULTS_H_
diff --git a/chrome/browser/dom_ui/new_tab_ui.cc b/chrome/browser/dom_ui/new_tab_ui.cc
index 693618e..5ae65a7 100644
--- a/chrome/browser/dom_ui/new_tab_ui.cc
+++ b/chrome/browser/dom_ui/new_tab_ui.cc
@@ -505,7 +505,7 @@ NewTabUI::NewTabUI(TabContents* contents)
if (ProfileSyncService::IsSyncEnabled()) {
AddMessageHandler((new NewTabPageSyncHandler())->Attach(this));
}
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) {
+ if (Extension::AppsAreEnabled()) {
ExtensionsService* service = GetProfile()->GetExtensionsService();
AddMessageHandler((new AppLauncherHandler(service))->Attach(this));
}
diff --git a/chrome/browser/dom_ui/shown_sections_handler.cc b/chrome/browser/dom_ui/shown_sections_handler.cc
index 501c1d8..ecc8f1b 100644
--- a/chrome/browser/dom_ui/shown_sections_handler.cc
+++ b/chrome/browser/dom_ui/shown_sections_handler.cc
@@ -12,6 +12,7 @@
#include "chrome/browser/pref_service.h"
#include "chrome/browser/profile.h"
#include "chrome/common/chrome_switches.h"
+#include "chrome/common/extensions/extension.h"
#include "chrome/common/pref_names.h"
namespace {
@@ -87,7 +88,7 @@ void ShownSectionsHandler::SetFirstAppLauncherRunPref(
// If we have turned on Apps we want to hide most visited and recent to give
// more focus to the Apps section. We do not do this in MigrateUserPrefs
// because the pref version should not depend on command line switches.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps) &&
+ if (Extension::AppsAreEnabled() &&
!pref_service->GetBoolean(prefs::kNTPAppLauncherFirstRun)) {
int sections = pref_service->GetInteger(prefs::kNTPShownSections);
sections &= ~THUMB;
@@ -101,7 +102,7 @@ void ShownSectionsHandler::SetFirstAppLauncherRunPref(
void ShownSectionsHandler::RegisterUserPrefs(PrefService* pref_service) {
pref_service->RegisterIntegerPref(prefs::kNTPShownSections,
THUMB | RECENT | TIPS | SYNC);
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) {
+ if (Extension::AppsAreEnabled()) {
pref_service->RegisterBooleanPref(prefs::kNTPAppLauncherFirstRun, false);
}
}
diff --git a/chrome/browser/extensions/extension_install_ui.cc b/chrome/browser/extensions/extension_install_ui.cc
index c85b254..552e231 100644
--- a/chrome/browser/extensions/extension_install_ui.cc
+++ b/chrome/browser/extensions/extension_install_ui.cc
@@ -273,13 +273,8 @@ void ExtensionInstallUI::OnImageLoaded(
switch (prompt_type_) {
case INSTALL_PROMPT: {
- if (extension_->GetFullLaunchURL().is_valid()) {
- // Special case extension apps to not show the install dialog.
- // TODO(finnur): http://crbug.com/42443: Don't do this for all apps.
- delegate_->InstallUIProceed(false); // |create_app_shortcut|.
- return;
- }
-
+ // TODO(jcivelli): http://crbug.com/44771 We should not show an install
+ // dialog when installing an app from the gallery.
NotificationService* service = NotificationService::current();
service->Notify(NotificationType::EXTENSION_WILL_SHOW_CONFIRM_DIALOG,
Source<ExtensionInstallUI>(this),
diff --git a/chrome/browser/profile.cc b/chrome/browser/profile.cc
index 505a528..eeeee11 100644
--- a/chrome/browser/profile.cc
+++ b/chrome/browser/profile.cc
@@ -766,7 +766,7 @@ void ProfileImpl::InitExtensions() {
// Some sample apps to make our lives easier while we are developing extension
// apps. This way we don't have to constantly install these over and over.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) {
+ if (Extension::AppsAreEnabled()) {
#if defined(OS_WIN)
std::string user_domain;
if (base::EnvVarGetter::Create()->GetEnv("USERDOMAIN", &user_domain) &&
diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc
index 8ff3c42..56f2f79 100644
--- a/chrome/browser/views/bookmark_bar_view.cc
+++ b/chrome/browser/views/bookmark_bar_view.cc
@@ -33,7 +33,6 @@
#include "chrome/browser/views/event_utils.h"
#include "chrome/browser/views/frame/browser_view.h"
#include "chrome/browser/views/location_bar/location_bar_view.h"
-#include "chrome/common/chrome_switches.h"
#include "chrome/common/notification_service.h"
#include "chrome/common/page_transition_types.h"
#include "chrome/common/pref_names.h"
@@ -461,10 +460,8 @@ void BookmarkBarView::SetPageNavigator(PageNavigator* navigator) {
gfx::Size BookmarkBarView::GetPreferredSize() {
// We don't want the bookmark bar view in the app launcher new tab page.
- static bool extension_apps = CommandLine::ForCurrentProcess()->HasSwitch(
- switches::kEnableApps);
- bool hide_bookmark_bar = (extension_apps && OnNewTabPage()) ||
- OnAppsPage();
+ bool hide_bookmark_bar =
+ (Extension::AppsAreEnabled() && OnNewTabPage()) || OnAppsPage();
if (!hide_bookmark_bar)
return LayoutItems(true);