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

Unified Diff: chrome/browser/views/tabs/tab_strip.cc

Issue 1145001: Porting the app launcher to Windows, and adding an experimental flag... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 9 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/tabs/tab_strip.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/tabs/tab_strip.cc
===================================================================
--- chrome/browser/views/tabs/tab_strip.cc (revision 42236)
+++ chrome/browser/views/tabs/tab_strip.cc (working copy)
@@ -10,7 +10,9 @@
#include "app/os_exchange_data.h"
#include "app/resource_bundle.h"
#include "app/slide_animation.h"
+#include "base/command_line.h"
#include "base/stl_util-inl.h"
+#include "chrome/browser/browser.h"
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/defaults.h"
#include "chrome/browser/metrics/user_metrics.h"
@@ -19,8 +21,10 @@
#include "chrome/browser/tab_contents/tab_contents.h"
#include "chrome/browser/tabs/tab_strip_model.h"
#include "chrome/browser/view_ids.h"
+#include "chrome/browser/views/app_launcher.h"
#include "chrome/browser/views/tabs/dragged_tab_controller.h"
#include "chrome/browser/views/tabs/tab.h"
+#include "chrome/common/chrome_switches.h"
#include "chrome/common/pref_names.h"
#include "gfx/path.h"
#include "gfx/size.h"
@@ -818,6 +822,10 @@
return model_->profile() == other->model()->profile();
}
+gfx::Rect TabStrip::GetNewTabButtonBounds() {
+ return newtab_button_->bounds();
+}
+
////////////////////////////////////////////////////////////////////////////////
// TabStrip, BaseTabStrip implementation:
@@ -1399,6 +1407,16 @@
void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) {
if (sender == newtab_button_) {
+ // 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::kAppLauncherForNewTab)) {
+ NavigationController& controller =
+ model_->GetSelectedTabContents()->controller();
+ AppLauncher::Show(Browser::GetBrowserForController(&controller, NULL));
+ return;
+ }
UserMetrics::RecordAction("NewTab_Button", model_->profile());
model_->delegate()->AddBlankTab(true);
}
« no previous file with comments | « chrome/browser/views/tabs/tab_strip.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698