summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 21:29:26 +0000
committerjcivelli@chromium.org <jcivelli@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-05-14 21:29:26 +0000
commitb7969209a311ca384eceacef7d67743f2ffd792d (patch)
treed64c91438914c09f4389c9edf99ff29f1a8c7dbf
parent0805a9b30d8cf935a572fe093a74f6784c6e4689 (diff)
downloadchromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.zip
chromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.tar.gz
chromium_src-b7969209a311ca384eceacef7d67743f2ffd792d.tar.bz2
Removing the app launcher button in the ChromeOS browser and making the app launcher pinned to the location bar.
BUG=3190 TEST=The app launcher icon on the top-left corner of the browser should be gone. Opening a new tab by pressing the + button or typing CTRL-T should bring the app launcher, it should be located on top of the location bar. Review URL: http://codereview.chromium.org/2060004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@47314 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/app/theme/app_launcher_button.pngbin238 -> 0 bytes
-rw-r--r--chrome/app/theme/theme_resources.grd1
-rw-r--r--chrome/browser/browser.cc27
-rw-r--r--chrome/browser/browser.h5
-rw-r--r--chrome/browser/chromeos/frame/browser_view.cc47
-rw-r--r--chrome/browser/chromeos/frame/browser_view.h12
-rw-r--r--chrome/browser/chromeos/view_ids.h4
-rw-r--r--chrome/browser/defaults.cc3
-rw-r--r--chrome/browser/defaults.h3
-rw-r--r--chrome/browser/views/info_bubble.cc20
-rw-r--r--chrome/browser/views/info_bubble.h14
-rw-r--r--chrome/browser/views/pinned_contents_info_bubble.cc16
-rw-r--r--chrome/browser/views/pinned_contents_info_bubble.h27
-rw-r--r--chrome/browser/views/tabs/browser_tab_strip_controller.cc15
-rw-r--r--chrome/common/chrome_switches.cc8
-rw-r--r--chrome/common/chrome_switches.h1
-rw-r--r--chrome/test/automation/automation_proxy_uitest.cc2
-rw-r--r--chrome/test/in_process_browser_test.cc5
-rw-r--r--chrome/test/ui/ui_test.cc8
19 files changed, 83 insertions, 135 deletions
diff --git a/chrome/app/theme/app_launcher_button.png b/chrome/app/theme/app_launcher_button.png
deleted file mode 100644
index 7dba348..0000000
--- a/chrome/app/theme/app_launcher_button.png
+++ /dev/null
Binary files differ
diff --git a/chrome/app/theme/theme_resources.grd b/chrome/app/theme/theme_resources.grd
index beeb4e9..d6ebb0f 100644
--- a/chrome/app/theme/theme_resources.grd
+++ b/chrome/app/theme/theme_resources.grd
@@ -511,7 +511,6 @@
<include name="IDR_MEDIAPLAYER_PLAYLIST" file="mediaplayer_playlist.png" type="BINDATA" />
<include name="IDR_LOGIN_DEFAULT_USER" file="login_default.png" type="BINDATA" />
<include name="IDR_LOGIN_OTHER_USER" file="login_other.png" type="BINDATA" />
- <include name="IDR_APP_LAUNCHER_BUTTON" file="app_launcher_button.png" type="BINDATA" />
</if>
<if expr="not pp_ifdef('chromeos') and not pp_ifdef('toolkit_views')">
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 492ebfb..3d94ed5 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -111,6 +111,10 @@
#include "chrome/browser/cocoa/find_pasteboard.h"
#endif
+#if defined(OS_CHROMEOS)
+#include "chrome/browser/views/app_launcher.h"
+#endif
+
using base::TimeDelta;
// How long we wait before updating the browser chrome while loading a page.
@@ -1045,6 +1049,21 @@ void Browser::UpdateCommandsForFullscreenMode(bool is_fullscreen) {
command_updater_.UpdateCommandEnabled(IDC_SHOW_PAGE_MENU, show_main_ui);
}
+bool Browser::OpenAppsPanelAsNewTab() {
+#if defined(OS_CHROMEOS) || defined(OS_WIN)
+ CommandLine* command_line = CommandLine::ForCurrentProcess();
+ if (command_line->HasSwitch(switches::kDisableAppsPanel) ||
+ (!browser_defaults::kShowAppsPanelForNewTab &&
+ !command_line->HasSwitch(switches::kAppsPanel))) {
+ return false;
+ }
+ AppLauncher::ShowForNewTab(this, std::string());
+ return true;
+#endif // OS_CHROMEOS || OS_WIN
+
+ return false;
+}
+
///////////////////////////////////////////////////////////////////////////////
// Browser, Assorted browser commands:
@@ -1248,12 +1267,10 @@ void Browser::CloseWindow() {
void Browser::NewTab() {
UserMetrics::RecordAction(UserMetricsAction("NewTab"), profile_);
-#if defined(OS_WIN)
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsPanel)) {
- AppLauncher::ShowForNewTab(this, std::string());
+
+ if (OpenAppsPanelAsNewTab())
return;
- }
-#endif
+
if (type() == TYPE_NORMAL) {
AddBlankTab(true);
} else {
diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h
index 74b5a47..5a7afa5 100644
--- a/chrome/browser/browser.h
+++ b/chrome/browser/browser.h
@@ -419,6 +419,11 @@ class Browser : public TabStripModelDelegate,
// will call this method.
void UpdateCommandsForFullscreenMode(bool is_fullscreen);
+ // Opens the apps panel as a result of a new tab creation, if the browser is
+ // configured in that mode. Returns true if the apps panel was opened, false
+ // otherwise.
+ bool OpenAppsPanelAsNewTab();
+
// Assorted browser commands ////////////////////////////////////////////////
// NOTE: Within each of the following sections, the IDs are ordered roughly by
diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc
index 761459c..1eac964 100644
--- a/chrome/browser/chromeos/frame/browser_view.cc
+++ b/chrome/browser/chromeos/frame/browser_view.cc
@@ -122,9 +122,9 @@ class ChromeosTabStrip : public TabStrip {
namespace chromeos {
// LayoutManager for BrowserView, which layouts extra components such as
-// main menu, stataus views as follows:
-// ____ __ __
-// [AppLauncher] / \ \ \ [StatusArea]
+// the status views as follows:
+// ____ __ __
+// / \ \ \ [StatusArea]
//
class BrowserViewLayout : public ::BrowserViewLayout {
public:
@@ -135,7 +135,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
// BrowserViewLayout overrides:
void Installed(views::View* host) {
- main_menu_button_ = NULL;
compact_navigation_bar_ = NULL;
status_area_ = NULL;
spacer_ = NULL;
@@ -149,9 +148,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
case VIEW_ID_SPACER:
spacer_ = view;
break;
- case VIEW_ID_APP_MENU_BUTTON:
- main_menu_button_ = view;
- break;
case VIEW_ID_STATUS_AREA:
status_area_ = static_cast<chromeos::StatusAreaView*>(view);
break;
@@ -170,7 +166,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
virtual int LayoutTabStrip() {
if (browser_view_->IsFullscreen() ||
!browser_view_->IsTabStripVisible()) {
- main_menu_button_->SetVisible(false);
compact_navigation_bar_->SetVisible(false);
status_area_->SetVisible(false);
otr_avatar_icon_->SetVisible(false);
@@ -211,12 +206,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
// considered title bar area of client view.
bool IsPointInViewsInTitleArea(const gfx::Point& point)
const {
- gfx::Point point_in_main_menu_coords(point);
- views::View::ConvertPointToView(browser_view_, main_menu_button_,
- &point_in_main_menu_coords);
- if (main_menu_button_->HitTest(point_in_main_menu_coords))
- return true;
-
gfx::Point point_in_status_area_coords(point);
views::View::ConvertPointToView(browser_view_, status_area_,
&point_in_status_area_coords);
@@ -241,7 +230,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
if (bounds.IsEmpty()) {
return 0;
}
- main_menu_button_->SetVisible(true);
compact_navigation_bar_->SetVisible(
chromeos_browser_view()->is_compact_style());
tabstrip_->SetVisible(true);
@@ -263,11 +251,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
}
*/
- // Layout main menu before tab strip.
- gfx::Size main_menu_size = main_menu_button_->GetPreferredSize();
- main_menu_button_->SetBounds(0, bounds.y(),
- main_menu_size.width(), bounds.height());
-
status_area_->Update();
// Layout status area after tab strip.
gfx::Size status_size = status_area_->GetPreferredSize();
@@ -276,7 +259,7 @@ class BrowserViewLayout : public ::BrowserViewLayout {
status_size.height());
LayoutOTRAvatar(bounds);
- int curx = bounds.x() + main_menu_size.width();
+ int curx = bounds.x();
if (compact_navigation_bar_->IsVisible()) {
gfx::Size cnb_size = compact_navigation_bar_->GetPreferredSize();
@@ -326,7 +309,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
}
- views::View* main_menu_button_;
chromeos::StatusAreaView* status_area_;
views::View* compact_navigation_bar_;
views::View* spacer_;
@@ -337,7 +319,6 @@ class BrowserViewLayout : public ::BrowserViewLayout {
BrowserView::BrowserView(Browser* browser)
: ::BrowserView(browser),
- main_menu_button_(NULL),
status_area_(NULL),
compact_navigation_bar_(NULL),
// Standard style is default.
@@ -356,15 +337,8 @@ BrowserView::~BrowserView() {
void BrowserView::Init() {
::BrowserView::Init();
- main_menu_button_ = new views::ImageButton(this);
- main_menu_button_->SetID(VIEW_ID_APP_MENU_BUTTON);
ThemeProvider* theme_provider =
frame()->GetThemeProviderForFrame();
- SkBitmap* image = theme_provider->GetBitmapNamed(IDR_APP_LAUNCHER_BUTTON);
- main_menu_button_->SetImage(views::CustomButton::BS_NORMAL, image);
- main_menu_button_->SetImage(views::CustomButton::BS_HOT, image);
- main_menu_button_->SetImage(views::CustomButton::BS_PUSHED, image);
- AddChildView(main_menu_button_);
compact_location_bar_host_.reset(
new chromeos::CompactLocationBarHost(this));
@@ -452,19 +426,6 @@ void BrowserView::ChildPreferredSizeChanged(View* child) {
SchedulePaint();
}
-// views::ButtonListener overrides.
-void BrowserView::ButtonPressed(views::Button* sender,
- const views::Event& event) {
- gfx::Rect bounds = main_menu_button_->bounds();
- gfx::Point origin = bounds.origin();
- // Move the origin to the right otherwise the app launcher info bubble left
- // border will show out of screen.
- origin.Offset(kAppLauncherLeftPadding, 0);
- views::RootView::ConvertPointToScreen(this, &origin);
- bounds.set_origin(origin);
- ::AppLauncher::Show(browser(), bounds, gfx::Point(), std::string());
-}
-
// views::ContextMenuController overrides.
void BrowserView::ShowContextMenu(views::View* source,
const gfx::Point& p,
diff --git a/chrome/browser/chromeos/frame/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h
index 49c0daa..2a414bd 100644
--- a/chrome/browser/chromeos/frame/browser_view.h
+++ b/chrome/browser/chromeos/frame/browser_view.h
@@ -7,7 +7,6 @@
#include "chrome/browser/chromeos/status/status_area_host.h"
#include "chrome/browser/views/frame/browser_view.h"
-#include "views/controls/button/button.h"
class TabStripModel;
@@ -33,12 +32,11 @@ class StatusAreaButton;
// chromeos::BrowserView adds ChromeOS specific controls and menus to a
// BrowserView created with Browser::TYPE_NORMAL. This extender adds controls
// to the title bar as follows:
-// ____ __ __
-// [AppLauncher] / \ \ \ [StatusArea]
+// ____ __ __
+// / \ \ \ [StatusArea]
//
// and adds the system context menu to the remaining arae of the titlebar.
class BrowserView : public ::BrowserView,
- public views::ButtonListener,
public views::ContextMenuController,
public StatusAreaHost {
public:
@@ -66,9 +64,6 @@ class BrowserView : public ::BrowserView,
virtual views::LayoutManager* CreateLayoutManager() const;
virtual void ChildPreferredSizeChanged(View* child);
- // views::ButtonListener overrides.
- virtual void ButtonPressed(views::Button* sender, const views::Event& event);
-
// views::ContextMenuController overrides.
virtual void ShowContextMenu(views::View* source,
const gfx::Point& p,
@@ -100,9 +95,6 @@ class BrowserView : public ::BrowserView,
void InitSystemMenu();
- // AppLauncher button.
- views::ImageButton* main_menu_button_;
-
// Status Area view.
BrowserStatusAreaView* status_area_;
diff --git a/chrome/browser/chromeos/view_ids.h b/chrome/browser/chromeos/view_ids.h
index 54b3b7b..803b8fe 100644
--- a/chrome/browser/chromeos/view_ids.h
+++ b/chrome/browser/chromeos/view_ids.h
@@ -11,12 +11,10 @@
enum ChromeOSViewIds {
// Start with the offset that is big enough to avoid possible
// collison.
- VIEW_ID_APP_MENU_BUTTON = VIEW_ID_PREDEFINED_COUNT + 10000,
- VIEW_ID_COMPACT_NAV_BAR,
+ VIEW_ID_COMPACT_NAV_BAR = VIEW_ID_PREDEFINED_COUNT + 10000,
VIEW_ID_STATUS_AREA,
VIEW_ID_SPACER,
VIEW_ID_OTR_AVATAR,
};
#endif // CHROME_BROWSER_CHROMEOS_VIEW_IDS_H_
-
diff --git a/chrome/browser/defaults.cc b/chrome/browser/defaults.cc
index a76ebbf..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,7 +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/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc
index d1414040..d184c46 100644
--- a/chrome/browser/views/info_bubble.cc
+++ b/chrome/browser/views/info_bubble.cc
@@ -199,9 +199,9 @@ BorderWidget::BorderWidget() : border_contents_(NULL) {
}
-void BorderWidget::Init(HWND owner) {
+void BorderWidget::Init(BorderContents* border_contents, HWND owner) {
DCHECK(!border_contents_);
- border_contents_ = CreateBorderContents();
+ border_contents_ = border_contents;
border_contents_->Init();
WidgetWin::Init(GetAncestor(owner, GA_ROOT), gfx::Rect());
SetContentsView(border_contents_);
@@ -236,10 +236,6 @@ gfx::Rect BorderWidget::SizeAndGetBounds(
return contents_bounds;
}
-BorderContents* BorderWidget::CreateBorderContents() {
- return new BorderContents();
-}
-
LRESULT BorderWidget::OnMouseActivate(HWND window,
UINT hit_test,
UINT mouse_message) {
@@ -325,8 +321,8 @@ void InfoBubble::Init(views::Widget* parent,
#if defined(OS_WIN)
DCHECK(!border_.get());
- border_.reset(CreateBorderWidget());
- border_->Init(GetNativeView());
+ border_.reset(new BorderWidget());
+ border_->Init(CreateBorderContents(), GetNativeView());
// Initialize and position the border window.
window_bounds = border_->SizeAndGetBounds(position_relative_to,
@@ -341,7 +337,7 @@ void InfoBubble::Init(views::Widget* parent,
views::Background::CreateSolidBackground(kBackgroundColor));
#else
// Create a view to paint the border and background.
- border_contents_ = new BorderContents;
+ border_contents_ = CreateBorderContents();
border_contents_->Init();
gfx::Rect contents_bounds;
border_contents_->SizeAndGetBounds(position_relative_to,
@@ -375,11 +371,9 @@ void InfoBubble::Init(views::Widget* parent,
#endif
}
-#if defined(OS_WIN)
-BorderWidget* InfoBubble::CreateBorderWidget() {
- return new BorderWidget;
+BorderContents* InfoBubble::CreateBorderContents() {
+ return new BorderContents();
}
-#endif
void InfoBubble::SizeToContents() {
gfx::Rect window_bounds;
diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h
index 6dad21f..8b3e1f6 100644
--- a/chrome/browser/views/info_bubble.h
+++ b/chrome/browser/views/info_bubble.h
@@ -116,7 +116,7 @@ class BorderWidget : public views::WidgetWin {
virtual ~BorderWidget() { }
// Initializes the BrowserWidget making |owner| its owning window.
- void Init(HWND owner);
+ void Init(BorderContents* border_contents, HWND owner);
// Given the size of the contained contents (without margins), and the rect
// (in screen coordinates) to point to, sets the border window positions and
@@ -129,10 +129,6 @@ class BorderWidget : public views::WidgetWin {
const gfx::Size& contents_size);
protected:
- // Instanciates and returns the BorderContents this BorderWidget should use.
- // Subclasses can return their own BorderContents implementation.
- virtual BorderContents* CreateBorderContents();
-
BorderContents* border_contents_;
private:
@@ -204,11 +200,9 @@ class InfoBubble
views::View* contents,
InfoBubbleDelegate* delegate);
-#if defined(OS_WIN)
- // Instanciates and returns the BorderWidget this InfoBubble should use.
- // Subclasses can return their own BorderWidget specialization.
- virtual BorderWidget* CreateBorderWidget();
-#endif
+ // Instanciates and returns the BorderContents this InfoBubble should use.
+ // Subclasses can return their own BorderContents implementation.
+ virtual BorderContents* CreateBorderContents();
#if defined(OS_WIN)
// Overridden from WidgetWin:
diff --git a/chrome/browser/views/pinned_contents_info_bubble.cc b/chrome/browser/views/pinned_contents_info_bubble.cc
index 532dcdf..c064c16 100644
--- a/chrome/browser/views/pinned_contents_info_bubble.cc
+++ b/chrome/browser/views/pinned_contents_info_bubble.cc
@@ -6,9 +6,6 @@
#include "chrome/browser/views/bubble_border.h"
-#if defined(OS_WIN)
-// BorderWidget ---------------------------------------------------------------
-
void PinnedContentsBorderContents::SizeAndGetBounds(
const gfx::Rect& position_relative_to,
BubbleBorder::ArrowLocation arrow_location,
@@ -34,11 +31,6 @@ void PinnedContentsBorderContents::SizeAndGetBounds(
window_bounds->Offset(0, -(kTopMargin + 1));
}
-BorderContents* PinnedContentsBorderWidget::CreateBorderContents() {
- return new PinnedContentsBorderContents(bubble_anchor_);
-}
-#endif
-
// InfoBubble -----------------------------------------------------------------
// static
@@ -56,10 +48,6 @@ PinnedContentsInfoBubble* PinnedContentsInfoBubble::Show(
return window;
}
-// TODO(finnur): This needs to be implemented for other platforms once we decide
-// this is the way to go.
-#if defined(OS_WIN)
-BorderWidget* PinnedContentsInfoBubble::CreateBorderWidget() {
- return new PinnedContentsBorderWidget(bubble_anchor_);
+BorderContents* PinnedContentsInfoBubble::CreateBorderContents() {
+ return new PinnedContentsBorderContents(bubble_anchor_);
}
-#endif
diff --git a/chrome/browser/views/pinned_contents_info_bubble.h b/chrome/browser/views/pinned_contents_info_bubble.h
index 87d2a9d..8033b39 100644
--- a/chrome/browser/views/pinned_contents_info_bubble.h
+++ b/chrome/browser/views/pinned_contents_info_bubble.h
@@ -31,25 +31,6 @@ class PinnedContentsBorderContents : public BorderContents {
DISALLOW_COPY_AND_ASSIGN(PinnedContentsBorderContents);
};
-#if defined(OS_WIN)
-// The window that surrounds the info bubble. See base class for details.
-class PinnedContentsBorderWidget : public BorderWidget {
- public:
- explicit PinnedContentsBorderWidget(const gfx::Point& bubble_anchor)
- : bubble_anchor_(bubble_anchor) {}
- virtual ~PinnedContentsBorderWidget() {}
-
- // BorderWidget overrides:
- virtual BorderContents* CreateBorderContents();
-
- private:
- // The location of the pinned contents (in screen coordinates).
- const gfx::Point bubble_anchor_;
-
- DISALLOW_COPY_AND_ASSIGN(PinnedContentsBorderWidget);
-};
-#endif
-
// A specialization of the InfoBubble. Used to draw an InfoBubble which, in
// addition to having an arrow pointing to where the user clicked, also shifts
// the bubble horizontally to fix it to a specific location. See base class
@@ -69,16 +50,14 @@ class PinnedContentsInfoBubble : public InfoBubble {
views::View* contents,
InfoBubbleDelegate* delegate);
+ // InfoBubble overrides:
+ virtual BorderContents* CreateBorderContents();
+
private:
explicit PinnedContentsInfoBubble(const gfx::Point& bubble_anchor)
: bubble_anchor_(bubble_anchor) {}
virtual ~PinnedContentsInfoBubble() {}
- // InfoBubble overrides:
-#if defined(OS_WIN)
- virtual BorderWidget* CreateBorderWidget();
-#endif
-
// The location of the pinned contents (in screen coordinates).
const gfx::Point bubble_anchor_;
diff --git a/chrome/browser/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/views/tabs/browser_tab_strip_controller.cc
index a2a8c92..eeb24eb 100644
--- a/chrome/browser/views/tabs/browser_tab_strip_controller.cc
+++ b/chrome/browser/views/tabs/browser_tab_strip_controller.cc
@@ -252,18 +252,13 @@ bool BrowserTabStripController::IsCompatibleWith(BaseTabStrip* other) const {
}
void BrowserTabStripController::CreateNewTab() {
- // TODO(jcampan): if we decide to keep the app launcher as the default
- // behavior for the new tab button, we should add a method
- // on the TabStripDelegate to do so.
- if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsPanel)) {
- NavigationController& controller =
- model_->GetSelectedTabContents()->controller();
- AppLauncher::ShowForNewTab(
- Browser::GetBrowserForController(&controller, NULL), std::string());
- return;
- }
UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"),
model_->profile());
+
+ Browser* browser = model_->GetSelectedTabContents()->delegate()->GetBrowser();
+ if (browser->OpenAppsPanelAsNewTab())
+ return;
+
model_->delegate()->AddBlankTab(true);
}
diff --git a/chrome/common/chrome_switches.cc b/chrome/common/chrome_switches.cc
index b7b9195..c9028cf 100644
--- a/chrome/common/chrome_switches.cc
+++ b/chrome/common/chrome_switches.cc
@@ -98,6 +98,14 @@ const char kDisableAltWinstation[] = "disable-winsta";
// Disable the ApplicationCache.
const char kDisableApplicationCache[] = "disable-application-cache";
+// Disables the app launcher popup when a new tab is created, directly creates
+// a tab instead. Takes precedence over kAppLauncherForNewTab.
+// TODO(jcivelli): http://crbug.com/44089 this flag is required for some tests
+// to work, as showing the app launcher is the default on
+// ChromeOS but not on other platforms. Tests should be fixed
+// once it becomes the default behavior on all platforms.
+const char kDisableAppsPanel[] = "disable-apps-panel";
+
// Replaces the audio IPC layer for <audio> and <video> with a mock audio
// device, useful when using remote desktop or machines without sound cards.
// This is temporary until we fix the underlying problem.
diff --git a/chrome/common/chrome_switches.h b/chrome/common/chrome_switches.h
index 3396e27..bc82fd5 100644
--- a/chrome/common/chrome_switches.h
+++ b/chrome/common/chrome_switches.h
@@ -44,6 +44,7 @@ extern const char kDebugPrint[];
extern const char kDiagnostics[];
extern const char kDisableAltWinstation[];
extern const char kDisableApplicationCache[];
+extern const char kDisableAppsPanel[];
extern const char kDisableAudio[];
extern const char kDisableAuthNegotiateCnameLookup[];
extern const char kDisableBackingStoreLimit[];
diff --git a/chrome/test/automation/automation_proxy_uitest.cc b/chrome/test/automation/automation_proxy_uitest.cc
index 5269605..cb243dae 100644
--- a/chrome/test/automation/automation_proxy_uitest.cc
+++ b/chrome/test/automation/automation_proxy_uitest.cc
@@ -107,12 +107,12 @@ TEST_F(AutomationProxyVisibleTest, MAYBE_WindowGetViewBounds) {
gfx::Rect bounds;
ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_0, &bounds, false));
- EXPECT_GT(bounds.x(), 0);
EXPECT_GT(bounds.width(), 0);
EXPECT_GT(bounds.height(), 0);
gfx::Rect bounds2;
ASSERT_TRUE(window->GetViewBounds(VIEW_ID_TAB_LAST, &bounds2, false));
+ EXPECT_GT(bounds2.x(), 0);
EXPECT_GT(bounds2.width(), 0);
EXPECT_GT(bounds2.height(), 0);
diff --git a/chrome/test/in_process_browser_test.cc b/chrome/test/in_process_browser_test.cc
index 21bf2a6..225df36 100644
--- a/chrome/test/in_process_browser_test.cc
+++ b/chrome/test/in_process_browser_test.cc
@@ -138,6 +138,11 @@ void InProcessBrowserTest::SetUp() {
// Don't show the first run ui.
command_line->AppendSwitch(switches::kNoFirstRun);
+ // TODO(jcivelli): http://crbug.com/44089 We disable the app launcher on new
+ // tab behavior for now until it is the default behavior on
+ // all platforms.
+ command_line->AppendSwitch(switches::kDisableAppsPanel);
+
// This is a Browser test.
command_line->AppendSwitchWithValue(switches::kTestType,
ASCIIToWide(kBrowserTestType));
diff --git a/chrome/test/ui/ui_test.cc b/chrome/test/ui/ui_test.cc
index d956478..d8a45bb 100644
--- a/chrome/test/ui/ui_test.cc
+++ b/chrome/test/ui/ui_test.cc
@@ -130,6 +130,10 @@ UITestBase::UITestBase()
terminate_timeout_ms_(kWaitForTerminateMsec) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
+ // TODO(jcivelli): http://crbug.com/44089 We disable the app launcher on new
+ // tab behavior for now until it is the default behavior on
+ // all platforms.
+ launch_arguments_.AppendSwitch(switches::kDisableAppsPanel);
}
UITestBase::UITestBase(MessageLoop::Type msg_loop_type)
@@ -156,6 +160,10 @@ UITestBase::UITestBase(MessageLoop::Type msg_loop_type)
terminate_timeout_ms_(kWaitForTerminateMsec) {
PathService::Get(chrome::DIR_APP, &browser_directory_);
PathService::Get(chrome::DIR_TEST_DATA, &test_data_directory_);
+ // TODO(jcivelli): http://crbug.com/44089 We disable the app launcher on new
+ // tab behavior for now until it is the default behavior on
+ // all platforms.
+ launch_arguments_.AppendSwitch(switches::kDisableAppsPanel);
}
UITestBase::~UITestBase() {