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

Side by Side Diff: chrome/browser/views/tabs/browser_tab_strip_controller.cc

Issue 2060004: Removing the app launcher button on ChromeOS (Closed) Base URL: git://codf21.jail/chromium.git
Patch Set: One more clean up Created 10 years, 7 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/views/pinned_contents_info_bubble.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/views/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "chrome/browser/browser.h" 8 #include "chrome/browser/browser.h"
9 #include "chrome/browser/profile.h" 9 #include "chrome/browser/profile.h"
10 #include "chrome/browser/metrics/user_metrics.h" 10 #include "chrome/browser/metrics/user_metrics.h"
(...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after
245 } 245 }
246 } 246 }
247 247
248 bool BrowserTabStripController::IsCompatibleWith(BaseTabStrip* other) const { 248 bool BrowserTabStripController::IsCompatibleWith(BaseTabStrip* other) const {
249 Profile* other_profile = 249 Profile* other_profile =
250 static_cast<BrowserTabStripController*>(other->controller())->profile(); 250 static_cast<BrowserTabStripController*>(other->controller())->profile();
251 return other_profile == profile(); 251 return other_profile == profile();
252 } 252 }
253 253
254 void BrowserTabStripController::CreateNewTab() { 254 void BrowserTabStripController::CreateNewTab() {
255 // TODO(jcampan): if we decide to keep the app launcher as the default
256 // behavior for the new tab button, we should add a method
257 // on the TabStripDelegate to do so.
258 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kAppsPanel)) {
259 NavigationController& controller =
260 model_->GetSelectedTabContents()->controller();
261 AppLauncher::ShowForNewTab(
262 Browser::GetBrowserForController(&controller, NULL), std::string());
263 return;
264 }
265 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"), 255 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"),
266 model_->profile()); 256 model_->profile());
257
258 Browser* browser = model_->GetSelectedTabContents()->delegate()->GetBrowser();
259 if (browser->OpenAppsPanelAsNewTab())
260 return;
261
267 model_->delegate()->AddBlankTab(true); 262 model_->delegate()->AddBlankTab(true);
268 } 263 }
269 264
270 //////////////////////////////////////////////////////////////////////////////// 265 ////////////////////////////////////////////////////////////////////////////////
271 // BrowserTabStripController, TabStripModelObserver implementation: 266 // BrowserTabStripController, TabStripModelObserver implementation:
272 267
273 void BrowserTabStripController::TabInsertedAt(TabContents* contents, 268 void BrowserTabStripController::TabInsertedAt(TabContents* contents,
274 int model_index, 269 int model_index,
275 bool foreground) { 270 bool foreground) {
276 DCHECK(contents); 271 DCHECK(contents);
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 void BrowserTabStripController::StopHighlightTabsForCommand( 388 void BrowserTabStripController::StopHighlightTabsForCommand(
394 TabStripModel::ContextMenuCommand command_id, 389 TabStripModel::ContextMenuCommand command_id,
395 BaseTabRenderer* tab) { 390 BaseTabRenderer* tab) {
396 if (command_id == TabStripModel::CommandCloseTabsOpenedBy || 391 if (command_id == TabStripModel::CommandCloseTabsOpenedBy ||
397 command_id == TabStripModel::CommandCloseTabsToRight || 392 command_id == TabStripModel::CommandCloseTabsToRight ||
398 command_id == TabStripModel::CommandCloseOtherTabs) { 393 command_id == TabStripModel::CommandCloseOtherTabs) {
399 // Just tell all Tabs to stop pulsing - it's safe. 394 // Just tell all Tabs to stop pulsing - it's safe.
400 tabstrip_->StopAllHighlighting(); 395 tabstrip_->StopAllHighlighting();
401 } 396 }
402 } 397 }
OLDNEW
« no previous file with comments | « chrome/browser/views/pinned_contents_info_bubble.cc ('k') | chrome/common/chrome_switches.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698