Commit 8452ee72 authored by Nico Weber's avatar Nico Weber Committed by Commit Bot

mac: Remove unused cocoa new tab button.

Bug: 832676
Change-Id: I7b1fbbbc4cf83d470b81874e12fbda2b7a6a9194
Reviewed-on: https://chromium-review.googlesource.com/1240157Reviewed-by: default avatarElly Fong-Jones <ellyjones@chromium.org>
Commit-Queue: Nico Weber <thakis@chromium.org>
Cr-Commit-Position: refs/heads/master@{#593514}
parent 25a46753
...@@ -233,8 +233,6 @@ jumbo_split_static_library("ui") { ...@@ -233,8 +233,6 @@ jumbo_split_static_library("ui") {
"cocoa/menu_button.mm", "cocoa/menu_button.mm",
"cocoa/multi_key_equivalent_button.h", "cocoa/multi_key_equivalent_button.h",
"cocoa/multi_key_equivalent_button.mm", "cocoa/multi_key_equivalent_button.mm",
"cocoa/new_tab_button.h",
"cocoa/new_tab_button_cocoa.mm",
"cocoa/nsview_additions.h", "cocoa/nsview_additions.h",
"cocoa/nsview_additions.mm", "cocoa/nsview_additions.mm",
"cocoa/omnibox/omnibox_popup_cell.h", "cocoa/omnibox/omnibox_popup_cell.h",
......
...@@ -1238,7 +1238,6 @@ bool IsTabDetachingInFullscreenEnabled() { ...@@ -1238,7 +1238,6 @@ bool IsTabDetachingInFullscreenEnabled() {
} }
- (void)showNewTabButton:(BOOL)show { - (void)showNewTabButton:(BOOL)show {
[tabStripController_ showNewTabButton:show];
} }
- (BOOL)isBookmarkBarVisible { - (BOOL)isBookmarkBarVisible {
......
// Copyright (c) 2011 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON_H_
#define CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON_H_
#import <Cocoa/Cocoa.h>
#import "chrome/browser/ui/cocoa/themed_window.h"
// Overrides hit-test behavior to only accept clicks inside the image of the
// button, not just inside the bounding box. This could be abstracted to general
// use, but no other buttons are so irregularly shaped with respect to their
// bounding box.
@interface NewTabButtonCocoa : NSButton<ThemedWindowDrawing>
// Returns YES if the given point is over the button. |point| is in the
// superview's coordinate system.
- (BOOL)pointIsOverButton:(NSPoint)point;
// Sets the images shown by the NewTabButtonCocoa's different states.
- (void)setImages;
@end
#endif // CHROME_BROWSER_UI_COCOA_NEW_TAB_BUTTON_H_
This diff is collapsed.
...@@ -19,7 +19,6 @@ ...@@ -19,7 +19,6 @@
@class CrTrackingArea; @class CrTrackingArea;
@class CustomWindowControlsView; @class CustomWindowControlsView;
@class NewTabButtonCocoa;
@class TabContentsController; @class TabContentsController;
@class TabControllerCocoa; @class TabControllerCocoa;
@class TabViewCocoa; @class TabViewCocoa;
...@@ -73,23 +72,15 @@ class WebContents; ...@@ -73,23 +72,15 @@ class WebContents;
NSView* switchView_; // weak NSView* switchView_; // weak
base::scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server base::scoped_nsobject<NSView> dragBlockingView_; // avoid bad window server
// drags // drags
NewTabButtonCocoa* newTabButton_; // weak, obtained from the nib.
// The controller that manages all the interactions of dragging tabs. // The controller that manages all the interactions of dragging tabs.
base::scoped_nsobject<TabStripDragController> dragController_; base::scoped_nsobject<TabStripDragController> dragController_;
// Tracks the newTabButton_ for rollovers.
base::scoped_nsobject<CrTrackingArea> newTabTrackingArea_;
std::unique_ptr<TabStripModelObserverBridge> bridge_; std::unique_ptr<TabStripModelObserverBridge> bridge_;
Browser* browser_; // weak Browser* browser_; // weak
TabStripModel* tabStripModel_; // weak TabStripModel* tabStripModel_; // weak
// Delegate that is informed about tab state changes. // Delegate that is informed about tab state changes.
id<TabStripControllerDelegate> delegate_; // weak id<TabStripControllerDelegate> delegate_; // weak
// YES if the new tab button is currently displaying the hover image (if the
// mouse is currently over the button).
BOOL newTabButtonShowingHoverImage_;
// Access to the TabContentsControllers (which own the parent view // Access to the TabContentsControllers (which own the parent view
// for the toolbar and associated tab contents) given an index. Call // for the toolbar and associated tab contents) given an index. Call
// |indexFromModelIndex:| to convert a |tabStripModel_| index to a // |indexFromModelIndex:| to convert a |tabStripModel_| index to a
...@@ -116,8 +107,6 @@ class WebContents; ...@@ -116,8 +107,6 @@ class WebContents;
// aren't coalesced, so we store frames to avoid redundant calls. // aren't coalesced, so we store frames to avoid redundant calls.
base::scoped_nsobject<NSMutableDictionary> targetFrames_; base::scoped_nsobject<NSMutableDictionary> targetFrames_;
NSRect newTabTargetFrame_; NSRect newTabTargetFrame_;
// If YES, do not show the new tab button during layout.
BOOL forceNewTabButtonHidden_;
// YES if we've successfully completed the initial layout. When this is // YES if we've successfully completed the initial layout. When this is
// NO, we probably don't want to do any animation because we're just coming // NO, we probably don't want to do any animation because we're just coming
// into being. // into being.
...@@ -254,10 +243,6 @@ class WebContents; ...@@ -254,10 +243,6 @@ class WebContents;
// tab strip, less the right indent for controls). // tab strip, less the right indent for controls).
- (CGFloat)tabAreaRightEdge; - (CGFloat)tabAreaRightEdge;
// Show or hide the new tab button. The button is hidden immediately, but
// waits until the next call to |-layoutTabs| to show it again.
- (void)showNewTabButton:(BOOL)show;
// Force the tabs to rearrange themselves to reflect the current model. // Force the tabs to rearrange themselves to reflect the current model.
- (void)layoutTabs; - (void)layoutTabs;
- (void)layoutTabsWithoutAnimation; - (void)layoutTabsWithoutAnimation;
......
...@@ -10,7 +10,6 @@ ...@@ -10,7 +10,6 @@
#include "chrome/browser/media/webrtc/media_stream_capture_indicator.h" #include "chrome/browser/media/webrtc/media_stream_capture_indicator.h"
#include "chrome/browser/ui/browser_window.h" #include "chrome/browser/ui/browser_window.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/new_tab_button.h"
#import "chrome/browser/ui/cocoa/tabs/tab_controller.h" #import "chrome/browser/ui/cocoa/tabs/tab_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h"
...@@ -134,11 +133,6 @@ class TabStripControllerTest : public CocoaProfileTest { ...@@ -134,11 +133,6 @@ class TabStripControllerTest : public CocoaProfileTest {
tab_strip_.reset( tab_strip_.reset(
[[TabStripView alloc] initWithFrame:strip_frame]); [[TabStripView alloc] initWithFrame:strip_frame]);
[parent addSubview:tab_strip_.get()]; [parent addSubview:tab_strip_.get()];
NSRect button_frame = NSMakeRect(0, 0, 15, 15);
base::scoped_nsobject<NewTabButtonCocoa> new_tab_button(
[[NewTabButtonCocoa alloc] initWithFrame:button_frame]);
[tab_strip_ addSubview:new_tab_button.get()];
[tab_strip_ setNewTabButton:new_tab_button.get()];
delegate_.reset(new TestTabStripModelDelegate()); delegate_.reset(new TestTabStripModelDelegate());
model_ = browser()->tab_strip_model(); model_ = browser()->tab_strip_model();
......
...@@ -11,7 +11,6 @@ ...@@ -11,7 +11,6 @@
#import "chrome/browser/ui/cocoa/background_gradient_view.h" #import "chrome/browser/ui/cocoa/background_gradient_view.h"
#import "chrome/browser/ui/cocoa/url_drop_target.h" #import "chrome/browser/ui/cocoa/url_drop_target.h"
@class NewTabButtonCocoa;
@class TabStripControllerCocoa; @class TabStripControllerCocoa;
// A view class that handles rendering the tab strip and drops of URLS with // A view class that handles rendering the tab strip and drops of URLS with
...@@ -26,8 +25,6 @@ ...@@ -26,8 +25,6 @@
// Handles being a drag-and-drop target. // Handles being a drag-and-drop target.
base::scoped_nsobject<URLDropTargetHandler> dropHandler_; base::scoped_nsobject<URLDropTargetHandler> dropHandler_;
base::scoped_nsobject<NewTabButtonCocoa> newTabButton_;
// Whether the drop-indicator arrow is shown, and if it is, the coordinate of // Whether the drop-indicator arrow is shown, and if it is, the coordinate of
// its tip. // its tip.
BOOL dropArrowShown_; BOOL dropArrowShown_;
...@@ -40,10 +37,6 @@ ...@@ -40,10 +37,6 @@
@property(assign, nonatomic) NSPoint dropArrowPosition; @property(assign, nonatomic) NSPoint dropArrowPosition;
@property(assign, nonatomic) BOOL inATabDraggingOverlayWindow; @property(assign, nonatomic) BOOL inATabDraggingOverlayWindow;
// Name starts with "get" because methods staring with "new" return retained
// objects according to Cocoa's create rule.
- (NewTabButtonCocoa*)getNewTabButton;
// Leaving visual effects enabled when fullscreen results in higher power // Leaving visual effects enabled when fullscreen results in higher power
// consumption. This is used to disable effects when fullscreen. // consumption. This is used to disable effects when fullscreen.
- (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen; - (void)setVisualEffectsDisabledForFullscreen:(BOOL)fullscreen;
...@@ -61,8 +54,4 @@ ...@@ -61,8 +54,4 @@
- (BOOL)doubleClickMinimizesWindow; - (BOOL)doubleClickMinimizesWindow;
@end @end
@interface TabStripView (TestingAPI)
- (void)setNewTabButton:(NewTabButtonCocoa*)button;
@end
#endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_ #endif // CHROME_BROWSER_UI_COCOA_TABS_TAB_STRIP_VIEW_H_
...@@ -14,7 +14,6 @@ ...@@ -14,7 +14,6 @@
#include "chrome/browser/themes/theme_service.h" #include "chrome/browser/themes/theme_service.h"
#import "chrome/browser/ui/cocoa/browser_window_controller.h" #import "chrome/browser/ui/cocoa/browser_window_controller.h"
#import "chrome/browser/ui/cocoa/browser_window_layout.h" #import "chrome/browser/ui/cocoa/browser_window_layout.h"
#import "chrome/browser/ui/cocoa/new_tab_button.h"
#import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
#import "chrome/browser/ui/cocoa/tabs/tab_view.h" #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
#import "chrome/browser/ui/cocoa/view_id_util.h" #import "chrome/browser/ui/cocoa/view_id_util.h"
...@@ -36,10 +35,6 @@ ...@@ -36,10 +35,6 @@
- (id)initWithFrame:(NSRect)frame { - (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame]; self = [super initWithFrame:frame];
if (self) { if (self) {
newTabButton_.reset(
[[NewTabButtonCocoa alloc] initWithFrame:NSMakeRect(295, 0, 40, 27)]);
[newTabButton_ setToolTip:l10n_util::GetNSString(IDS_TOOLTIP_NEW_TAB)];
// Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless // Set lastMouseUp_ = -1000.0 so that timestamp-lastMouseUp_ is big unless
// lastMouseUp_ has been reset. // lastMouseUp_ has been reset.
lastMouseUp_ = -1000.0; lastMouseUp_ = -1000.0;
...@@ -347,14 +342,6 @@ ...@@ -347,14 +342,6 @@
return VIEW_ID_TAB_STRIP; return VIEW_ID_TAB_STRIP;
} }
- (NewTabButtonCocoa*)getNewTabButton {
return newTabButton_;
}
- (void)setNewTabButton:(NewTabButtonCocoa*)button {
newTabButton_.reset([button retain]);
}
- (NSVisualEffectView*)visualEffectView API_AVAILABLE(macos(10.10)) { - (NSVisualEffectView*)visualEffectView API_AVAILABLE(macos(10.10)) {
return [[BrowserWindowController return [[BrowserWindowController
browserWindowControllerForWindow:[self window]] visualEffectView]; browserWindowControllerForWindow:[self window]] visualEffectView];
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment