| 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 593 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 604 [[controller view] setHidden:YES]; | 604 [[controller view] setHidden:YES]; |
| 605 | 605 |
| 606 return controller; | 606 return controller; |
| 607 } | 607 } |
| 608 | 608 |
| 609 // (Private) Handles a click on the new tab button. | 609 // (Private) Handles a click on the new tab button. |
| 610 - (void)clickNewTabButton:(id)sender { | 610 - (void)clickNewTabButton:(id)sender { |
| 611 content::RecordAction(UserMetricsAction("NewTab_Button")); | 611 content::RecordAction(UserMetricsAction("NewTab_Button")); |
| 612 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, | 612 UMA_HISTOGRAM_ENUMERATION("Tab.NewTab", TabStripModel::NEW_TAB_BUTTON, |
| 613 TabStripModel::NEW_TAB_ENUM_COUNT); | 613 TabStripModel::NEW_TAB_ENUM_COUNT); |
| 614 tabStripModel_->delegate()->AddBlankTab(true); | 614 tabStripModel_->delegate()->AddBlankTabAt(-1, true); |
| 615 } | 615 } |
| 616 | 616 |
| 617 // (Private) Returns the number of open tabs in the tab strip. This is the | 617 // (Private) Returns the number of open tabs in the tab strip. This is the |
| 618 // number of TabControllers we know about (as there's a 1-to-1 mapping from | 618 // number of TabControllers we know about (as there's a 1-to-1 mapping from |
| 619 // these controllers to a tab) less the number of closing tabs. | 619 // these controllers to a tab) less the number of closing tabs. |
| 620 - (NSInteger)numberOfOpenTabs { | 620 - (NSInteger)numberOfOpenTabs { |
| 621 return static_cast<NSInteger>(tabStripModel_->count()); | 621 return static_cast<NSInteger>(tabStripModel_->count()); |
| 622 } | 622 } |
| 623 | 623 |
| 624 // (Private) Returns the number of open, mini-tabs. | 624 // (Private) Returns the number of open, mini-tabs. |
| (...skipping 1481 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2106 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { | 2106 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { |
| 2107 // View hierarchy of the contents view: | 2107 // View hierarchy of the contents view: |
| 2108 // NSView -- switchView, same for all tabs | 2108 // NSView -- switchView, same for all tabs |
| 2109 // +- NSView -- TabContentsController's view | 2109 // +- NSView -- TabContentsController's view |
| 2110 // +- TabContentsViewCocoa | 2110 // +- TabContentsViewCocoa |
| 2111 // | 2111 // |
| 2112 // Changing it? Do not forget to modify | 2112 // Changing it? Do not forget to modify |
| 2113 // -[TabStripController swapInTabAtIndex:] too. | 2113 // -[TabStripController swapInTabAtIndex:] too. |
| 2114 return [web_contents->GetNativeView() superview]; | 2114 return [web_contents->GetNativeView() superview]; |
| 2115 } | 2115 } |
| OLD | NEW |