diff options
author | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 16:38:40 +0000 |
---|---|---|
committer | jcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-05-24 16:38:40 +0000 |
commit | a807d3fceadd4838c346ba9d5b68798a0b4081d6 (patch) | |
tree | 1c68747834fd1c2da3e522fab91ba43fda62d8b3 /chrome/browser | |
parent | 2ae892453109680699580853e78e89419bceb7a8 (diff) | |
download | chromium_src-a807d3fceadd4838c346ba9d5b68798a0b4081d6.zip chromium_src-a807d3fceadd4838c346ba9d5b68798a0b4081d6.tar.gz chromium_src-a807d3fceadd4838c346ba9d5b68798a0b4081d6.tar.bz2 |
Revert 48042: it breaks unit-tests and UI tests on ChromeOS
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
TBR=jcivelli@chromium.org
Review URL: http://codereview.chromium.org/2077020
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@48044 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser.cc | 16 | ||||
-rw-r--r-- | chrome/browser/defaults.cc | 2 | ||||
-rw-r--r-- | chrome/browser/defaults.h | 3 | ||||
-rw-r--r-- | chrome/browser/dom_ui/new_tab_ui.cc | 2 | ||||
-rw-r--r-- | chrome/browser/dom_ui/shown_sections_handler.cc | 5 | ||||
-rw-r--r-- | chrome/browser/extensions/extension_install_ui.cc | 9 | ||||
-rw-r--r-- | chrome/browser/profile.cc | 2 | ||||
-rw-r--r-- | chrome/browser/views/bookmark_bar_view.cc | 7 |
8 files changed, 31 insertions, 15 deletions
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index f86a9d0..b723a85c 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -1050,13 +1050,17 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) { } bool Browser::OpenAppsPanelAsNewTab() { -#if defined(OS_WIN) +#if defined(OS_CHROMEOS) || defined(OS_WIN) CommandLine* command_line = CommandLine::ForCurrentProcess(); - if (command_line->HasSwitch(switches::kAppsPanel)) { - AppLauncher::ShowForNewTab(this, std::string()); - return true; + if (command_line->HasSwitch(switches::kDisableAppsPanel) || + (!browser_defaults::kShowAppsPanelForNewTab && + !command_line->HasSwitch(switches::kAppsPanel))) { + return false; } -#endif + AppLauncher::ShowForNewTab(this, std::string()); + return true; +#endif // OS_CHROMEOS || OS_WIN + return false; } @@ -2080,7 +2084,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 (Extension::AppsAreEnabled()) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) { 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 a669305..ca50e70 100644 --- a/chrome/browser/defaults.cc +++ b/chrome/browser/defaults.cc @@ -25,6 +25,7 @@ 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) @@ -65,6 +66,7 @@ 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 11dee1f..8a2b543 100644 --- a/chrome/browser/defaults.h +++ b/chrome/browser/defaults.h @@ -67,6 +67,9 @@ 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 5ae65a7..693618e 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 (Extension::AppsAreEnabled()) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) { 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 ecc8f1b..501c1d8 100644 --- a/chrome/browser/dom_ui/shown_sections_handler.cc +++ b/chrome/browser/dom_ui/shown_sections_handler.cc @@ -12,7 +12,6 @@ #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 { @@ -88,7 +87,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 (Extension::AppsAreEnabled() && + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps) && !pref_service->GetBoolean(prefs::kNTPAppLauncherFirstRun)) { int sections = pref_service->GetInteger(prefs::kNTPShownSections); sections &= ~THUMB; @@ -102,7 +101,7 @@ void ShownSectionsHandler::SetFirstAppLauncherRunPref( void ShownSectionsHandler::RegisterUserPrefs(PrefService* pref_service) { pref_service->RegisterIntegerPref(prefs::kNTPShownSections, THUMB | RECENT | TIPS | SYNC); - if (Extension::AppsAreEnabled()) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) { 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 552e231..c85b254 100644 --- a/chrome/browser/extensions/extension_install_ui.cc +++ b/chrome/browser/extensions/extension_install_ui.cc @@ -273,8 +273,13 @@ void ExtensionInstallUI::OnImageLoaded( switch (prompt_type_) { case INSTALL_PROMPT: { - // TODO(jcivelli): http://crbug.com/44771 We should not show an install - // dialog when installing an app from the gallery. + 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; + } + 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 eeeee11..505a528 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 (Extension::AppsAreEnabled()) { + if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableApps)) { #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 56f2f79..8ff3c42 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -33,6 +33,7 @@ #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" @@ -460,8 +461,10 @@ void BookmarkBarView::SetPageNavigator(PageNavigator* navigator) { gfx::Size BookmarkBarView::GetPreferredSize() { // We don't want the bookmark bar view in the app launcher new tab page. - bool hide_bookmark_bar = - (Extension::AppsAreEnabled() && OnNewTabPage()) || OnAppsPage(); + static bool extension_apps = CommandLine::ForCurrentProcess()->HasSwitch( + switches::kEnableApps); + bool hide_bookmark_bar = (extension_apps && OnNewTabPage()) || + OnAppsPage(); if (!hide_bookmark_bar) return LayoutItems(true); |