| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 657 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 668 [[controller view] setHidden:YES]; | 668 [[controller view] setHidden:YES]; |
| 669 | 669 |
| 670 return controller; | 670 return controller; |
| 671 } | 671 } |
| 672 | 672 |
| 673 // (Private) Handles a click on the new tab button. | 673 // (Private) Handles a click on the new tab button. |
| 674 - (void)clickNewTabButton:(id)sender { | 674 - (void)clickNewTabButton:(id)sender { |
| 675 content::RecordAction(UserMetricsAction("NewTab_Button")); | 675 content::RecordAction(UserMetricsAction("NewTab_Button")); |
| 676 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, | 676 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, |
| 677 TabStripModel::NEW_TAB_ENUM_COUNT); | 677 TabStripModel::NEW_TAB_ENUM_COUNT); |
| 678 tabStripModel_->delegate()->AddBlankTabAt(-1, true); | 678 tabStripModel_->delegate()->AddURLTabAt(GURL(), -1, true); |
| 679 } | 679 } |
| 680 | 680 |
| 681 // (Private) Returns the number of open tabs in the tab strip. This is the | 681 // (Private) Returns the number of open tabs in the tab strip. This is the |
| 682 // number of TabControllers we know about (as there's a 1-to-1 mapping from | 682 // number of TabControllers we know about (as there's a 1-to-1 mapping from |
| 683 // these controllers to a tab) less the number of closing tabs. | 683 // these controllers to a tab) less the number of closing tabs. |
| 684 - (NSInteger)numberOfOpenTabs { | 684 - (NSInteger)numberOfOpenTabs { |
| 685 return static_cast<NSInteger>(tabStripModel_->count()); | 685 return static_cast<NSInteger>(tabStripModel_->count()); |
| 686 } | 686 } |
| 687 | 687 |
| 688 // (Private) Returns the number of open, mini-tabs. | 688 // (Private) Returns the number of open, mini-tabs. |
| (...skipping 1528 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2217 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { | 2217 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { |
| 2218 // View hierarchy of the contents view: | 2218 // View hierarchy of the contents view: |
| 2219 // NSView -- switchView, same for all tabs | 2219 // NSView -- switchView, same for all tabs |
| 2220 // +- NSView -- TabContentsController's view | 2220 // +- NSView -- TabContentsController's view |
| 2221 // +- TabContentsViewCocoa | 2221 // +- TabContentsViewCocoa |
| 2222 // | 2222 // |
| 2223 // Changing it? Do not forget to modify | 2223 // Changing it? Do not forget to modify |
| 2224 // -[TabStripController swapInTabAtIndex:] too. | 2224 // -[TabStripController swapInTabAtIndex:] too. |
| 2225 return [web_contents->GetView()->GetNativeView() superview]; | 2225 return [web_contents->GetView()->GetNativeView() superview]; |
| 2226 } | 2226 } |
| OLD | NEW |