OLD | NEW |
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/tab_strip.h" | 5 #include "chrome/browser/views/tabs/tab_strip.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/l10n_util.h" | 8 #include "app/l10n_util.h" |
9 #include "app/os_exchange_data.h" | 9 #include "app/os_exchange_data.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 1399 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1410 | 1410 |
1411 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { | 1411 void TabStrip::ButtonPressed(views::Button* sender, const views::Event& event) { |
1412 if (sender == newtab_button_) { | 1412 if (sender == newtab_button_) { |
1413 // TODO(jcampan): if we decide to keep the app launcher as the default | 1413 // TODO(jcampan): if we decide to keep the app launcher as the default |
1414 // behavior for the new tab button, we should add a method | 1414 // behavior for the new tab button, we should add a method |
1415 // on the TabStripDelegate to do so. | 1415 // on the TabStripDelegate to do so. |
1416 if (CommandLine::ForCurrentProcess()->HasSwitch( | 1416 if (CommandLine::ForCurrentProcess()->HasSwitch( |
1417 switches::kAppLauncherForNewTab)) { | 1417 switches::kAppLauncherForNewTab)) { |
1418 NavigationController& controller = | 1418 NavigationController& controller = |
1419 model_->GetSelectedTabContents()->controller(); | 1419 model_->GetSelectedTabContents()->controller(); |
1420 AppLauncher::Show(Browser::GetBrowserForController(&controller, NULL)); | 1420 AppLauncher::ShowForNewTab(Browser::GetBrowserForController(&controller, |
| 1421 NULL)); |
1421 return; | 1422 return; |
1422 } | 1423 } |
1423 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"), | 1424 UserMetrics::RecordAction(UserMetricsAction("NewTab_Button"), |
1424 model_->profile()); | 1425 model_->profile()); |
1425 model_->delegate()->AddBlankTab(true); | 1426 model_->delegate()->AddBlankTab(true); |
1426 } | 1427 } |
1427 } | 1428 } |
1428 | 1429 |
1429 /////////////////////////////////////////////////////////////////////////////// | 1430 /////////////////////////////////////////////////////////////////////////////// |
1430 // TabStrip, MessageLoop::Observer implementation: | 1431 // TabStrip, MessageLoop::Observer implementation: |
(...skipping 641 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2072 } | 2073 } |
2073 } | 2074 } |
2074 | 2075 |
2075 bool TabStrip::HasPhantomTabs() const { | 2076 bool TabStrip::HasPhantomTabs() const { |
2076 for (int i = 0; i < GetTabCount(); ++i) { | 2077 for (int i = 0; i < GetTabCount(); ++i) { |
2077 if (GetTabAt(i)->phantom()) | 2078 if (GetTabAt(i)->phantom()) |
2078 return true; | 2079 return true; |
2079 } | 2080 } |
2080 return false; | 2081 return false; |
2081 } | 2082 } |
OLD | NEW |