Commit fe9b4b72 authored by Gauthier Ambard's avatar Gauthier Ambard Committed by Commit Bot

[iOS] Rename ToolbarSearchButton to NewTab

The button is no longer used for search, it is now used for opening new
tab.

Fixed: 974751
Change-Id: I7de359e3c8801ec3f936a19cdb6b16358a48c47e
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2106851
Auto-Submit: Gauthier Ambard <gambard@chromium.org>
Commit-Queue: Olivier Robin <olivierrobin@chromium.org>
Reviewed-by: default avatarOlivier Robin <olivierrobin@chromium.org>
Cr-Commit-Position: refs/heads/master@{#752401}
parent 217e5314
...@@ -15,8 +15,8 @@ source_set("buttons") { ...@@ -15,8 +15,8 @@ source_set("buttons") {
"toolbar_component_options.h", "toolbar_component_options.h",
"toolbar_configuration.h", "toolbar_configuration.h",
"toolbar_configuration.mm", "toolbar_configuration.mm",
"toolbar_search_button.h", "toolbar_new_tab_button.h",
"toolbar_search_button.mm", "toolbar_new_tab_button.mm",
"toolbar_style.h", "toolbar_style.h",
"toolbar_tab_grid_button.h", "toolbar_tab_grid_button.h",
"toolbar_tab_grid_button.mm", "toolbar_tab_grid_button.mm",
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button_actions_handler.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button_visibility_configuration.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button_visibility_configuration.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_new_tab_button.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tab_grid_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tab_grid_button.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tools_menu_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_tools_menu_button.h"
#import "ios/chrome/browser/ui/toolbar/public/features.h" #import "ios/chrome/browser/ui/toolbar/public/features.h"
...@@ -169,9 +169,8 @@ ...@@ -169,9 +169,8 @@
} }
- (ToolbarButton*)openNewTabButton { - (ToolbarButton*)openNewTabButton {
UIImage* buttonImage = [UIImage imageNamed:@"toolbar_new_tab_page"]; ToolbarNewTabButton* newTabButton = [ToolbarNewTabButton
ToolbarSearchButton* newTabButton = toolbarButtonWithImage:[UIImage imageNamed:@"toolbar_new_tab_page"]];
[ToolbarSearchButton toolbarButtonWithImage:buttonImage];
[newTabButton addTarget:self.actionHandler [newTabButton addTarget:self.actionHandler
action:@selector(searchAction:) action:@selector(searchAction:)
......
...@@ -2,16 +2,15 @@ ...@@ -2,16 +2,15 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_SEARCH_BUTTON_H_ #ifndef IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_NEW_TAB_BUTTON_H_
#define IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_SEARCH_BUTTON_H_ #define IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_NEW_TAB_BUTTON_H_
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_button.h"
// TODO(crbug.com/974751): Rename this as the button is no longer for search. // Toolbar button used to display the new tab button with a circle-shaped
// Toolbar button used to display the search button with a pill-shaped
// background view which is also used as the spotlight view. // background view which is also used as the spotlight view.
@interface ToolbarSearchButton : ToolbarButton @interface ToolbarNewTabButton : ToolbarButton
@end @end
#endif // IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_SEARCH_BUTTON_H_ #endif // IOS_CHROME_BROWSER_UI_TOOLBAR_BUTTONS_TOOLBAR_NEW_TAB_BUTTON_H_
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be // Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file. // found in the LICENSE file.
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_search_button.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_new_tab_button.h"
#import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h" #import "ios/chrome/browser/ui/toolbar/buttons/toolbar_configuration.h"
#import "ios/chrome/browser/ui/toolbar/public/features.h" #import "ios/chrome/browser/ui/toolbar/public/features.h"
...@@ -17,10 +17,10 @@ namespace { ...@@ -17,10 +17,10 @@ namespace {
const CGFloat kSpotlightHeight = 36.0f; const CGFloat kSpotlightHeight = 36.0f;
} // namespace } // namespace
@implementation ToolbarSearchButton @implementation ToolbarNewTabButton
+ (instancetype)toolbarButtonWithImage:(UIImage*)image { + (instancetype)toolbarButtonWithImage:(UIImage*)image {
ToolbarSearchButton* button = [super toolbarButtonWithImage:image]; ToolbarNewTabButton* button = [super toolbarButtonWithImage:image];
return button; return button;
} }
......
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