Merge views::CustomButton into views::Button.
Bug: 155363 Change-Id: I7e4922fcb73a185b873acf3525dd252603ca8f62 Reviewed-on: https://chromium-review.googlesource.com/617407 Commit-Queue: Evan Stade <estade@chromium.org> Reviewed-by: Scott Violet <sky@chromium.org> Cr-Commit-Position: refs/heads/master@{#495215}
This commit is contained in:
apps/ui/views
ash
frame
login
shelf
app_list_button.ccoverflow_button.ccoverflow_button.hshelf_button.ccshelf_button.hshelf_view_unittest.cc
system
audio
date
display_scale
network
tiles
tray
actionable_view.ccactionable_view.htray_details_view.cctray_details_view.htray_popup_header_button.htray_popup_utils.cctray_popup_utils.h
tray_accessibility.huser
wm
overview
chrome/browser
chromeos
ui
views
apps
app_info_dialog
bookmarks
content_setting_bubble_contents.ccdownload
frame
opaque_browser_frame_view.ccopaque_browser_frame_view_layout_unittest.ccwindows_10_caption_button.ccwindows_10_caption_button.h
ime
location_bar
bubble_icon_view.ccbubble_icon_view.hicon_label_bubble_view.ccicon_label_bubble_view.hkeyword_hint_view.cckeyword_hint_view.h
passwords
payments
profiles
tabs
toolbar
try_chrome_dialog_view.cccontent/shell/browser
ui
app_list
views
app_list_item_view.ccapp_list_item_view.happ_list_main_view.ccexpand_arrow_view.ccexpand_arrow_view.hpage_switcher_horizontal.ccpage_switcher_vertical.ccsearch_box_view.ccsearch_result_actions_view.ccsearch_result_answer_card_view.ccsearch_result_view.ccsearch_result_view.htile_item_view.cctile_item_view.h
chromeos
message_center
views
message_center_button_bar.ccmessage_view.ccnotification_button.ccnotification_button.hnotification_control_buttons_view.ccnotification_control_buttons_view.hnotification_header_view.ccnotification_header_view.hnotification_view_md_unittest.ccnotification_view_unittest.ccnotifier_settings_view.ccnotifier_settings_view.h
views
BUILD.gn
accessibility
bubble
controls
button
button.ccbutton.hbutton_unittest.cccustom_button.cccustom_button.himage_button.ccimage_button.himage_button_factory.ccimage_button_factory_unittest.ccimage_button_unittest.cclabel_button.cclabel_button.hlabel_button_unittest.ccmd_text_button.ccmenu_button.ccmenu_button.hmenu_button_unittest.cctoggle_button.cctoggle_button.h
combobox
menu
scrollbar
examples
style
widget
window
@ -62,13 +62,13 @@ void AppWindowFrameView::Init() {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
close_button_ = new views::ImageButton(this);
|
||||
close_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia());
|
||||
close_button_->SetImage(
|
||||
views::CustomButton::STATE_HOVERED,
|
||||
views::Button::STATE_HOVERED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_H).ToImageSkia());
|
||||
close_button_->SetImage(
|
||||
views::CustomButton::STATE_PRESSED,
|
||||
views::Button::STATE_PRESSED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_P).ToImageSkia());
|
||||
close_button_->SetAccessibleName(
|
||||
l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE));
|
||||
@ -76,33 +76,33 @@ void AppWindowFrameView::Init() {
|
||||
// STATE_NORMAL images are set in SetButtonImagesForFrame, not here.
|
||||
maximize_button_ = new views::ImageButton(this);
|
||||
maximize_button_->SetImage(
|
||||
views::CustomButton::STATE_HOVERED,
|
||||
views::Button::STATE_HOVERED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MAXIMIZE_H).ToImageSkia());
|
||||
maximize_button_->SetImage(
|
||||
views::CustomButton::STATE_PRESSED,
|
||||
views::Button::STATE_PRESSED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MAXIMIZE_P).ToImageSkia());
|
||||
maximize_button_->SetImage(
|
||||
views::CustomButton::STATE_DISABLED,
|
||||
views::Button::STATE_DISABLED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MAXIMIZE_D).ToImageSkia());
|
||||
maximize_button_->SetAccessibleName(
|
||||
l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MAXIMIZE));
|
||||
AddChildView(maximize_button_);
|
||||
restore_button_ = new views::ImageButton(this);
|
||||
restore_button_->SetImage(
|
||||
views::CustomButton::STATE_HOVERED,
|
||||
views::Button::STATE_HOVERED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE_H).ToImageSkia());
|
||||
restore_button_->SetImage(
|
||||
views::CustomButton::STATE_PRESSED,
|
||||
views::Button::STATE_PRESSED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE_P).ToImageSkia());
|
||||
restore_button_->SetAccessibleName(
|
||||
l10n_util::GetStringUTF16(IDS_APP_ACCNAME_RESTORE));
|
||||
AddChildView(restore_button_);
|
||||
minimize_button_ = new views::ImageButton(this);
|
||||
minimize_button_->SetImage(
|
||||
views::CustomButton::STATE_HOVERED,
|
||||
views::Button::STATE_HOVERED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE_H).ToImageSkia());
|
||||
minimize_button_->SetImage(
|
||||
views::CustomButton::STATE_PRESSED,
|
||||
views::Button::STATE_PRESSED,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE_P).ToImageSkia());
|
||||
minimize_button_->SetAccessibleName(
|
||||
l10n_util::GetStringUTF16(IDS_APP_ACCNAME_MINIMIZE));
|
||||
@ -275,12 +275,12 @@ void AppWindowFrameView::Layout() {
|
||||
maximize_button_->SetVisible(!maximized);
|
||||
restore_button_->SetVisible(maximized);
|
||||
if (maximized)
|
||||
maximize_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
maximize_button_->SetState(views::Button::STATE_NORMAL);
|
||||
else
|
||||
restore_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
restore_button_->SetState(views::Button::STATE_NORMAL);
|
||||
|
||||
gfx::Size minimize_size = minimize_button_->GetPreferredSize();
|
||||
minimize_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
minimize_button_->SetState(views::Button::STATE_NORMAL);
|
||||
minimize_button_->SetBounds(
|
||||
maximize_button_->x() - kButtonSpacing - minimize_size.width(),
|
||||
kButtonOffsetY,
|
||||
@ -295,11 +295,11 @@ void AppWindowFrameView::OnPaint(gfx::Canvas* canvas) {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
if (ShouldPaintAsActive()) {
|
||||
close_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE).ToImageSkia());
|
||||
} else {
|
||||
close_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_CLOSE_U).ToImageSkia());
|
||||
}
|
||||
|
||||
@ -380,23 +380,23 @@ void AppWindowFrameView::SetButtonImagesForFrame() {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
if (use_light) {
|
||||
maximize_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MAXIMIZE_L).ToImageSkia());
|
||||
restore_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE_L).ToImageSkia());
|
||||
minimize_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE_L).ToImageSkia());
|
||||
} else {
|
||||
maximize_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MAXIMIZE).ToImageSkia());
|
||||
restore_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_RESTORE).ToImageSkia());
|
||||
minimize_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_APP_WINDOW_MINIMIZE).ToImageSkia());
|
||||
}
|
||||
}
|
||||
|
@ -37,7 +37,7 @@ const char FrameCaptionButton::kViewClassName[] = "FrameCaptionButton";
|
||||
|
||||
FrameCaptionButton::FrameCaptionButton(views::ButtonListener* listener,
|
||||
CaptionButtonIcon icon)
|
||||
: CustomButton(listener),
|
||||
: Button(listener),
|
||||
icon_(icon),
|
||||
paint_as_active_(false),
|
||||
use_light_images_(false),
|
||||
@ -102,7 +102,7 @@ const char* FrameCaptionButton::GetClassName() const {
|
||||
}
|
||||
|
||||
void FrameCaptionButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
// CustomButton does not become pressed when the user drags off and then back
|
||||
// Button does not become pressed when the user drags off and then back
|
||||
// onto the button. Make FrameCaptionButton pressed in this case because this
|
||||
// behavior is more consistent with AlternateFrameSizeButton.
|
||||
if (event->type() == ui::ET_GESTURE_SCROLL_BEGIN ||
|
||||
@ -121,7 +121,7 @@ void FrameCaptionButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
event->StopPropagation();
|
||||
}
|
||||
}
|
||||
CustomButton::OnGestureEvent(event);
|
||||
Button::OnGestureEvent(event);
|
||||
}
|
||||
|
||||
views::PaintInfo::ScaleType FrameCaptionButton::GetPaintScaleType() const {
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ash/frame/caption_buttons/caption_button_types.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/image/image_skia.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace gfx {
|
||||
class SlideAnimation;
|
||||
@ -22,7 +22,7 @@ namespace ash {
|
||||
|
||||
// Base class for the window caption buttons (minimize, maximize, restore,
|
||||
// close).
|
||||
class ASH_EXPORT FrameCaptionButton : public views::CustomButton {
|
||||
class ASH_EXPORT FrameCaptionButton : public views::Button {
|
||||
public:
|
||||
enum Animate { ANIMATE_YES, ANIMATE_NO };
|
||||
|
||||
@ -60,7 +60,7 @@ class ASH_EXPORT FrameCaptionButton : public views::CustomButton {
|
||||
CaptionButtonIcon icon() const { return icon_; }
|
||||
|
||||
protected:
|
||||
// views::CustomButton override:
|
||||
// views::Button override:
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
||||
private:
|
||||
|
@ -38,7 +38,7 @@ class ASH_EXPORT FrameSizeButton : public FrameCaptionButton {
|
||||
|
||||
~FrameSizeButton() override;
|
||||
|
||||
// views::CustomButton overrides:
|
||||
// views::Button overrides:
|
||||
bool OnMousePressed(const ui::MouseEvent& event) override;
|
||||
bool OnMouseDragged(const ui::MouseEvent& event) override;
|
||||
void OnMouseReleased(const ui::MouseEvent& event) override;
|
||||
|
@ -69,10 +69,10 @@ int GetViewIdForPinNumber(int number) {
|
||||
}
|
||||
|
||||
// A base class for pin button in the pin keyboard.
|
||||
class BasePinButton : public views::CustomButton, public views::ButtonListener {
|
||||
class BasePinButton : public views::Button, public views::ButtonListener {
|
||||
public:
|
||||
explicit BasePinButton(const base::Closure& on_press)
|
||||
: views::CustomButton(this), on_press_(on_press) {
|
||||
: views::Button(this), on_press_(on_press) {
|
||||
SetFocusBehavior(FocusBehavior::ALWAYS);
|
||||
SetPreferredSize(
|
||||
gfx::Size(LoginPinView::kButtonSizeDp, LoginPinView::kButtonSizeDp));
|
||||
|
@ -187,7 +187,7 @@ int LoginUserView::WidthForLayoutStyle(LoginDisplayStyle style) {
|
||||
LoginUserView::LoginUserView(LoginDisplayStyle style,
|
||||
bool show_dropdown,
|
||||
const OnTap& on_tap)
|
||||
: views::CustomButton(this), on_tap_(on_tap), display_style_(style) {
|
||||
: views::Button(this), on_tap_(on_tap), display_style_(style) {
|
||||
// show_dropdown can only be true when the user view is rendering in large
|
||||
// mode.
|
||||
DCHECK(!show_dropdown || style == LoginDisplayStyle::kLarge);
|
||||
@ -366,4 +366,4 @@ gfx::Size LoginUserView::CalculatePreferredSize() const {
|
||||
return gfx::Size();
|
||||
}
|
||||
|
||||
} // namespace ash
|
||||
} // namespace ash
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "ash/login/ui/login_display_style.h"
|
||||
#include "ash/public/interfaces/user_info.mojom.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
namespace views {
|
||||
@ -20,7 +20,7 @@ namespace ash {
|
||||
|
||||
// Display the user's profile icon, name, and a menu icon in various layout
|
||||
// styles.
|
||||
class ASH_EXPORT LoginUserView : public views::CustomButton,
|
||||
class ASH_EXPORT LoginUserView : public views::Button,
|
||||
public views::ButtonListener {
|
||||
public:
|
||||
// TestApi is used for tests to get internal implementation details.
|
||||
@ -54,7 +54,7 @@ class ASH_EXPORT LoginUserView : public views::CustomButton,
|
||||
|
||||
const mojom::UserInfoPtr& current_user() const { return current_user_; }
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
const char* GetClassName() const override;
|
||||
gfx::Size CalculatePreferredSize() const override;
|
||||
|
||||
@ -88,4 +88,4 @@ class ASH_EXPORT LoginUserView : public views::CustomButton,
|
||||
|
||||
} // namespace ash
|
||||
|
||||
#endif // ASH_LOGIN_UI_LOGIN_USER_VIEW_H_
|
||||
#endif // ASH_LOGIN_UI_LOGIN_USER_VIEW_H_
|
||||
|
@ -83,7 +83,7 @@ AppListButton::AppListButton(InkDropButtonListener* listener,
|
||||
l10n_util::GetStringUTF16(IDS_ASH_SHELF_APP_LIST_LAUNCHER_TITLE));
|
||||
SetSize(gfx::Size(kShelfSize, kShelfSize));
|
||||
SetFocusPainter(TrayPopupUtils::CreateFocusPainter());
|
||||
set_notify_action(CustomButton::NOTIFY_ON_PRESS);
|
||||
set_notify_action(Button::NOTIFY_ON_PRESS);
|
||||
|
||||
// Disable canvas flipping for this view, otherwise there will be a lot of
|
||||
// edge cases with ink drops, events, etc. in tablet mode where we have two
|
||||
@ -271,7 +271,7 @@ bool AppListButton::ShouldEnterPushedState(const ui::Event& event) {
|
||||
|
||||
std::unique_ptr<views::InkDrop> AppListButton::CreateInkDrop() {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
Button::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(false);
|
||||
return std::move(ink_drop);
|
||||
}
|
||||
|
@ -22,7 +22,7 @@
|
||||
namespace ash {
|
||||
|
||||
OverflowButton::OverflowButton(ShelfView* shelf_view, Shelf* shelf)
|
||||
: CustomButton(nullptr),
|
||||
: Button(nullptr),
|
||||
upward_image_(gfx::CreateVectorIcon(kShelfOverflowIcon, kShelfIconColor)),
|
||||
chevron_image_(nullptr),
|
||||
shelf_view_(shelf_view),
|
||||
@ -129,11 +129,11 @@ bool OverflowButton::ShouldEnterPushedState(const ui::Event& event) {
|
||||
if (shelf_view_->IsShowingOverflowBubble())
|
||||
return false;
|
||||
|
||||
return CustomButton::ShouldEnterPushedState(event);
|
||||
return Button::ShouldEnterPushedState(event);
|
||||
}
|
||||
|
||||
void OverflowButton::NotifyClick(const ui::Event& event) {
|
||||
CustomButton::NotifyClick(event);
|
||||
Button::NotifyClick(event);
|
||||
shelf_view_->ButtonPressed(this, event, GetInkDrop());
|
||||
}
|
||||
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/gfx/image/image_skia.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace ash {
|
||||
|
||||
@ -17,7 +17,7 @@ class Shelf;
|
||||
class ShelfView;
|
||||
|
||||
// Shelf overflow chevron button.
|
||||
class ASH_EXPORT OverflowButton : public views::CustomButton {
|
||||
class ASH_EXPORT OverflowButton : public views::Button {
|
||||
public:
|
||||
// |shelf_view| is the view containing this button.
|
||||
OverflowButton(ShelfView* shelf_view, Shelf* shelf);
|
||||
@ -42,7 +42,7 @@ class ASH_EXPORT OverflowButton : public views::CustomButton {
|
||||
// Updates the chevron image according to GetChevronDirection().
|
||||
void UpdateChevronImage();
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
|
||||
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
|
||||
bool ShouldEnterPushedState(const ui::Event& event) override;
|
||||
|
@ -206,7 +206,7 @@ class ShelfButton::AppStatusIndicatorView
|
||||
const char ShelfButton::kViewClassName[] = "ash/ShelfButton";
|
||||
|
||||
ShelfButton::ShelfButton(InkDropButtonListener* listener, ShelfView* shelf_view)
|
||||
: CustomButton(nullptr),
|
||||
: Button(nullptr),
|
||||
listener_(listener),
|
||||
shelf_view_(shelf_view),
|
||||
icon_view_(new views::ImageView()),
|
||||
@ -313,7 +313,7 @@ void ShelfButton::ShowContextMenu(const gfx::Point& p,
|
||||
bool destroyed = false;
|
||||
destroyed_flag_ = &destroyed;
|
||||
|
||||
CustomButton::ShowContextMenu(p, source_type);
|
||||
Button::ShowContextMenu(p, source_type);
|
||||
|
||||
if (!destroyed) {
|
||||
destroyed_flag_ = nullptr;
|
||||
@ -333,24 +333,24 @@ const char* ShelfButton::GetClassName() const {
|
||||
}
|
||||
|
||||
bool ShelfButton::OnMousePressed(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMousePressed(event);
|
||||
Button::OnMousePressed(event);
|
||||
shelf_view_->PointerPressedOnButton(this, ShelfView::MOUSE, event);
|
||||
return true;
|
||||
}
|
||||
|
||||
void ShelfButton::OnMouseReleased(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMouseReleased(event);
|
||||
Button::OnMouseReleased(event);
|
||||
shelf_view_->PointerReleasedOnButton(this, ShelfView::MOUSE, false);
|
||||
}
|
||||
|
||||
void ShelfButton::OnMouseCaptureLost() {
|
||||
ClearState(STATE_HOVERED);
|
||||
shelf_view_->PointerReleasedOnButton(this, ShelfView::MOUSE, true);
|
||||
CustomButton::OnMouseCaptureLost();
|
||||
Button::OnMouseCaptureLost();
|
||||
}
|
||||
|
||||
bool ShelfButton::OnMouseDragged(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMouseDragged(event);
|
||||
Button::OnMouseDragged(event);
|
||||
shelf_view_->PointerDraggedOnButton(this, ShelfView::MOUSE, event);
|
||||
return true;
|
||||
}
|
||||
@ -432,22 +432,22 @@ void ShelfButton::ChildPreferredSizeChanged(views::View* child) {
|
||||
|
||||
void ShelfButton::OnFocus() {
|
||||
AddState(STATE_FOCUSED);
|
||||
CustomButton::OnFocus();
|
||||
Button::OnFocus();
|
||||
}
|
||||
|
||||
void ShelfButton::OnBlur() {
|
||||
ClearState(STATE_FOCUSED);
|
||||
CustomButton::OnBlur();
|
||||
Button::OnBlur();
|
||||
}
|
||||
|
||||
void ShelfButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
switch (event->type()) {
|
||||
case ui::ET_GESTURE_TAP_DOWN:
|
||||
AddState(STATE_HOVERED);
|
||||
return CustomButton::OnGestureEvent(event);
|
||||
return Button::OnGestureEvent(event);
|
||||
case ui::ET_GESTURE_END:
|
||||
ClearState(STATE_HOVERED);
|
||||
return CustomButton::OnGestureEvent(event);
|
||||
return Button::OnGestureEvent(event);
|
||||
case ui::ET_GESTURE_SCROLL_BEGIN:
|
||||
shelf_view_->PointerPressedOnButton(this, ShelfView::TOUCH, *event);
|
||||
event->SetHandled();
|
||||
@ -462,7 +462,7 @@ void ShelfButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
event->SetHandled();
|
||||
return;
|
||||
default:
|
||||
return CustomButton::OnGestureEvent(event);
|
||||
return Button::OnGestureEvent(event);
|
||||
}
|
||||
}
|
||||
|
||||
@ -479,18 +479,18 @@ bool ShelfButton::ShouldEnterPushedState(const ui::Event& event) {
|
||||
if (!shelf_view_->ShouldEventActivateButton(this, event))
|
||||
return false;
|
||||
|
||||
return CustomButton::ShouldEnterPushedState(event);
|
||||
return Button::ShouldEnterPushedState(event);
|
||||
}
|
||||
|
||||
std::unique_ptr<views::InkDrop> ShelfButton::CreateInkDrop() {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
Button::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(false);
|
||||
return std::move(ink_drop);
|
||||
}
|
||||
|
||||
void ShelfButton::NotifyClick(const ui::Event& event) {
|
||||
CustomButton::NotifyClick(event);
|
||||
Button::NotifyClick(event);
|
||||
if (listener_)
|
||||
listener_->ButtonPressed(this, event, GetInkDrop());
|
||||
}
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "ash/ash_export.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/shadow_value.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace views {
|
||||
class ImageView;
|
||||
@ -19,7 +19,7 @@ class InkDropButtonListener;
|
||||
class ShelfView;
|
||||
|
||||
// Button used for items on the launcher, except for the AppList.
|
||||
class ASH_EXPORT ShelfButton : public views::CustomButton {
|
||||
class ASH_EXPORT ShelfButton : public views::Button {
|
||||
public:
|
||||
static const char kViewClassName[];
|
||||
|
||||
@ -61,7 +61,7 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
|
||||
// Called when user started dragging the shelf button.
|
||||
void OnDragStarted(const ui::LocatedEvent* event);
|
||||
|
||||
// Overrides to views::CustomButton:
|
||||
// Overrides to views::Button:
|
||||
void ShowContextMenu(const gfx::Point& p,
|
||||
ui::MenuSourceType source_type) override;
|
||||
|
||||
@ -83,7 +83,7 @@ class ASH_EXPORT ShelfButton : public views::CustomButton {
|
||||
// ui::EventHandler overrides:
|
||||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
|
||||
// views::CustomButton overrides:
|
||||
// views::Button overrides:
|
||||
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
|
||||
bool ShouldEnterPushedState(const ui::Event& event) override;
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
|
||||
|
@ -2447,7 +2447,7 @@ TEST_F(ShelfViewInkDropTest, AppListButtonGestureTapDragWhenVisible) {
|
||||
TEST_F(ShelfViewInkDropTest, ShelfButtonWithoutMenuPressRelease) {
|
||||
InitBrowserButtonInkDrop();
|
||||
|
||||
views::CustomButton* button = browser_button_;
|
||||
views::Button* button = browser_button_;
|
||||
gfx::Point mouse_location = button->GetLocalBounds().CenterPoint();
|
||||
|
||||
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, mouse_location,
|
||||
@ -2474,7 +2474,7 @@ TEST_F(ShelfViewInkDropTest, ShelfButtonWithoutMenuPressRelease) {
|
||||
TEST_F(ShelfViewInkDropTest, ShelfButtonWithoutMenuPressDragReleaseOutside) {
|
||||
InitBrowserButtonInkDrop();
|
||||
|
||||
views::CustomButton* button = browser_button_;
|
||||
views::Button* button = browser_button_;
|
||||
gfx::Point mouse_location = button->GetLocalBounds().CenterPoint();
|
||||
|
||||
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, mouse_location,
|
||||
@ -2521,7 +2521,7 @@ TEST_F(ShelfViewInkDropTest, ShelfButtonWithoutMenuPressDragReleaseOutside) {
|
||||
TEST_F(ShelfViewInkDropTest, ShelfButtonWithoutMenuPressDragReleaseInside) {
|
||||
InitBrowserButtonInkDrop();
|
||||
|
||||
views::CustomButton* button = browser_button_;
|
||||
views::Button* button = browser_button_;
|
||||
gfx::Point mouse_location = button->GetLocalBounds().CenterPoint();
|
||||
|
||||
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, mouse_location,
|
||||
@ -2572,7 +2572,7 @@ TEST_F(ShelfViewInkDropTest, ShelfButtonWithMenuPressRelease) {
|
||||
model_->SetShelfItemDelegate(model_->items()[1].id,
|
||||
base::MakeUnique<ListMenuShelfItemDelegate>());
|
||||
|
||||
views::CustomButton* button = browser_button_;
|
||||
views::Button* button = browser_button_;
|
||||
gfx::Point mouse_location = button->GetLocalBounds().CenterPoint();
|
||||
|
||||
ui::MouseEvent press_event(ui::ET_MOUSE_PRESSED, mouse_location,
|
||||
|
@ -24,7 +24,7 @@
|
||||
#include "ui/native_theme/native_theme.h"
|
||||
#include "ui/views/background.h"
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/image_view.h"
|
||||
#include "ui/views/controls/slider.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ui/views/view.h"
|
||||
|
||||
namespace views {
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class ImageView;
|
||||
}
|
||||
|
||||
@ -54,7 +54,7 @@ class VolumeView : public views::View,
|
||||
// The only immediate child view of |this|. All other view elements are added
|
||||
// to the |tri_view_| to handle layout.
|
||||
TriView* tri_view_;
|
||||
views::CustomButton* more_button_;
|
||||
views::Button* more_button_;
|
||||
VolumeButton* icon_;
|
||||
views::Slider* slider_;
|
||||
views::ImageView* device_type_;
|
||||
|
@ -246,7 +246,7 @@ bool TimeView::OnMousePressed(const ui::MouseEvent& event) {
|
||||
}
|
||||
|
||||
void TimeView::OnGestureEvent(ui::GestureEvent* event) {
|
||||
// Skip gesture handling happening in CustomButton so that the container views
|
||||
// Skip gesture handling happening in Button so that the container views
|
||||
// receive and handle them properly.
|
||||
// TODO(mohsen): Refactor TimeView/DateView classes so that they are not
|
||||
// ActionableView anymore. Create an ActionableView as a container for when
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ui/views/view.h"
|
||||
|
||||
namespace views {
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class Label;
|
||||
}
|
||||
|
||||
@ -43,7 +43,7 @@ class ScaleView : public views::View,
|
||||
// The only immediate child view of |this|. All other view elements are added
|
||||
// to the |tri_view_| to handle layout.
|
||||
TriView* tri_view_;
|
||||
views::CustomButton* more_button_;
|
||||
views::Button* more_button_;
|
||||
views::Label* label_;
|
||||
views::Slider* slider_;
|
||||
bool is_default_view_;
|
||||
|
@ -25,7 +25,6 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/views/bubble/bubble_dialog_delegate.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
#include "ui/views/layout/layout_manager.h"
|
||||
|
@ -15,7 +15,7 @@
|
||||
namespace views {
|
||||
class BubbleDialogDelegateView;
|
||||
class Button;
|
||||
class CustomButton;
|
||||
class Button;
|
||||
}
|
||||
|
||||
namespace ash {
|
||||
@ -80,9 +80,9 @@ class NetworkStateListDetailedView
|
||||
// Track login state.
|
||||
LoginStatus login_;
|
||||
|
||||
views::CustomButton* info_button_;
|
||||
views::CustomButton* settings_button_;
|
||||
views::CustomButton* proxy_settings_button_;
|
||||
views::Button* info_button_;
|
||||
views::Button* settings_button_;
|
||||
views::Button* proxy_settings_button_;
|
||||
|
||||
// A small bubble for displaying network info.
|
||||
views::BubbleDialogDelegateView* info_bubble_;
|
||||
|
@ -26,7 +26,7 @@
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/separator.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
|
||||
@ -143,8 +143,7 @@ views::View* TilesDefaultView::GetHelpButtonView() const {
|
||||
return help_button_;
|
||||
}
|
||||
|
||||
const views::CustomButton* TilesDefaultView::GetShutdownButtonViewForTest()
|
||||
const {
|
||||
const views::Button* TilesDefaultView::GetShutdownButtonViewForTest() const {
|
||||
return power_button_;
|
||||
}
|
||||
|
||||
|
@ -11,7 +11,7 @@
|
||||
#include "ui/views/view.h"
|
||||
|
||||
namespace views {
|
||||
class CustomButton;
|
||||
class Button;
|
||||
}
|
||||
|
||||
namespace ash {
|
||||
@ -37,7 +37,7 @@ class ASH_EXPORT TilesDefaultView : public views::View,
|
||||
// Accessor needed to obtain the help button view for the first-run flow.
|
||||
views::View* GetHelpButtonView() const;
|
||||
|
||||
const views::CustomButton* GetShutdownButtonViewForTest() const;
|
||||
const views::Button* GetShutdownButtonViewForTest() const;
|
||||
|
||||
private:
|
||||
friend class TrayTilesTest;
|
||||
@ -47,11 +47,11 @@ class ASH_EXPORT TilesDefaultView : public views::View,
|
||||
// Pointers to the child buttons of |this|. Note that some buttons may not
|
||||
// exist (depending on the user's current login status, for instance), in
|
||||
// which case the corresponding pointer will be null.
|
||||
views::CustomButton* settings_button_;
|
||||
views::CustomButton* help_button_;
|
||||
views::Button* settings_button_;
|
||||
views::Button* help_button_;
|
||||
NightLightToggleButton* night_light_button_;
|
||||
views::CustomButton* lock_button_;
|
||||
views::CustomButton* power_button_;
|
||||
views::Button* lock_button_;
|
||||
views::Button* power_button_;
|
||||
|
||||
DISALLOW_COPY_AND_ASSIGN(TilesDefaultView);
|
||||
};
|
||||
|
@ -39,11 +39,11 @@ class TrayTilesTest : public NoSessionAshTestBase {
|
||||
NoSessionAshTestBase::TearDown();
|
||||
}
|
||||
|
||||
views::CustomButton* GetSettingsButton() {
|
||||
views::Button* GetSettingsButton() {
|
||||
return tray_tiles()->default_view_->settings_button_;
|
||||
}
|
||||
|
||||
views::CustomButton* GetHelpButton() {
|
||||
views::Button* GetHelpButton() {
|
||||
return tray_tiles()->default_view_->help_button_;
|
||||
}
|
||||
|
||||
@ -51,11 +51,11 @@ class TrayTilesTest : public NoSessionAshTestBase {
|
||||
return tray_tiles()->default_view_->night_light_button_;
|
||||
}
|
||||
|
||||
views::CustomButton* GetLockButton() {
|
||||
views::Button* GetLockButton() {
|
||||
return tray_tiles()->default_view_->lock_button_;
|
||||
}
|
||||
|
||||
views::CustomButton* GetPowerButton() {
|
||||
views::Button* GetPowerButton() {
|
||||
return tray_tiles()->default_view_->power_button_;
|
||||
}
|
||||
|
||||
|
@ -26,7 +26,7 @@ const char ActionableView::kViewClassName[] = "tray/ActionableView";
|
||||
|
||||
ActionableView::ActionableView(SystemTrayItem* owner,
|
||||
TrayPopupInkDropStyle ink_drop_style)
|
||||
: views::CustomButton(this),
|
||||
: views::Button(this),
|
||||
destroyed_(nullptr),
|
||||
owner_(owner),
|
||||
ink_drop_style_(ink_drop_style) {
|
||||
@ -59,7 +59,7 @@ bool ActionableView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
NotifyClick(event);
|
||||
return true;
|
||||
}
|
||||
return CustomButton::OnKeyPressed(event);
|
||||
return Button::OnKeyPressed(event);
|
||||
}
|
||||
|
||||
void ActionableView::SetAccessibleName(const base::string16& name) {
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "ash/system/tray/tray_popup_ink_drop_style.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/geometry/rect.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace ash {
|
||||
class SystemTrayItem;
|
||||
@ -22,9 +22,9 @@ class SystemTrayItem;
|
||||
// Exported for SystemTray.
|
||||
//
|
||||
// TODO(bruthig): Consider removing ActionableView and make clients use
|
||||
// CustomButtons instead. (See crbug.com/614453)
|
||||
// Buttons instead. (See crbug.com/614453)
|
||||
class ASH_EXPORT ActionableView : public views::ButtonListener,
|
||||
public views::CustomButton {
|
||||
public views::Button {
|
||||
public:
|
||||
static const char kViewClassName[];
|
||||
|
||||
@ -56,7 +56,7 @@ class ASH_EXPORT ActionableView : public views::ButtonListener,
|
||||
virtual void HandlePerformActionResult(bool action_performed,
|
||||
const ui::Event& event);
|
||||
|
||||
// Overridden from views::CustomButton.
|
||||
// Overridden from views::Button.
|
||||
const char* GetClassName() const override;
|
||||
bool OnKeyPressed(const ui::KeyEvent& event) override;
|
||||
void GetAccessibleNodeData(ui::AXNodeData* node_data) override;
|
||||
|
@ -408,7 +408,7 @@ void TrayDetailsView::ShowProgress(double value, bool visible) {
|
||||
child_at(kTitleRowSeparatorIndex)->SetVisible(!visible);
|
||||
}
|
||||
|
||||
views::CustomButton* TrayDetailsView::CreateSettingsButton(
|
||||
views::Button* TrayDetailsView::CreateSettingsButton(
|
||||
int setting_accessible_name_id) {
|
||||
SystemMenuButton* button =
|
||||
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
|
||||
@ -418,7 +418,7 @@ views::CustomButton* TrayDetailsView::CreateSettingsButton(
|
||||
return button;
|
||||
}
|
||||
|
||||
views::CustomButton* TrayDetailsView::CreateHelpButton() {
|
||||
views::Button* TrayDetailsView::CreateHelpButton() {
|
||||
SystemMenuButton* button =
|
||||
new SystemMenuButton(this, TrayPopupInkDropStyle::HOST_CENTERED,
|
||||
kSystemMenuHelpIcon, IDS_ASH_STATUS_TRAY_HELP);
|
||||
|
@ -21,7 +21,7 @@ struct VectorIcon;
|
||||
|
||||
namespace views {
|
||||
class BoxLayout;
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class ProgressBar;
|
||||
class ScrollView;
|
||||
} // namespace views
|
||||
@ -107,8 +107,8 @@ class ASH_EXPORT TrayDetailsView : public views::View,
|
||||
// Helper functions which create and return the settings and help buttons,
|
||||
// respectively, used in the material design top-most header row. The caller
|
||||
// assumes ownership of the returned buttons.
|
||||
views::CustomButton* CreateSettingsButton(int setting_accessible_name_id);
|
||||
views::CustomButton* CreateHelpButton();
|
||||
views::Button* CreateSettingsButton(int setting_accessible_name_id);
|
||||
views::Button* CreateHelpButton();
|
||||
|
||||
TriView* tri_view() { return tri_view_; }
|
||||
views::ScrollView* scroller() const { return scroller_; }
|
||||
|
@ -33,7 +33,7 @@ class ASH_EXPORT TrayPopupHeaderButton : public views::ToggleImageButton {
|
||||
const char* GetClassName() const override;
|
||||
gfx::Size CalculatePreferredSize() const override;
|
||||
|
||||
// Overridden from views::CustomButton:
|
||||
// Overridden from views::Button:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
|
||||
void Initialize(const gfx::ImageSkia& icon, int accessible_name_id);
|
||||
|
@ -259,7 +259,7 @@ std::unique_ptr<views::Painter> TrayPopupUtils::CreateFocusPainter() {
|
||||
kFocusBorderColor, kFocusBorderThickness, gfx::InsetsF());
|
||||
}
|
||||
|
||||
void TrayPopupUtils::ConfigureTrayPopupButton(views::CustomButton* button) {
|
||||
void TrayPopupUtils::ConfigureTrayPopupButton(views::Button* button) {
|
||||
button->SetFocusPainter(TrayPopupUtils::CreateFocusPainter());
|
||||
button->SetFocusForPlatform();
|
||||
|
||||
|
@ -15,7 +15,7 @@
|
||||
|
||||
namespace views {
|
||||
class ButtonListener;
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class ImageView;
|
||||
class InkDrop;
|
||||
class InkDropRipple;
|
||||
@ -121,7 +121,7 @@ class TrayPopupUtils {
|
||||
static std::unique_ptr<views::Painter> CreateFocusPainter();
|
||||
|
||||
// Common setup for various buttons in the system menu.
|
||||
static void ConfigureTrayPopupButton(views::CustomButton* button);
|
||||
static void ConfigureTrayPopupButton(views::Button* button);
|
||||
|
||||
// Sets up |view| to be a sticky header in a tray detail scroll view.
|
||||
static void ConfigureAsStickyHeader(views::View* view);
|
||||
|
@ -22,7 +22,7 @@ class TrayAccessibilityTest;
|
||||
|
||||
namespace views {
|
||||
class Button;
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class View;
|
||||
}
|
||||
|
||||
@ -57,8 +57,8 @@ class AccessibilityDetailedView : public TrayDetailsView {
|
||||
views::View* high_contrast_view_ = nullptr;
|
||||
views::View* screen_magnifier_view_ = nullptr;
|
||||
views::View* large_cursor_view_ = nullptr;
|
||||
views::CustomButton* help_view_ = nullptr;
|
||||
views::CustomButton* settings_view_ = nullptr;
|
||||
views::Button* help_view_ = nullptr;
|
||||
views::Button* settings_view_ = nullptr;
|
||||
views::View* autoclick_view_ = nullptr;
|
||||
views::View* virtual_keyboard_view_ = nullptr;
|
||||
views::View* mono_audio_view_ = nullptr;
|
||||
|
@ -26,7 +26,7 @@ namespace tray {
|
||||
ButtonFromView::ButtonFromView(views::View* content,
|
||||
views::ButtonListener* listener,
|
||||
TrayPopupInkDropStyle ink_drop_style)
|
||||
: CustomButton(listener),
|
||||
: Button(listener),
|
||||
content_(content),
|
||||
ink_drop_style_(ink_drop_style),
|
||||
button_hovered_(false),
|
||||
@ -56,8 +56,8 @@ void ButtonFromView::OnMouseExited(const ui::MouseEvent& event) {
|
||||
}
|
||||
|
||||
void ButtonFromView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
views::CustomButton::GetAccessibleNodeData(node_data);
|
||||
// If no label has been explicitly set via CustomButton::SetAccessibleName(),
|
||||
views::Button::GetAccessibleNodeData(node_data);
|
||||
// If no label has been explicitly set via Button::SetAccessibleName(),
|
||||
// use the content's label.
|
||||
if (node_data->GetStringAttribute(ui::AX_ATTR_NAME).empty()) {
|
||||
ui::AXNodeData content_data;
|
||||
@ -67,7 +67,7 @@ void ButtonFromView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
}
|
||||
|
||||
void ButtonFromView::Layout() {
|
||||
CustomButton::Layout();
|
||||
Button::Layout();
|
||||
if (ink_drop_container_)
|
||||
ink_drop_container_->SetBoundsRect(GetLocalBounds());
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
|
||||
#include "ash/system/tray/tray_popup_ink_drop_style.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace views {
|
||||
class InkDropContainerView;
|
||||
@ -19,7 +19,7 @@ namespace ash {
|
||||
namespace tray {
|
||||
|
||||
// This view is used to wrap it's content and transform it into button.
|
||||
class ButtonFromView : public views::CustomButton {
|
||||
class ButtonFromView : public views::Button {
|
||||
public:
|
||||
// The |content| is the content which is shown within the button. The
|
||||
// |button_listener| will be informed - if provided - when a button was
|
||||
@ -39,7 +39,7 @@ class ButtonFromView : public views::CustomButton {
|
||||
bool is_hovered_for_test() { return button_hovered_; }
|
||||
|
||||
protected:
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
void AddInkDropLayer(ui::Layer* ink_drop_layer) override;
|
||||
void RemoveInkDropLayer(ui::Layer* ink_drop_layer) override;
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
|
||||
|
@ -120,10 +120,10 @@ void SetupFadeInAfterLayout(views::Widget* widget) {
|
||||
// A Button that has a listener and listens to mouse / gesture events on the
|
||||
// visible part of an overview window. Note that the drag events are only
|
||||
// handled in maximized mode.
|
||||
class ShieldButton : public views::CustomButton {
|
||||
class ShieldButton : public views::Button {
|
||||
public:
|
||||
ShieldButton(views::ButtonListener* listener, const base::string16& name)
|
||||
: views::CustomButton(listener) {
|
||||
: views::Button(listener) {
|
||||
SetAccessibleName(name);
|
||||
}
|
||||
~ShieldButton() override {}
|
||||
@ -135,7 +135,7 @@ class ShieldButton : public views::CustomButton {
|
||||
// after the WindowSelectorItem has been destroyed.
|
||||
void ResetListener() { listener_ = nullptr; }
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
bool OnMousePressed(const ui::MouseEvent& event) override {
|
||||
if (listener() && SplitViewController::ShouldAllowSplitView()) {
|
||||
gfx::Point location(event.location());
|
||||
@ -143,7 +143,7 @@ class ShieldButton : public views::CustomButton {
|
||||
listener()->HandlePressEvent(location);
|
||||
return true;
|
||||
}
|
||||
return views::CustomButton::OnMousePressed(event);
|
||||
return views::Button::OnMousePressed(event);
|
||||
}
|
||||
|
||||
void OnMouseReleased(const ui::MouseEvent& event) override {
|
||||
@ -153,7 +153,7 @@ class ShieldButton : public views::CustomButton {
|
||||
listener()->HandleReleaseEvent(location);
|
||||
return;
|
||||
}
|
||||
views::CustomButton::OnMouseReleased(event);
|
||||
views::Button::OnMouseReleased(event);
|
||||
}
|
||||
|
||||
bool OnMouseDragged(const ui::MouseEvent& event) override {
|
||||
@ -163,7 +163,7 @@ class ShieldButton : public views::CustomButton {
|
||||
listener()->HandleDragEvent(location);
|
||||
return true;
|
||||
}
|
||||
return views::CustomButton::OnMouseDragged(event);
|
||||
return views::Button::OnMouseDragged(event);
|
||||
}
|
||||
|
||||
void OnGestureEvent(ui::GestureEvent* event) override {
|
||||
@ -187,7 +187,7 @@ class ShieldButton : public views::CustomButton {
|
||||
event->SetHandled();
|
||||
return;
|
||||
}
|
||||
views::CustomButton::OnGestureEvent(event);
|
||||
views::Button::OnGestureEvent(event);
|
||||
}
|
||||
|
||||
WindowSelectorItem* listener() {
|
||||
@ -207,7 +207,7 @@ class ShieldButton : public views::CustomButton {
|
||||
WindowSelectorItem::OverviewCloseButton::OverviewCloseButton(
|
||||
views::ButtonListener* listener)
|
||||
: views::ImageButton(listener) {
|
||||
SetImage(views::CustomButton::STATE_NORMAL,
|
||||
SetImage(views::Button::STATE_NORMAL,
|
||||
gfx::CreateVectorIcon(kWindowControlCloseIcon, kCloseButtonColor));
|
||||
SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
||||
views::ImageButton::ALIGN_MIDDLE);
|
||||
|
@ -338,22 +338,21 @@ void SimpleWebViewDialog::ExecuteCommandWithDisposition(
|
||||
void SimpleWebViewDialog::LoadImages() {
|
||||
const ui::ThemeProvider* tp = GetThemeProvider();
|
||||
|
||||
back_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
tp->GetImageSkiaNamed(IDR_BACK));
|
||||
back_->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
back_->SetImage(views::Button::STATE_NORMAL, tp->GetImageSkiaNamed(IDR_BACK));
|
||||
back_->SetImage(views::Button::STATE_HOVERED,
|
||||
tp->GetImageSkiaNamed(IDR_BACK_H));
|
||||
back_->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
back_->SetImage(views::Button::STATE_PRESSED,
|
||||
tp->GetImageSkiaNamed(IDR_BACK_P));
|
||||
back_->SetImage(views::CustomButton::STATE_DISABLED,
|
||||
back_->SetImage(views::Button::STATE_DISABLED,
|
||||
tp->GetImageSkiaNamed(IDR_BACK_D));
|
||||
|
||||
forward_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
forward_->SetImage(views::Button::STATE_NORMAL,
|
||||
tp->GetImageSkiaNamed(IDR_FORWARD));
|
||||
forward_->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
forward_->SetImage(views::Button::STATE_HOVERED,
|
||||
tp->GetImageSkiaNamed(IDR_FORWARD_H));
|
||||
forward_->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
forward_->SetImage(views::Button::STATE_PRESSED,
|
||||
tp->GetImageSkiaNamed(IDR_FORWARD_P));
|
||||
forward_->SetImage(views::CustomButton::STATE_DISABLED,
|
||||
forward_->SetImage(views::Button::STATE_DISABLED,
|
||||
tp->GetImageSkiaNamed(IDR_FORWARD_D));
|
||||
|
||||
reload_->LoadImages();
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "content/public/test/test_utils.h"
|
||||
#include "ui/base/l10n/l10n_util.h"
|
||||
#include "ui/compositor/scoped_animation_duration_scale_mode.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
namespace em = enterprise_management;
|
||||
|
@ -42,7 +42,6 @@
|
||||
#include "testing/gtest/include/gtest/gtest.h"
|
||||
#include "ui/message_center/message_center.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
|
||||
|
@ -53,11 +53,11 @@ class RevokeButton : public views::ImageButton, public views::ButtonListener {
|
||||
base::string16 permission_message)
|
||||
: views::ImageButton(this), callback_(callback) {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
SetImage(views::CustomButton::STATE_NORMAL,
|
||||
SetImage(views::Button::STATE_NORMAL,
|
||||
rb.GetImageNamed(IDR_DISABLE).ToImageSkia());
|
||||
SetImage(views::CustomButton::STATE_HOVERED,
|
||||
SetImage(views::Button::STATE_HOVERED,
|
||||
rb.GetImageNamed(IDR_DISABLE_H).ToImageSkia());
|
||||
SetImage(views::CustomButton::STATE_PRESSED,
|
||||
SetImage(views::Button::STATE_PRESSED,
|
||||
rb.GetImageNamed(IDR_DISABLE_P).ToImageSkia());
|
||||
SetBorder(std::unique_ptr<views::Border>());
|
||||
SetSize(GetPreferredSize());
|
||||
|
@ -112,7 +112,7 @@ using content::OpenURLParams;
|
||||
using content::PageNavigator;
|
||||
using content::Referrer;
|
||||
using ui::DropTargetEvent;
|
||||
using views::CustomButton;
|
||||
using views::Button;
|
||||
using views::LabelButtonBorder;
|
||||
using views::MenuButton;
|
||||
using views::View;
|
||||
@ -2041,7 +2041,7 @@ void BookmarkBarView::StartThrobbing(const BookmarkNode* node,
|
||||
// Node is hidden, animate the overflow button.
|
||||
throbbing_view_ = overflow_button_;
|
||||
} else if (!overflow_only) {
|
||||
throbbing_view_ = static_cast<CustomButton*>(child_at(index));
|
||||
throbbing_view_ = static_cast<Button*>(child_at(index));
|
||||
}
|
||||
} else if (bookmarks::IsDescendantOf(node, managed_->managed_node())) {
|
||||
throbbing_view_ = managed_bookmarks_button_;
|
||||
@ -2056,7 +2056,7 @@ void BookmarkBarView::StartThrobbing(const BookmarkNode* node,
|
||||
throbbing_view_->StartThrobbing(std::numeric_limits<int>::max());
|
||||
}
|
||||
|
||||
views::CustomButton* BookmarkBarView::DetermineViewToThrobFromRemove(
|
||||
views::Button* BookmarkBarView::DetermineViewToThrobFromRemove(
|
||||
const BookmarkNode* parent,
|
||||
int old_index) {
|
||||
const BookmarkNode* bbn = model_->bookmark_bar_node();
|
||||
@ -2075,7 +2075,7 @@ views::CustomButton* BookmarkBarView::DetermineViewToThrobFromRemove(
|
||||
// Node is hidden, animate the overflow button.
|
||||
return overflow_button_;
|
||||
}
|
||||
return static_cast<CustomButton*>(child_at(old_index_on_bb));
|
||||
return static_cast<Button*>(child_at(old_index_on_bb));
|
||||
}
|
||||
if (bookmarks::IsDescendantOf(parent, managed_->managed_node()))
|
||||
return managed_bookmarks_button_;
|
||||
|
@ -49,7 +49,7 @@ class FontList;
|
||||
}
|
||||
|
||||
namespace views {
|
||||
class CustomButton;
|
||||
class Button;
|
||||
class MenuButton;
|
||||
class MenuItemView;
|
||||
class LabelButton;
|
||||
@ -362,7 +362,7 @@ class BookmarkBarView : public views::AccessiblePaneView,
|
||||
// Returns the view to throb when a node is removed. |parent| is the parent of
|
||||
// the node that was removed, and |old_index| the index of the node that was
|
||||
// removed.
|
||||
views::CustomButton* DetermineViewToThrobFromRemove(
|
||||
views::Button* DetermineViewToThrobFromRemove(
|
||||
const bookmarks::BookmarkNode* parent,
|
||||
int old_index);
|
||||
|
||||
@ -453,7 +453,7 @@ class BookmarkBarView : public views::AccessiblePaneView,
|
||||
// If the bookmark bubble is showing, this is the visible ancestor of the URL.
|
||||
// The visible ancestor is either the |other_bookmarks_button_|,
|
||||
// |overflow_button_| or a button on the bar.
|
||||
views::CustomButton* throbbing_view_;
|
||||
views::Button* throbbing_view_;
|
||||
|
||||
BookmarkBar::State bookmark_bar_state_;
|
||||
|
||||
|
@ -448,7 +448,7 @@ class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase {
|
||||
|
||||
// Button should be depressed.
|
||||
views::LabelButton* button = GetBookmarkButton(0);
|
||||
ASSERT_TRUE(button->state() == views::CustomButton::STATE_PRESSED);
|
||||
ASSERT_TRUE(button->state() == views::Button::STATE_PRESSED);
|
||||
|
||||
// Click on the 2nd menu item (A URL).
|
||||
ASSERT_TRUE(menu->GetSubmenu());
|
||||
@ -467,7 +467,7 @@ class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase {
|
||||
|
||||
// Make sure button is no longer pushed.
|
||||
views::LabelButton* button = GetBookmarkButton(0);
|
||||
ASSERT_TRUE(button->state() == views::CustomButton::STATE_NORMAL);
|
||||
ASSERT_TRUE(button->state() == views::Button::STATE_NORMAL);
|
||||
|
||||
views::MenuItemView* menu = bb_view_->GetMenu();
|
||||
ASSERT_TRUE(menu == NULL || !menu->GetSubmenu()->IsShowing());
|
||||
@ -524,7 +524,7 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase {
|
||||
|
||||
// Make sure button is no longer pushed.
|
||||
views::LabelButton* button = GetBookmarkButton(0);
|
||||
ASSERT_TRUE(button->state() == views::CustomButton::STATE_NORMAL);
|
||||
ASSERT_TRUE(button->state() == views::Button::STATE_NORMAL);
|
||||
|
||||
Done();
|
||||
}
|
||||
@ -1612,7 +1612,7 @@ class BookmarkBarViewTest16 : public BookmarkBarViewEventTestBase {
|
||||
|
||||
// Button should be depressed.
|
||||
views::LabelButton* button = GetBookmarkButton(0);
|
||||
ASSERT_TRUE(button->state() == views::CustomButton::STATE_PRESSED);
|
||||
ASSERT_TRUE(button->state() == views::Button::STATE_PRESSED);
|
||||
|
||||
// Close the window.
|
||||
window_->Close();
|
||||
@ -1754,8 +1754,7 @@ class BookmarkBarViewTest18 : public BookmarkBarViewEventTestBase {
|
||||
|
||||
// The menu for the first folder should be in the pressed state (since the
|
||||
// menu is showing for it)...
|
||||
EXPECT_EQ(views::CustomButton::STATE_PRESSED,
|
||||
GetBookmarkButton(0)->state());
|
||||
EXPECT_EQ(views::Button::STATE_PRESSED, GetBookmarkButton(0)->state());
|
||||
// ... And the "other bookmarks" button should no longer be pressed.
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
bb_view_->other_bookmarks_button()->state());
|
||||
|
@ -585,7 +585,7 @@ void ContentSettingBubbleContents::StyleLearnMoreButton(
|
||||
SkColor text_color =
|
||||
theme->GetSystemColor(ui::NativeTheme::kColorId_LabelEnabledColor);
|
||||
learn_more_button_->SetImage(
|
||||
views::CustomButton::STATE_NORMAL,
|
||||
views::Button::STATE_NORMAL,
|
||||
gfx::CreateVectorIcon(vector_icons::kHelpOutlineIcon, 16,
|
||||
color_utils::DeriveDefaultIconColor(text_color)));
|
||||
learn_more_button_->set_ink_drop_base_color(text_color);
|
||||
|
@ -883,7 +883,7 @@ void DownloadItemView::SetDropdownState(State new_state) {
|
||||
// Avoid extra SchedulePaint()s if the state is going to be the same and
|
||||
// |dropdown_button_| has already been initialized.
|
||||
if (dropdown_state_ == new_state &&
|
||||
!dropdown_button_->GetImage(views::CustomButton::STATE_NORMAL).isNull())
|
||||
!dropdown_button_->GetImage(views::Button::STATE_NORMAL).isNull())
|
||||
return;
|
||||
|
||||
if (new_state != dropdown_state_) {
|
||||
|
@ -246,9 +246,9 @@ void OpaqueBrowserFrameView::GetWindowMask(const gfx::Size& size,
|
||||
}
|
||||
|
||||
void OpaqueBrowserFrameView::ResetWindowControls() {
|
||||
restore_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
minimize_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
maximize_button_->SetState(views::CustomButton::STATE_NORMAL);
|
||||
restore_button_->SetState(views::Button::STATE_NORMAL);
|
||||
minimize_button_->SetState(views::Button::STATE_NORMAL);
|
||||
maximize_button_->SetState(views::Button::STATE_NORMAL);
|
||||
// The close button isn't affected by this constraint.
|
||||
}
|
||||
|
||||
@ -461,11 +461,11 @@ views::ImageButton* OpaqueBrowserFrameView::InitWindowCaptionButton(
|
||||
ViewID view_id) {
|
||||
views::ImageButton* button = new views::ImageButton(this);
|
||||
const ui::ThemeProvider* tp = frame()->GetThemeProvider();
|
||||
button->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
button->SetImage(views::Button::STATE_NORMAL,
|
||||
tp->GetImageSkiaNamed(normal_image_id));
|
||||
button->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
button->SetImage(views::Button::STATE_HOVERED,
|
||||
tp->GetImageSkiaNamed(hot_image_id));
|
||||
button->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
button->SetImage(views::Button::STATE_PRESSED,
|
||||
tp->GetImageSkiaNamed(pushed_image_id));
|
||||
if (browser_view()->IsBrowserTypeNormal()) {
|
||||
button->SetBackgroundImage(
|
||||
|
@ -136,7 +136,7 @@ class OpaqueBrowserFrameViewLayoutTest : public views::ViewsTestBase {
|
||||
views::ImageButton* button = new views::ImageButton(nullptr);
|
||||
gfx::ImageSkiaRep rep(size, 1.0f);
|
||||
gfx::ImageSkia image(rep);
|
||||
button->SetImage(views::CustomButton::STATE_NORMAL, &image);
|
||||
button->SetImage(views::Button::STATE_NORMAL, &image);
|
||||
button->set_id(view_id);
|
||||
root_view_->AddChildView(button);
|
||||
return button;
|
||||
|
@ -17,7 +17,7 @@
|
||||
Windows10CaptionButton::Windows10CaptionButton(
|
||||
GlassBrowserFrameView* frame_view,
|
||||
ViewID button_type)
|
||||
: views::CustomButton(frame_view),
|
||||
: views::Button(frame_view),
|
||||
frame_view_(frame_view),
|
||||
button_type_(button_type) {
|
||||
set_animate_on_state_change(true);
|
||||
|
@ -7,15 +7,15 @@
|
||||
|
||||
#include "chrome/browser/ui/view_ids.h"
|
||||
#include "ui/gfx/canvas.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
class GlassBrowserFrameView;
|
||||
|
||||
class Windows10CaptionButton : public views::CustomButton {
|
||||
class Windows10CaptionButton : public views::Button {
|
||||
public:
|
||||
Windows10CaptionButton(GlassBrowserFrameView* frame_view, ViewID button_type);
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
gfx::Size CalculatePreferredSize() const override;
|
||||
void OnPaintBackground(gfx::Canvas* canvas) override;
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
@ -49,11 +49,11 @@ void ImeWindowFrameView::Init() {
|
||||
ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
|
||||
|
||||
close_button_ = new views::ImageButton(this);
|
||||
close_button_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
close_button_->SetImage(views::Button::STATE_NORMAL,
|
||||
rb.GetImageSkiaNamed(IDR_IME_WINDOW_CLOSE));
|
||||
close_button_->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
close_button_->SetImage(views::Button::STATE_HOVERED,
|
||||
rb.GetImageSkiaNamed(IDR_IME_WINDOW_CLOSE_H));
|
||||
close_button_->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
close_button_->SetImage(views::Button::STATE_PRESSED,
|
||||
rb.GetImageSkiaNamed(IDR_IME_WINDOW_CLOSE_C));
|
||||
close_button_->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
||||
views::ImageButton::ALIGN_MIDDLE);
|
||||
|
@ -115,7 +115,7 @@ bool BubbleIconView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
return false;
|
||||
|
||||
AnimateInkDrop(views::InkDropState::ACTIVATED, nullptr /* &event */);
|
||||
// As with CustomButton, return activates on key down and space activates on
|
||||
// As with Button, return activates on key down and space activates on
|
||||
// key up.
|
||||
if (event.key_code() == ui::VKEY_RETURN)
|
||||
ExecuteCommand(EXECUTE_SOURCE_KEYBOARD);
|
||||
|
@ -24,7 +24,7 @@ class BubbleDialogDelegateView;
|
||||
}
|
||||
|
||||
// Represents an icon on the omnibox that shows a bubble when clicked.
|
||||
// TODO(spqchan): Convert this to subclass CustomButton.
|
||||
// TODO(spqchan): Convert this to subclass Button.
|
||||
class BubbleIconView : public views::InkDropHostView,
|
||||
public views::WidgetObserver {
|
||||
public:
|
||||
|
@ -93,7 +93,7 @@ void IconLabelBubbleView::SeparatorView::UpdateOpacity() {
|
||||
|
||||
IconLabelBubbleView::IconLabelBubbleView(const gfx::FontList& font_list,
|
||||
bool elide_in_middle)
|
||||
: CustomButton(nullptr),
|
||||
: Button(nullptr),
|
||||
image_(new views::ImageView()),
|
||||
label_(new views::Label(base::string16(), {font_list})),
|
||||
ink_drop_container_(new views::InkDropContainerView()),
|
||||
@ -218,7 +218,7 @@ void IconLabelBubbleView::Layout() {
|
||||
|
||||
bool IconLabelBubbleView::OnMousePressed(const ui::MouseEvent& event) {
|
||||
suppress_button_release_ = IsBubbleShowing();
|
||||
return CustomButton::OnMousePressed(event);
|
||||
return Button::OnMousePressed(event);
|
||||
}
|
||||
|
||||
void IconLabelBubbleView::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
@ -230,7 +230,7 @@ void IconLabelBubbleView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
|
||||
GetInkDrop()->AnimateToState(views::InkDropState::HIDDEN);
|
||||
GetInkDrop()->SetHovered(false);
|
||||
}
|
||||
CustomButton::OnBoundsChanged(previous_bounds);
|
||||
Button::OnBoundsChanged(previous_bounds);
|
||||
}
|
||||
|
||||
void IconLabelBubbleView::OnNativeThemeChanged(
|
||||
@ -289,12 +289,12 @@ bool IconLabelBubbleView::IsTriggerableEvent(const ui::Event& event) {
|
||||
|
||||
bool IconLabelBubbleView::ShouldUpdateInkDropOnClickCanceled() const {
|
||||
// The click might be cancelled because the bubble is still opened. In this
|
||||
// case, the ink drop state should not be hidden by CustomButton.
|
||||
// case, the ink drop state should not be hidden by Button.
|
||||
return false;
|
||||
}
|
||||
|
||||
void IconLabelBubbleView::NotifyClick(const ui::Event& event) {
|
||||
CustomButton::NotifyClick(event);
|
||||
Button::NotifyClick(event);
|
||||
OnActivate(event);
|
||||
}
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/views/animation/ink_drop_host_view.h"
|
||||
#include "ui/views/animation/ink_drop_observer.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/widget/widget_observer.h"
|
||||
|
||||
@ -32,7 +32,7 @@ class InkDropContainerView;
|
||||
// base for the classes that handle the location icon (including the EV bubble),
|
||||
// tab-to-search UI, and content settings.
|
||||
class IconLabelBubbleView : public views::InkDropObserver,
|
||||
public views::CustomButton,
|
||||
public views::Button,
|
||||
public views::WidgetObserver {
|
||||
public:
|
||||
static constexpr int kTrailingPaddingPreMd = 2;
|
||||
@ -100,7 +100,7 @@ class IconLabelBubbleView : public views::InkDropObserver,
|
||||
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
|
||||
SkColor GetInkDropBaseColor() const override;
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
bool IsTriggerableEvent(const ui::Event& event) override;
|
||||
bool ShouldUpdateInkDropOnClickCanceled() const override;
|
||||
void NotifyClick(const ui::Event& event) override;
|
||||
|
@ -29,7 +29,7 @@ KeywordHintView::KeywordHintView(views::ButtonListener* listener,
|
||||
const gfx::FontList& bubble_font_list,
|
||||
SkColor text_color,
|
||||
SkColor background_color)
|
||||
: CustomButton(listener),
|
||||
: Button(listener),
|
||||
profile_(profile),
|
||||
leading_label_(nullptr),
|
||||
chip_container_(new views::View()),
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "base/compiler_specific.h"
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/geometry/size.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
class Profile;
|
||||
|
||||
@ -31,7 +31,7 @@ class Label;
|
||||
//
|
||||
// NOTE: This should really be called LocationBarKeywordHintView, but I
|
||||
// couldn't bring myself to use such a long name.
|
||||
class KeywordHintView : public views::CustomButton {
|
||||
class KeywordHintView : public views::Button {
|
||||
public:
|
||||
KeywordHintView(views::ButtonListener* listener,
|
||||
Profile* profile,
|
||||
|
@ -63,7 +63,7 @@ CredentialsItemView::CredentialsItemView(
|
||||
SkColor hover_color,
|
||||
const autofill::PasswordForm* form,
|
||||
net::URLRequestContextGetter* request_context)
|
||||
: CustomButton(button_listener),
|
||||
: Button(button_listener),
|
||||
form_(form),
|
||||
upper_label_(nullptr),
|
||||
lower_label_(nullptr),
|
||||
|
@ -8,7 +8,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "base/memory/weak_ptr.h"
|
||||
#include "chrome/browser/ui/passwords/account_avatar_fetcher.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace autofill {
|
||||
struct PasswordForm;
|
||||
@ -30,7 +30,7 @@ class Label;
|
||||
// CredentialsItemView represents a credential view in the account chooser
|
||||
// bubble.
|
||||
class CredentialsItemView : public AccountAvatarFetcherDelegate,
|
||||
public views::CustomButton {
|
||||
public views::Button {
|
||||
public:
|
||||
CredentialsItemView(views::ButtonListener* button_listener,
|
||||
const base::string16& upper_text,
|
||||
|
@ -16,7 +16,7 @@ namespace payments {
|
||||
PaymentRequestRowView::PaymentRequestRowView(views::ButtonListener* listener,
|
||||
bool clickable,
|
||||
const gfx::Insets& insets)
|
||||
: views::CustomButton(listener),
|
||||
: views::Button(listener),
|
||||
clickable_(clickable),
|
||||
insets_(insets),
|
||||
previous_row_(nullptr) {
|
||||
@ -60,7 +60,7 @@ void PaymentRequestRowView::SetIsHighlighted(bool highlighted) {
|
||||
}
|
||||
}
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
void PaymentRequestRowView::StateChanged(ButtonState old_state) {
|
||||
if (!clickable())
|
||||
return;
|
||||
|
@ -6,13 +6,13 @@
|
||||
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace payments {
|
||||
|
||||
// This class implements a clickable row of the Payment Request dialog that
|
||||
// darkens on hover and displays a horizontal ruler on its lower bound.
|
||||
class PaymentRequestRowView : public views::CustomButton {
|
||||
class PaymentRequestRowView : public views::Button {
|
||||
public:
|
||||
// Creates a row view. If |clickable| is true, the row will be shaded on hover
|
||||
// and handle click events. |insets| are used as padding around the content.
|
||||
@ -43,7 +43,7 @@ class PaymentRequestRowView : public views::CustomButton {
|
||||
// colored background color.
|
||||
void SetIsHighlighted(bool highlighted);
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
|
||||
// views::View:
|
||||
|
@ -175,7 +175,7 @@ AvatarButton::AvatarButton(views::ButtonListener* listener,
|
||||
profile_observer_(this),
|
||||
button_style_(button_style),
|
||||
widget_observer_(this) {
|
||||
set_notify_action(CustomButton::NOTIFY_ON_PRESS);
|
||||
set_notify_action(Button::NOTIFY_ON_PRESS);
|
||||
set_triggerable_event_flags(ui::EF_LEFT_MOUSE_BUTTON |
|
||||
ui::EF_RIGHT_MOUSE_BUTTON);
|
||||
set_animate_on_state_change(false);
|
||||
@ -270,9 +270,9 @@ void AvatarButton::AddedToWidget() {
|
||||
|
||||
void AvatarButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
// TODO(wjmaclean): The check for ET_GESTURE_LONG_PRESS is done here since
|
||||
// no other UI button based on CustomButton appears to handle mouse
|
||||
// no other UI button based on Button appears to handle mouse
|
||||
// right-click. If other cases are identified, it may make sense to move this
|
||||
// check to CustomButton.
|
||||
// check to Button.
|
||||
if (event->type() == ui::ET_GESTURE_LONG_PRESS)
|
||||
NotifyClick(*event);
|
||||
else
|
||||
|
@ -233,7 +233,7 @@ class BackgroundColorHoverButton : public views::LabelButton {
|
||||
UpdateColors();
|
||||
}
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
void StateChanged(ButtonState old_state) override {
|
||||
LabelButton::StateChanged(old_state);
|
||||
|
||||
@ -396,7 +396,7 @@ class EditableProfilePhoto : public views::LabelButton {
|
||||
}
|
||||
|
||||
private:
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
void StateChanged(ButtonState old_state) override {
|
||||
if (photo_overlay_) {
|
||||
photo_overlay_->SetVisible(
|
||||
|
@ -145,7 +145,7 @@ void AlertIndicatorButton::UpdateEnabledForMuteToggle() {
|
||||
// hovering. If it is, enter a dormant period where extra user clicks are
|
||||
// prevented from having an effect (i.e., before the user has realized the
|
||||
// button has become enabled underneath their cursor).
|
||||
if (!was_enabled && state() == views::CustomButton::STATE_HOVERED)
|
||||
if (!was_enabled && state() == views::Button::STATE_HOVERED)
|
||||
EnterDormantPeriod();
|
||||
else if (!enabled())
|
||||
ExitDormantPeriod();
|
||||
@ -171,8 +171,8 @@ bool AlertIndicatorButton::OnMousePressed(const ui::MouseEvent& event) {
|
||||
// pressed or when any modifier keys are being held down. Instead, the Tab
|
||||
// should react (e.g., middle-click for close, right-click for context menu).
|
||||
if (!event.IsOnlyLeftMouseButton() || IsShiftOrControlDown(event)) {
|
||||
if (state() != views::CustomButton::STATE_DISABLED)
|
||||
SetState(views::CustomButton::STATE_NORMAL); // Turn off hover.
|
||||
if (state() != views::Button::STATE_DISABLED)
|
||||
SetState(views::Button::STATE_NORMAL); // Turn off hover.
|
||||
return false; // Event to be handled by Tab.
|
||||
}
|
||||
return ImageButton::OnMousePressed(event);
|
||||
@ -181,17 +181,16 @@ bool AlertIndicatorButton::OnMousePressed(const ui::MouseEvent& event) {
|
||||
bool AlertIndicatorButton::OnMouseDragged(const ui::MouseEvent& event) {
|
||||
const ButtonState previous_state = state();
|
||||
const bool ret = ImageButton::OnMouseDragged(event);
|
||||
if (previous_state != views::CustomButton::STATE_NORMAL &&
|
||||
state() == views::CustomButton::STATE_NORMAL)
|
||||
if (previous_state != views::Button::STATE_NORMAL &&
|
||||
state() == views::Button::STATE_NORMAL)
|
||||
base::RecordAction(UserMetricsAction("AlertIndicatorButton_Dragged"));
|
||||
return ret;
|
||||
}
|
||||
|
||||
void AlertIndicatorButton::OnMouseEntered(const ui::MouseEvent& event) {
|
||||
// If any modifier keys are being held down, do not turn on hover.
|
||||
if (state() != views::CustomButton::STATE_DISABLED &&
|
||||
IsShiftOrControlDown(event)) {
|
||||
SetState(views::CustomButton::STATE_NORMAL);
|
||||
if (state() != views::Button::STATE_DISABLED && IsShiftOrControlDown(event)) {
|
||||
SetState(views::Button::STATE_NORMAL);
|
||||
return;
|
||||
}
|
||||
ImageButton::OnMouseEntered(event);
|
||||
@ -204,9 +203,8 @@ void AlertIndicatorButton::OnMouseExited(const ui::MouseEvent& event) {
|
||||
|
||||
void AlertIndicatorButton::OnMouseMoved(const ui::MouseEvent& event) {
|
||||
// If any modifier keys are being held down, turn off hover.
|
||||
if (state() != views::CustomButton::STATE_DISABLED &&
|
||||
IsShiftOrControlDown(event)) {
|
||||
SetState(views::CustomButton::STATE_NORMAL);
|
||||
if (state() != views::Button::STATE_DISABLED && IsShiftOrControlDown(event)) {
|
||||
SetState(views::Button::STATE_NORMAL);
|
||||
return;
|
||||
}
|
||||
ImageButton::OnMouseMoved(event);
|
||||
@ -284,7 +282,7 @@ void AlertIndicatorButton::PaintButtonContents(gfx::Canvas* canvas) {
|
||||
|
||||
gfx::ImageSkia AlertIndicatorButton::GetImageToPaint() {
|
||||
if (is_dormant())
|
||||
return views::ImageButton::images_[views::CustomButton::STATE_NORMAL];
|
||||
return views::ImageButton::images_[views::Button::STATE_NORMAL];
|
||||
return views::ImageButton::GetImageToPaint();
|
||||
}
|
||||
|
||||
@ -297,12 +295,12 @@ void AlertIndicatorButton::ResetImages(TabAlertState state) {
|
||||
SkColor color = parent_tab_->button_color();
|
||||
gfx::ImageSkia indicator_image =
|
||||
chrome::GetTabAlertIndicatorImage(state, color).AsImageSkia();
|
||||
SetImage(views::CustomButton::STATE_NORMAL, &indicator_image);
|
||||
SetImage(views::CustomButton::STATE_DISABLED, &indicator_image);
|
||||
SetImage(views::Button::STATE_NORMAL, &indicator_image);
|
||||
SetImage(views::Button::STATE_DISABLED, &indicator_image);
|
||||
gfx::ImageSkia affordance_image =
|
||||
chrome::GetTabAlertIndicatorAffordanceImage(state, color).AsImageSkia();
|
||||
SetImage(views::CustomButton::STATE_HOVERED, &affordance_image);
|
||||
SetImage(views::CustomButton::STATE_PRESSED, &affordance_image);
|
||||
SetImage(views::Button::STATE_HOVERED, &affordance_image);
|
||||
SetImage(views::Button::STATE_PRESSED, &affordance_image);
|
||||
}
|
||||
|
||||
void AlertIndicatorButton::EnterDormantPeriod() {
|
||||
|
@ -76,7 +76,7 @@ class AlertIndicatorButton : public views::ImageButton,
|
||||
// views::Button:
|
||||
void NotifyClick(const ui::Event& event) override;
|
||||
|
||||
// views::CustomButton:
|
||||
// views::Button:
|
||||
bool IsTriggerableEvent(const ui::Event& event) override;
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
||||
|
@ -106,7 +106,7 @@ void NewTabButton::OnMouseReleased(const ui::MouseEvent& event) {
|
||||
return;
|
||||
|
||||
destroyed_ = NULL;
|
||||
SetState(views::CustomButton::STATE_NORMAL);
|
||||
SetState(views::Button::STATE_NORMAL);
|
||||
return;
|
||||
}
|
||||
views::ImageButton::OnMouseReleased(event);
|
||||
@ -125,7 +125,7 @@ void NewTabButton::PaintButtonContents(gfx::Canvas* canvas) {
|
||||
const int visible_height = GetLayoutSize(NEW_TAB_BUTTON).height();
|
||||
canvas->Translate(gfx::Vector2d(0, height() - visible_height));
|
||||
|
||||
const bool pressed = state() == views::CustomButton::STATE_PRESSED;
|
||||
const bool pressed = state() == views::Button::STATE_PRESSED;
|
||||
const float scale = canvas->image_scale();
|
||||
|
||||
// Fill.
|
||||
|
@ -297,12 +297,12 @@ class Tab::TabCloseButton : public views::ImageButton,
|
||||
|
||||
void OnMouseMoved(const ui::MouseEvent& event) override {
|
||||
tab_->controller_->OnMouseEventInTab(this, event);
|
||||
CustomButton::OnMouseMoved(event);
|
||||
Button::OnMouseMoved(event);
|
||||
}
|
||||
|
||||
void OnMouseReleased(const ui::MouseEvent& event) override {
|
||||
tab_->controller_->OnMouseEventInTab(this, event);
|
||||
CustomButton::OnMouseReleased(event);
|
||||
Button::OnMouseReleased(event);
|
||||
}
|
||||
|
||||
void OnGestureEvent(ui::GestureEvent* event) override {
|
||||
@ -483,8 +483,8 @@ Tab::Tab(TabController* controller, gfx::AnimationContainer* container)
|
||||
kTabCloseHoveredPressedIcon, SkColorSetRGB(0xDB, 0x44, 0x37));
|
||||
const gfx::ImageSkia& pressed = gfx::CreateVectorIcon(
|
||||
kTabCloseHoveredPressedIcon, SkColorSetRGB(0xA8, 0x35, 0x2A));
|
||||
close_button_->SetImage(views::CustomButton::STATE_HOVERED, &hovered);
|
||||
close_button_->SetImage(views::CustomButton::STATE_PRESSED, &pressed);
|
||||
close_button_->SetImage(views::Button::STATE_HOVERED, &hovered);
|
||||
close_button_->SetImage(views::Button::STATE_PRESSED, &pressed);
|
||||
|
||||
// Disable animation so that the red danger sign shows up immediately
|
||||
// to help avoid mis-clicks.
|
||||
@ -1422,7 +1422,7 @@ void Tab::OnButtonColorMaybeChanged() {
|
||||
alert_indicator_button_->OnParentTabButtonColorChanged();
|
||||
const gfx::ImageSkia& close_button_normal_image =
|
||||
gfx::CreateVectorIcon(kTabCloseNormalIcon, button_color_);
|
||||
close_button_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
close_button_->SetImage(views::Button::STATE_NORMAL,
|
||||
&close_button_normal_image);
|
||||
}
|
||||
}
|
||||
|
@ -1133,7 +1133,7 @@ void TabStrip::PaintChildren(const views::PaintInfo& paint_info) {
|
||||
active_tab->Paint(paint_info);
|
||||
|
||||
// Paint the New Tab button.
|
||||
if (new_tab_button_->state() == views::CustomButton::STATE_PRESSED) {
|
||||
if (new_tab_button_->state() == views::Button::STATE_PRESSED) {
|
||||
new_tab_button_->Paint(paint_info);
|
||||
} else {
|
||||
// Match the inactive tab opacity for non-pressed states. See comments in
|
||||
|
@ -74,7 +74,7 @@ using bookmarks::BookmarkModel;
|
||||
using content::WebContents;
|
||||
using ui::ButtonMenuItemModel;
|
||||
using ui::MenuModel;
|
||||
using views::CustomButton;
|
||||
using views::Button;
|
||||
using views::ImageButton;
|
||||
using views::Label;
|
||||
using views::LabelButton;
|
||||
@ -153,7 +153,7 @@ class InMenuButtonBackground : public views::Background {
|
||||
|
||||
// Overridden from views::Background.
|
||||
void Paint(gfx::Canvas* canvas, View* view) const override {
|
||||
CustomButton* button = CustomButton::AsCustomButton(view);
|
||||
Button* button = Button::AsButton(view);
|
||||
int h = view->height();
|
||||
|
||||
// Draw leading border if desired.
|
||||
@ -340,7 +340,7 @@ class AppMenuView : public views::View,
|
||||
AddChildView(button);
|
||||
// all buttons on menu should must be a custom button in order for
|
||||
// the keyboard nativigation work.
|
||||
DCHECK(CustomButton::AsCustomButton(button));
|
||||
DCHECK(Button::AsButton(button));
|
||||
return button;
|
||||
}
|
||||
|
||||
@ -501,7 +501,7 @@ class AppMenu::ZoomView : public AppMenuView {
|
||||
fullscreen_button_ = new FullscreenButton(this);
|
||||
// all buttons on menu should must be a custom button in order for
|
||||
// the keyboard navigation work.
|
||||
DCHECK(CustomButton::AsCustomButton(fullscreen_button_));
|
||||
DCHECK(Button::AsButton(fullscreen_button_));
|
||||
gfx::ImageSkia* full_screen_image =
|
||||
ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
|
||||
IDR_FULLSCREEN_MENU_BUTTON);
|
||||
|
@ -115,7 +115,7 @@ void ReloadButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
if (menu_enabled_)
|
||||
ToolbarButton::GetAccessibleNodeData(node_data);
|
||||
else
|
||||
CustomButton::GetAccessibleNodeData(node_data);
|
||||
Button::GetAccessibleNodeData(node_data);
|
||||
}
|
||||
|
||||
bool ReloadButton::ShouldShowMenu() {
|
||||
|
@ -112,7 +112,7 @@ bool ToolbarActionView::ShouldUseFloodFillInkDrop() const {
|
||||
|
||||
std::unique_ptr<views::InkDrop> ToolbarActionView::CreateInkDrop() {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
Button::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(!delegate_->ShownInsideMenu());
|
||||
ink_drop->SetShowHighlightOnFocus(true);
|
||||
return std::move(ink_drop);
|
||||
@ -129,9 +129,9 @@ void ToolbarActionView::UpdateState() {
|
||||
|
||||
if (!view_controller_->IsEnabled(web_contents) &&
|
||||
!view_controller_->DisabledClickOpensMenu()) {
|
||||
SetState(views::CustomButton::STATE_DISABLED);
|
||||
} else if (state() == views::CustomButton::STATE_DISABLED) {
|
||||
SetState(views::CustomButton::STATE_NORMAL);
|
||||
SetState(views::Button::STATE_DISABLED);
|
||||
} else if (state() == views::Button::STATE_DISABLED) {
|
||||
SetState(views::Button::STATE_NORMAL);
|
||||
}
|
||||
|
||||
wants_to_run_ = view_controller_->WantsToRun(web_contents);
|
||||
|
@ -128,7 +128,7 @@ void ToolbarButton::OnGestureEvent(ui::GestureEvent* event) {
|
||||
}
|
||||
|
||||
void ToolbarButton::GetAccessibleNodeData(ui::AXNodeData* node_data) {
|
||||
CustomButton::GetAccessibleNodeData(node_data);
|
||||
Button::GetAccessibleNodeData(node_data);
|
||||
node_data->role = ui::AX_ROLE_BUTTON_DROP_DOWN;
|
||||
node_data->AddState(ui::AX_STATE_HASPOPUP);
|
||||
if (enabled()) {
|
||||
|
@ -195,11 +195,11 @@ TryChromeDialogView::Result TryChromeDialogView::ShowDialog(
|
||||
layout->AddView(label);
|
||||
// The close button is custom.
|
||||
views::ImageButton* close_button = new views::ImageButton(this);
|
||||
close_button->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
close_button->SetImage(views::Button::STATE_NORMAL,
|
||||
rb.GetNativeImageNamed(IDR_CLOSE_2).ToImageSkia());
|
||||
close_button->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
close_button->SetImage(views::Button::STATE_HOVERED,
|
||||
rb.GetNativeImageNamed(IDR_CLOSE_2_H).ToImageSkia());
|
||||
close_button->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
close_button->SetImage(views::Button::STATE_PRESSED,
|
||||
rb.GetNativeImageNamed(IDR_CLOSE_2_P).ToImageSkia());
|
||||
close_button->set_tag(BT_CLOSE_BUTTON);
|
||||
layout->AddView(close_button);
|
||||
|
@ -99,14 +99,14 @@ class ShellWindowDelegateView : public views::WidgetDelegateView,
|
||||
void SetWindowTitle(const base::string16& title) { title_ = title; }
|
||||
void EnableUIControl(UIControl control, bool is_enabled) {
|
||||
if (control == BACK_BUTTON) {
|
||||
back_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL
|
||||
: views::CustomButton::STATE_DISABLED);
|
||||
back_button_->SetState(is_enabled ? views::Button::STATE_NORMAL
|
||||
: views::Button::STATE_DISABLED);
|
||||
} else if (control == FORWARD_BUTTON) {
|
||||
forward_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL
|
||||
: views::CustomButton::STATE_DISABLED);
|
||||
forward_button_->SetState(is_enabled ? views::Button::STATE_NORMAL
|
||||
: views::Button::STATE_DISABLED);
|
||||
} else if (control == STOP_BUTTON) {
|
||||
stop_button_->SetState(is_enabled ? views::CustomButton::STATE_NORMAL
|
||||
: views::CustomButton::STATE_DISABLED);
|
||||
stop_button_->SetState(is_enabled ? views::Button::STATE_NORMAL
|
||||
: views::Button::STATE_DISABLED);
|
||||
}
|
||||
}
|
||||
|
||||
@ -296,10 +296,10 @@ class ShellWindowDelegateView : public views::WidgetDelegateView,
|
||||
|
||||
// Toolbar view contains forward/backward/reload button and URL entry
|
||||
View* toolbar_view_;
|
||||
views::CustomButton* back_button_;
|
||||
views::CustomButton* forward_button_;
|
||||
views::CustomButton* refresh_button_;
|
||||
views::CustomButton* stop_button_;
|
||||
views::Button* back_button_;
|
||||
views::Button* forward_button_;
|
||||
views::Button* refresh_button_;
|
||||
views::Button* stop_button_;
|
||||
views::Textfield* url_entry_;
|
||||
|
||||
// Contents view contains the web contents view
|
||||
|
@ -68,7 +68,7 @@ const char AppListItemView::kViewClassName[] = "ui/app_list/AppListItemView";
|
||||
|
||||
AppListItemView::AppListItemView(AppsGridView* apps_grid_view,
|
||||
AppListItem* item)
|
||||
: CustomButton(apps_grid_view),
|
||||
: Button(apps_grid_view),
|
||||
is_folder_(item->GetItemType() == AppListFolderItem::kItemType),
|
||||
is_in_folder_(item->IsInFolder()),
|
||||
item_weak_(item),
|
||||
@ -298,7 +298,7 @@ bool AppListItemView::ShouldEnterPushedState(const ui::Event& event) {
|
||||
if (event.type() == ui::ET_GESTURE_TAP_DOWN)
|
||||
return false;
|
||||
|
||||
return views::CustomButton::ShouldEnterPushedState(event);
|
||||
return views::Button::ShouldEnterPushedState(event);
|
||||
}
|
||||
|
||||
void AppListItemView::PaintButtonContents(gfx::Canvas* canvas) {
|
||||
@ -335,7 +335,7 @@ void AppListItemView::PaintButtonContents(gfx::Canvas* canvas) {
|
||||
}
|
||||
|
||||
bool AppListItemView::OnMousePressed(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMousePressed(event);
|
||||
Button::OnMousePressed(event);
|
||||
|
||||
if (!ShouldEnterPushedState(event))
|
||||
return true;
|
||||
@ -415,16 +415,16 @@ bool AppListItemView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
if (event.key_code() == ui::VKEY_SPACE)
|
||||
return false;
|
||||
|
||||
return CustomButton::OnKeyPressed(event);
|
||||
return Button::OnKeyPressed(event);
|
||||
}
|
||||
|
||||
void AppListItemView::OnMouseReleased(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMouseReleased(event);
|
||||
Button::OnMouseReleased(event);
|
||||
apps_grid_view_->EndDrag(false);
|
||||
}
|
||||
|
||||
bool AppListItemView::OnMouseDragged(const ui::MouseEvent& event) {
|
||||
CustomButton::OnMouseDragged(event);
|
||||
Button::OnMouseDragged(event);
|
||||
if (apps_grid_view_->IsDraggedView(this)) {
|
||||
// If the drag is no longer happening, it could be because this item
|
||||
// got removed, in which case this item has been destroyed. So, bail out
|
||||
@ -499,7 +499,7 @@ void AppListItemView::OnGestureEvent(ui::GestureEvent* event) {
|
||||
break;
|
||||
}
|
||||
if (!event->handled())
|
||||
CustomButton::OnGestureEvent(event);
|
||||
Button::OnGestureEvent(event);
|
||||
}
|
||||
|
||||
bool AppListItemView::GetTooltipText(const gfx::Point& p,
|
||||
|
@ -16,7 +16,7 @@
|
||||
#include "ui/app_list/app_list_item_observer.h"
|
||||
#include "ui/app_list/views/image_shadow_animator.h"
|
||||
#include "ui/views/context_menu_controller.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace views {
|
||||
class ImageView;
|
||||
@ -30,7 +30,7 @@ namespace app_list {
|
||||
class AppListItem;
|
||||
class AppsGridView;
|
||||
|
||||
class APP_LIST_EXPORT AppListItemView : public views::CustomButton,
|
||||
class APP_LIST_EXPORT AppListItemView : public views::Button,
|
||||
public views::ContextMenuController,
|
||||
public AppListItemObserver,
|
||||
public ImageShadowAnimator::Delegate {
|
||||
@ -83,7 +83,7 @@ class APP_LIST_EXPORT AppListItemView : public views::CustomButton,
|
||||
// having something dropped onto it, enables subpixel AA for the title.
|
||||
void SetTitleSubpixelAA();
|
||||
|
||||
// views::CustomButton overrides:
|
||||
// views::Button overrides:
|
||||
void OnGestureEvent(ui::GestureEvent* event) override;
|
||||
|
||||
// views::View overrides:
|
||||
@ -123,7 +123,7 @@ class APP_LIST_EXPORT AppListItemView : public views::CustomButton,
|
||||
const gfx::Point& point,
|
||||
ui::MenuSourceType source_type) override;
|
||||
|
||||
// views::CustomButton overrides:
|
||||
// views::Button overrides:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
bool ShouldEnterPushedState(const ui::Event& event) override;
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
@ -34,7 +34,6 @@
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
#include "ui/views/border.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/textfield/textfield.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
|
@ -37,7 +37,7 @@ constexpr SkColor kInkDropHighlightColor =
|
||||
|
||||
ExpandArrowView::ExpandArrowView(ContentsView* contents_view,
|
||||
AppListView* app_list_view)
|
||||
: views::CustomButton(this),
|
||||
: views::Button(this),
|
||||
contents_view_(contents_view),
|
||||
app_list_view_(app_list_view) {
|
||||
SetPaintToLayer();
|
||||
@ -105,7 +105,7 @@ bool ExpandArrowView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
|
||||
std::unique_ptr<views::InkDrop> ExpandArrowView::CreateInkDrop() {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
Button::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(false);
|
||||
ink_drop->SetShowHighlightOnFocus(true);
|
||||
ink_drop->SetAutoHighlightMode(
|
||||
|
@ -6,7 +6,6 @@
|
||||
#define UI_APP_LIST_VIEWS_EXPAND_ARROW_VIEW_H_
|
||||
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
|
||||
namespace views {
|
||||
class ImageView;
|
||||
@ -22,8 +21,7 @@ class AppListView;
|
||||
class ContentsView;
|
||||
|
||||
// A tile item for the expand arrow on the start page.
|
||||
class ExpandArrowView : public views::CustomButton,
|
||||
public views::ButtonListener {
|
||||
class ExpandArrowView : public views::Button, public views::ButtonListener {
|
||||
public:
|
||||
ExpandArrowView(ContentsView* contents_view, AppListView* app_list_view);
|
||||
~ExpandArrowView() override;
|
||||
@ -31,7 +29,7 @@ class ExpandArrowView : public views::CustomButton,
|
||||
bool selected() { return selected_; }
|
||||
void SetSelected(bool selected);
|
||||
|
||||
// Overridden from views::CustomButton:
|
||||
// Overridden from views::Button:
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
||||
// Overridden from views::ButtonListener:
|
||||
|
@ -14,7 +14,7 @@
|
||||
#include "ui/gfx/canvas.h"
|
||||
#include "ui/gfx/geometry/insets.h"
|
||||
#include "ui/gfx/skia_util.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
|
||||
namespace app_list {
|
||||
@ -31,10 +31,10 @@ const int kButtonHeight = 6;
|
||||
const int kButtonCornerRadius = 2;
|
||||
const int kButtonStripPadding = 20;
|
||||
|
||||
class PageSwitcherButton : public views::CustomButton {
|
||||
class PageSwitcherButton : public views::Button {
|
||||
public:
|
||||
explicit PageSwitcherButton(views::ButtonListener* listener)
|
||||
: views::CustomButton(listener),
|
||||
: views::Button(listener),
|
||||
button_width_(kMaxButtonWidth),
|
||||
selected_range_(0) {}
|
||||
~PageSwitcherButton() override {}
|
||||
@ -62,13 +62,13 @@ class PageSwitcherButton : public views::CustomButton {
|
||||
}
|
||||
|
||||
void OnGestureEvent(ui::GestureEvent* event) override {
|
||||
CustomButton::OnGestureEvent(event);
|
||||
Button::OnGestureEvent(event);
|
||||
|
||||
if (event->type() == ui::ET_GESTURE_TAP_DOWN)
|
||||
SetState(views::CustomButton::STATE_HOVERED);
|
||||
SetState(views::Button::STATE_HOVERED);
|
||||
else if (event->type() == ui::ET_GESTURE_TAP_CANCEL ||
|
||||
event->type() == ui::ET_GESTURE_TAP)
|
||||
SetState(views::CustomButton::STATE_NORMAL);
|
||||
SetState(views::Button::STATE_NORMAL);
|
||||
SchedulePaint();
|
||||
}
|
||||
|
||||
@ -168,14 +168,14 @@ void PageSwitcherHorizontal::UpdateUIForDragPoint(const gfx::Point& point) {
|
||||
if (page >= 0 && page < button_count) {
|
||||
PageSwitcherButton* button =
|
||||
static_cast<PageSwitcherButton*>(buttons_->child_at(page));
|
||||
button->SetState(views::CustomButton::STATE_HOVERED);
|
||||
button->SetState(views::Button::STATE_HOVERED);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < button_count; ++i) {
|
||||
PageSwitcherButton* button =
|
||||
static_cast<PageSwitcherButton*>(buttons_->child_at(i));
|
||||
button->SetState(views::CustomButton::STATE_NORMAL);
|
||||
button->SetState(views::Button::STATE_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -20,7 +20,7 @@
|
||||
#include "ui/views/animation/ink_drop_impl.h"
|
||||
#include "ui/views/animation/ink_drop_mask.h"
|
||||
#include "ui/views/animation/ink_drop_painted_layer_delegates.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
|
||||
namespace app_list {
|
||||
@ -45,10 +45,10 @@ constexpr SkColor kInkDropHighlightColor = SkColorSetA(kInkDropBaseColor, 15);
|
||||
|
||||
constexpr SkScalar kStrokeWidth = SkIntToScalar(1);
|
||||
|
||||
class PageSwitcherButton : public views::CustomButton {
|
||||
class PageSwitcherButton : public views::Button {
|
||||
public:
|
||||
explicit PageSwitcherButton(views::ButtonListener* listener)
|
||||
: views::CustomButton(listener) {
|
||||
: views::Button(listener) {
|
||||
SetInkDropMode(InkDropMode::ON);
|
||||
}
|
||||
|
||||
@ -74,7 +74,7 @@ class PageSwitcherButton : public views::CustomButton {
|
||||
protected:
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override {
|
||||
std::unique_ptr<views::InkDropImpl> ink_drop =
|
||||
CustomButton::CreateDefaultInkDropImpl();
|
||||
Button::CreateDefaultInkDropImpl();
|
||||
ink_drop->SetShowHighlightOnHover(false);
|
||||
ink_drop->SetAutoHighlightMode(
|
||||
views::InkDropImpl::AutoHighlightMode::SHOW_ON_RIPPLE);
|
||||
@ -105,7 +105,7 @@ class PageSwitcherButton : public views::CustomButton {
|
||||
}
|
||||
|
||||
void NotifyClick(const ui::Event& event) override {
|
||||
CustomButton::NotifyClick(event);
|
||||
Button::NotifyClick(event);
|
||||
GetInkDrop()->AnimateToState(views::InkDropState::ACTION_TRIGGERED);
|
||||
}
|
||||
|
||||
@ -203,14 +203,14 @@ void PageSwitcherVertical::UpdateUIForDragPoint(const gfx::Point& point) {
|
||||
if (page >= 0 && page < button_count) {
|
||||
PageSwitcherButton* button =
|
||||
static_cast<PageSwitcherButton*>(buttons_->child_at(page));
|
||||
button->SetState(views::CustomButton::STATE_HOVERED);
|
||||
button->SetState(views::Button::STATE_HOVERED);
|
||||
return;
|
||||
}
|
||||
|
||||
for (int i = 0; i < button_count; ++i) {
|
||||
PageSwitcherButton* button =
|
||||
static_cast<PageSwitcherButton*>(buttons_->child_at(i));
|
||||
button->SetState(views::CustomButton::STATE_NORMAL);
|
||||
button->SetState(views::Button::STATE_NORMAL);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -138,7 +138,7 @@ class SearchBoxImageButton : public views::ImageButton {
|
||||
if (event.key_code() == ui::VKEY_SPACE)
|
||||
return false;
|
||||
|
||||
return CustomButton::OnKeyPressed(event);
|
||||
return Button::OnKeyPressed(event);
|
||||
}
|
||||
|
||||
private:
|
||||
|
@ -71,9 +71,9 @@ void SearchResultActionsView::CreateImageButton(
|
||||
button->SetAccessibleName(action.tooltip_text);
|
||||
button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
||||
views::ImageButton::ALIGN_MIDDLE);
|
||||
button->SetImage(views::CustomButton::STATE_NORMAL, &action.base_image);
|
||||
button->SetImage(views::CustomButton::STATE_HOVERED, &action.hover_image);
|
||||
button->SetImage(views::CustomButton::STATE_PRESSED, &action.pressed_image);
|
||||
button->SetImage(views::Button::STATE_NORMAL, &action.base_image);
|
||||
button->SetImage(views::Button::STATE_HOVERED, &action.hover_image);
|
||||
button->SetImage(views::Button::STATE_PRESSED, &action.pressed_image);
|
||||
button->SetTooltipText(action.tooltip_text);
|
||||
AddChildView(button);
|
||||
}
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "ui/app_list/app_list_view_delegate.h"
|
||||
#include "ui/app_list/search_result_observer.h"
|
||||
#include "ui/views/background.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/layout/box_layout.h"
|
||||
#include "ui/views/layout/fill_layout.h"
|
||||
|
||||
@ -22,12 +22,12 @@ constexpr int kHorizontalPadding = 16;
|
||||
|
||||
// Container of the search answer view.
|
||||
class SearchResultAnswerCardView::SearchAnswerContainerView
|
||||
: public views::CustomButton,
|
||||
: public views::Button,
|
||||
public views::ButtonListener,
|
||||
public SearchResultObserver {
|
||||
public:
|
||||
explicit SearchAnswerContainerView(AppListViewDelegate* view_delegate)
|
||||
: CustomButton(this), view_delegate_(view_delegate) {
|
||||
: Button(this), view_delegate_(view_delegate) {
|
||||
// Center the card horizontally in the container.
|
||||
views::BoxLayout* answer_container_layout =
|
||||
new views::BoxLayout(views::BoxLayout::kHorizontal,
|
||||
@ -72,7 +72,7 @@ class SearchResultAnswerCardView::SearchAnswerContainerView
|
||||
}
|
||||
}
|
||||
|
||||
// views::CustomButton overrides:
|
||||
// views::Button overrides:
|
||||
const char* GetClassName() const override {
|
||||
return "SearchAnswerContainerView";
|
||||
}
|
||||
@ -85,7 +85,7 @@ class SearchResultAnswerCardView::SearchAnswerContainerView
|
||||
return false;
|
||||
}
|
||||
|
||||
return CustomButton::OnKeyPressed(event);
|
||||
return Button::OnKeyPressed(event);
|
||||
}
|
||||
|
||||
// views::ButtonListener overrides:
|
||||
|
@ -89,7 +89,7 @@ gfx::RenderText* CreateRenderText(const base::string16& text,
|
||||
const char SearchResultView::kViewClassName[] = "ui/app_list/SearchResultView";
|
||||
|
||||
SearchResultView::SearchResultView(SearchResultListView* list_view)
|
||||
: views::CustomButton(this),
|
||||
: views::Button(this),
|
||||
list_view_(list_view),
|
||||
icon_(new views::ImageView),
|
||||
badge_icon_(new views::ImageView),
|
||||
|
@ -17,7 +17,7 @@
|
||||
#include "ui/app_list/search_result_observer.h"
|
||||
#include "ui/app_list/views/search_result_actions_view_delegate.h"
|
||||
#include "ui/views/context_menu_controller.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace gfx {
|
||||
class RenderText;
|
||||
@ -40,7 +40,7 @@ class SearchResultActionsView;
|
||||
|
||||
// SearchResultView displays a SearchResult.
|
||||
class APP_LIST_EXPORT SearchResultView
|
||||
: public views::CustomButton,
|
||||
: public views::Button,
|
||||
public views::ButtonListener,
|
||||
public views::ContextMenuController,
|
||||
public SearchResultObserver,
|
||||
|
@ -56,7 +56,7 @@ class BadgeBackgroundImageSource : public gfx::CanvasImageSource {
|
||||
namespace app_list {
|
||||
|
||||
TileItemView::TileItemView()
|
||||
: views::CustomButton(this),
|
||||
: views::Button(this),
|
||||
parent_background_color_(SK_ColorTRANSPARENT),
|
||||
icon_(new views::ImageView),
|
||||
badge_(nullptr),
|
||||
|
@ -13,7 +13,6 @@
|
||||
#include "ui/app_list/app_list_export.h"
|
||||
#include "ui/app_list/views/image_shadow_animator.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
|
||||
namespace gfx {
|
||||
class ImageSkia;
|
||||
@ -29,7 +28,7 @@ namespace app_list {
|
||||
// The view for a tile in the app list on the start/search page.
|
||||
// TODO(warx): Merge this class to its subclass SearchResultTileItemView once
|
||||
// bubble launcher deprecates.
|
||||
class APP_LIST_EXPORT TileItemView : public views::CustomButton,
|
||||
class APP_LIST_EXPORT TileItemView : public views::Button,
|
||||
public views::ButtonListener,
|
||||
public ImageShadowAnimator::Delegate {
|
||||
public:
|
||||
@ -52,7 +51,7 @@ class APP_LIST_EXPORT TileItemView : public views::CustomButton,
|
||||
// Sets the behavior of the tile item on mouse hover.
|
||||
void SetHoverStyle(HoverStyle hover_style);
|
||||
|
||||
// Overridden from views::CustomButton:
|
||||
// Overridden from views::Button:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
void PaintButtonContents(gfx::Canvas* canvas) override;
|
||||
|
||||
|
@ -135,10 +135,9 @@ views::Label* CreateAnnotationLabel(
|
||||
|
||||
} // namespace
|
||||
|
||||
CandidateView::CandidateView(
|
||||
views::ButtonListener* listener,
|
||||
ui::CandidateWindow::Orientation orientation)
|
||||
: views::CustomButton(listener),
|
||||
CandidateView::CandidateView(views::ButtonListener* listener,
|
||||
ui::CandidateWindow::Orientation orientation)
|
||||
: views::Button(listener),
|
||||
orientation_(orientation),
|
||||
shortcut_label_(NULL),
|
||||
candidate_label_(NULL),
|
||||
@ -255,7 +254,7 @@ bool CandidateView::OnMouseDragged(const ui::MouseEvent& event) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return views::CustomButton::OnMouseDragged(event);
|
||||
return views::Button::OnMouseDragged(event);
|
||||
}
|
||||
|
||||
void CandidateView::Layout() {
|
||||
|
@ -9,7 +9,7 @@
|
||||
#include "base/macros.h"
|
||||
#include "ui/base/ime/candidate_window.h"
|
||||
#include "ui/chromeos/ui_chromeos_export.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/controls/label.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
@ -17,7 +17,7 @@ namespace ui {
|
||||
namespace ime {
|
||||
|
||||
// CandidateView renderes a row of a candidate.
|
||||
class UI_CHROMEOS_EXPORT CandidateView : public views::CustomButton {
|
||||
class UI_CHROMEOS_EXPORT CandidateView : public views::Button {
|
||||
public:
|
||||
CandidateView(views::ButtonListener* listener,
|
||||
ui::CandidateWindow::Orientation orientation);
|
||||
@ -40,7 +40,7 @@ class UI_CHROMEOS_EXPORT CandidateView : public views::CustomButton {
|
||||
friend class CandidateWindowViewTest;
|
||||
FRIEND_TEST_ALL_PREFIXES(CandidateWindowViewTest, ShortcutSettingTest);
|
||||
|
||||
// Overridden from views::CustomButton:
|
||||
// Overridden from views::Button:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
|
||||
// Overridden from View:
|
||||
|
@ -44,11 +44,11 @@ views::ToggleImageButton* CreateNotificationCenterButton(
|
||||
int text_id) {
|
||||
auto* button = new views::ToggleImageButton(listener);
|
||||
ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance();
|
||||
button->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
button->SetImage(views::Button::STATE_NORMAL,
|
||||
*resource_bundle.GetImageSkiaNamed(normal_id));
|
||||
button->SetImage(views::CustomButton::STATE_HOVERED,
|
||||
button->SetImage(views::Button::STATE_HOVERED,
|
||||
*resource_bundle.GetImageSkiaNamed(hover_id));
|
||||
button->SetImage(views::CustomButton::STATE_PRESSED,
|
||||
button->SetImage(views::Button::STATE_PRESSED,
|
||||
*resource_bundle.GetImageSkiaNamed(pressed_id));
|
||||
button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
|
||||
views::ImageButton::ALIGN_MIDDLE);
|
||||
|
@ -148,7 +148,7 @@ bool MessageView::OnKeyPressed(const ui::KeyEvent& event) {
|
||||
|
||||
bool MessageView::OnKeyReleased(const ui::KeyEvent& event) {
|
||||
// Space key handling is triggerred at key-release timing. See
|
||||
// ui/views/controls/buttons/custom_button.cc for why.
|
||||
// ui/views/controls/buttons/button.cc for why.
|
||||
if (event.flags() != ui::EF_NONE || event.key_code() != ui::VKEY_SPACE)
|
||||
return false;
|
||||
|
||||
|
@ -18,7 +18,7 @@
|
||||
namespace message_center {
|
||||
|
||||
NotificationButton::NotificationButton(views::ButtonListener* listener)
|
||||
: views::CustomButton(listener), icon_(NULL), title_(NULL) {
|
||||
: views::Button(listener), icon_(NULL), title_(NULL) {
|
||||
SetFocusForPlatform();
|
||||
// Create a background so that it does not change when the MessageView
|
||||
// background changes to show touch feedback
|
||||
@ -81,7 +81,7 @@ int NotificationButton::GetHeightForWidth(int width) const {
|
||||
}
|
||||
|
||||
void NotificationButton::OnFocus() {
|
||||
views::CustomButton::OnFocus();
|
||||
views::Button::OnFocus();
|
||||
ScrollRectToVisible(GetLocalBounds());
|
||||
}
|
||||
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "ui/gfx/image/image_skia.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/painter.h"
|
||||
#include "ui/views/view.h"
|
||||
|
||||
@ -19,7 +19,7 @@ class Label;
|
||||
namespace message_center {
|
||||
|
||||
// NotificationButtons render the action buttons of notifications.
|
||||
class NotificationButton : public views::CustomButton {
|
||||
class NotificationButton : public views::Button {
|
||||
public:
|
||||
NotificationButton(views::ButtonListener* listener);
|
||||
~NotificationButton() override;
|
||||
@ -34,7 +34,7 @@ class NotificationButton : public views::CustomButton {
|
||||
void ViewHierarchyChanged(
|
||||
const ViewHierarchyChangedDetails& details) override;
|
||||
|
||||
// Overridden from views::CustomButton:
|
||||
// Overridden from views::Button:
|
||||
void StateChanged(ButtonState old_state) override;
|
||||
|
||||
private:
|
||||
|
@ -55,7 +55,7 @@ void NotificationControlButtonsView::ShowCloseButton(bool show) {
|
||||
if (show && !close_button_) {
|
||||
close_button_ = base::MakeUnique<message_center::PaddedButton>(this);
|
||||
close_button_->set_owned_by_client();
|
||||
close_button_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
close_button_->SetImage(views::Button::STATE_NORMAL,
|
||||
message_center::GetCloseIcon());
|
||||
close_button_->SetAccessibleName(l10n_util::GetStringUTF16(
|
||||
IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME));
|
||||
@ -77,7 +77,7 @@ void NotificationControlButtonsView::ShowSettingsButton(bool show) {
|
||||
if (show && !settings_button_) {
|
||||
settings_button_ = base::MakeUnique<message_center::PaddedButton>(this);
|
||||
settings_button_->set_owned_by_client();
|
||||
settings_button_->SetImage(views::CustomButton::STATE_NORMAL,
|
||||
settings_button_->SetImage(views::Button::STATE_NORMAL,
|
||||
message_center::GetSettingsIcon());
|
||||
settings_button_->SetAccessibleName(l10n_util::GetStringUTF16(
|
||||
IDS_MESSAGE_NOTIFICATION_SETTINGS_BUTTON_ACCESSIBLE_NAME));
|
||||
@ -131,11 +131,11 @@ bool NotificationControlButtonsView::IsSettingsButtonFocused() const {
|
||||
return settings_button_ && settings_button_->HasFocus();
|
||||
}
|
||||
|
||||
views::CustomButton* NotificationControlButtonsView::close_button() const {
|
||||
views::Button* NotificationControlButtonsView::close_button() const {
|
||||
return close_button_.get();
|
||||
}
|
||||
|
||||
views::CustomButton* NotificationControlButtonsView::settings_button() const {
|
||||
views::Button* NotificationControlButtonsView::settings_button() const {
|
||||
return settings_button_.get();
|
||||
}
|
||||
|
||||
|
@ -21,7 +21,7 @@ class LinearAnimation;
|
||||
}
|
||||
|
||||
namespace views {
|
||||
class CustomButton;
|
||||
class Button;
|
||||
}
|
||||
|
||||
namespace message_center {
|
||||
@ -59,8 +59,8 @@ class MESSAGE_CENTER_EXPORT NotificationControlButtonsView
|
||||
bool IsSettingsButtonFocused() const;
|
||||
|
||||
// Methods for retrieving the control buttons directly.
|
||||
views::CustomButton* close_button() const;
|
||||
views::CustomButton* settings_button() const;
|
||||
views::Button* close_button() const;
|
||||
views::Button* settings_button() const;
|
||||
|
||||
// views::View
|
||||
const char* GetClassName() const override;
|
||||
|
@ -132,7 +132,7 @@ base::string16 FormatToRelativeTime(base::Time past) {
|
||||
NotificationHeaderView::NotificationHeaderView(
|
||||
NotificationControlButtonsView* control_buttons_view,
|
||||
views::ButtonListener* listener)
|
||||
: views::CustomButton(listener) {
|
||||
: views::Button(listener) {
|
||||
SetInkDropMode(InkDropMode::ON);
|
||||
set_has_ink_drop_action_on_click(true);
|
||||
set_animate_on_state_change(true);
|
||||
|
@ -7,7 +7,7 @@
|
||||
|
||||
#include "base/macros.h"
|
||||
#include "ui/message_center/message_center_style.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
|
||||
namespace views {
|
||||
class ImageView;
|
||||
@ -18,7 +18,7 @@ namespace message_center {
|
||||
|
||||
class NotificationControlButtonsView;
|
||||
|
||||
class NotificationHeaderView : public views::CustomButton {
|
||||
class NotificationHeaderView : public views::Button {
|
||||
public:
|
||||
NotificationHeaderView(NotificationControlButtonsView* control_buttons_view,
|
||||
views::ButtonListener* listener);
|
||||
@ -41,7 +41,7 @@ class NotificationHeaderView : public views::CustomButton {
|
||||
void ClearTimestamp();
|
||||
bool IsExpandButtonEnabled();
|
||||
|
||||
// CustomButton override:
|
||||
// Button override:
|
||||
std::unique_ptr<views::InkDrop> CreateInkDrop() override;
|
||||
std::unique_ptr<views::InkDropRipple> CreateInkDropRipple() const override;
|
||||
std::unique_ptr<views::InkDropHighlight> CreateInkDropHighlight()
|
||||
|
@ -346,7 +346,7 @@ TEST_F(NotificationViewMDTest, UpdateButtonsStateTest) {
|
||||
notification_view()->ToggleExpanded();
|
||||
EXPECT_TRUE(notification_view()->actions_row_->visible());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel inside the boundary of the action
|
||||
@ -358,12 +358,12 @@ TEST_F(NotificationViewMDTest, UpdateButtonsStateTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
notification_view()->CreateOrUpdateViews(*notification());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel outside the boundary of the
|
||||
@ -373,7 +373,7 @@ TEST_F(NotificationViewMDTest, UpdateButtonsStateTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
}
|
||||
|
||||
@ -387,9 +387,9 @@ TEST_F(NotificationViewMDTest, UpdateButtonCountTest) {
|
||||
notification_view()->ToggleExpanded();
|
||||
EXPECT_TRUE(notification_view()->actions_row_->visible());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[1]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel inside the boundary of the action
|
||||
@ -403,15 +403,15 @@ TEST_F(NotificationViewMDTest, UpdateButtonCountTest) {
|
||||
views::test::WidgetTest::GetEventSink(widget())->OnEventFromSource(&move);
|
||||
EXPECT_FALSE(details.dispatcher_destroyed);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[1]->state());
|
||||
|
||||
notification()->set_buttons(CreateButtons(1));
|
||||
notification_view()->UpdateWithNotification(*notification());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(1u, notification_view()->action_buttons_.size());
|
||||
|
||||
@ -422,7 +422,7 @@ TEST_F(NotificationViewMDTest, UpdateButtonCountTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
}
|
||||
|
||||
|
@ -167,11 +167,11 @@ class NotificationViewTest : public views::ViewsTestBase,
|
||||
}
|
||||
}
|
||||
|
||||
views::CustomButton* GetCloseButton() {
|
||||
views::Button* GetCloseButton() {
|
||||
return notification_view()->control_buttons_view_->close_button();
|
||||
}
|
||||
|
||||
views::CustomButton* GetSettingsButton() {
|
||||
views::Button* GetSettingsButton() {
|
||||
return notification_view()->control_buttons_view_->settings_button();
|
||||
}
|
||||
|
||||
@ -481,7 +481,7 @@ TEST_F(NotificationViewTest, UpdateButtonsStateTest) {
|
||||
notification_view()->UpdateWithNotification(*notification());
|
||||
widget()->Show();
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel inside the boundary of the action
|
||||
@ -493,12 +493,12 @@ TEST_F(NotificationViewTest, UpdateButtonsStateTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
notification_view()->UpdateWithNotification(*notification());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel outside the boundary of the
|
||||
@ -508,7 +508,7 @@ TEST_F(NotificationViewTest, UpdateButtonsStateTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
}
|
||||
|
||||
@ -517,9 +517,9 @@ TEST_F(NotificationViewTest, UpdateButtonCountTest) {
|
||||
notification_view()->UpdateWithNotification(*notification());
|
||||
widget()->Show();
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[1]->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel inside the boundary of the action
|
||||
@ -533,15 +533,15 @@ TEST_F(NotificationViewTest, UpdateButtonCountTest) {
|
||||
views::test::WidgetTest::GetEventSink(widget())->OnEventFromSource(&move);
|
||||
EXPECT_FALSE(details.dispatcher_destroyed);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[1]->state());
|
||||
|
||||
notification()->set_buttons(CreateButtons(1));
|
||||
notification_view()->UpdateWithNotification(*notification());
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED,
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
EXPECT_EQ(1u, notification_view()->action_buttons_.size());
|
||||
|
||||
@ -552,7 +552,7 @@ TEST_F(NotificationViewTest, UpdateButtonCountTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL,
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL,
|
||||
notification_view()->action_buttons_[0]->state());
|
||||
}
|
||||
|
||||
@ -570,7 +570,7 @@ TEST_F(NotificationViewTest, SettingsButtonTest) {
|
||||
widget()->Show();
|
||||
|
||||
EXPECT_TRUE(NULL != GetSettingsButton());
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL, GetSettingsButton()->state());
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL, GetSettingsButton()->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel inside the boundary of the action
|
||||
// button.
|
||||
@ -583,7 +583,7 @@ TEST_F(NotificationViewTest, SettingsButtonTest) {
|
||||
views::test::WidgetTest::GetEventSink(widget())->OnEventFromSource(&move);
|
||||
EXPECT_FALSE(details.dispatcher_destroyed);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_HOVERED, GetSettingsButton()->state());
|
||||
EXPECT_EQ(views::Button::STATE_HOVERED, GetSettingsButton()->state());
|
||||
|
||||
// Now construct a mouse move event 1 pixel outside the boundary of the
|
||||
// widget.
|
||||
@ -592,7 +592,7 @@ TEST_F(NotificationViewTest, SettingsButtonTest) {
|
||||
ui::EventTimeForNow(), ui::EF_NONE, ui::EF_NONE);
|
||||
widget()->OnMouseEvent(&move);
|
||||
|
||||
EXPECT_EQ(views::CustomButton::STATE_NORMAL, GetSettingsButton()->state());
|
||||
EXPECT_EQ(views::Button::STATE_NORMAL, GetSettingsButton()->state());
|
||||
}
|
||||
|
||||
TEST_F(NotificationViewTest, ViewOrderingTest) {
|
||||
|
@ -234,7 +234,7 @@ NotifierSettingsView::NotifierButton::NotifierButton(
|
||||
NotifierSettingsProvider* provider,
|
||||
std::unique_ptr<Notifier> notifier,
|
||||
views::ButtonListener* listener)
|
||||
: views::CustomButton(listener),
|
||||
: views::Button(listener),
|
||||
provider_(provider),
|
||||
notifier_(std::move(notifier)),
|
||||
icon_view_(new views::ImageView()),
|
||||
@ -337,7 +337,7 @@ void NotifierSettingsView::NotifierButton::ButtonPressed(
|
||||
// the state on NotifierSettingsView::ButtonPressed() too, so here change
|
||||
// back to the previous state.
|
||||
checkbox_->SetChecked(!checkbox_->checked());
|
||||
CustomButton::NotifyClick(event);
|
||||
Button::NotifyClick(event);
|
||||
} else if (button == learn_more_) {
|
||||
DCHECK(provider_);
|
||||
provider_->OnNotifierAdvancedSettingsRequested(notifier_->notifier_id,
|
||||
|
@ -56,8 +56,8 @@ class MESSAGE_CENTER_EXPORT NotifierSettingsView
|
||||
private:
|
||||
FRIEND_TEST_ALL_PREFIXES(NotifierSettingsViewTest, TestLearnMoreButton);
|
||||
|
||||
class MESSAGE_CENTER_EXPORT NotifierButton : public views::CustomButton,
|
||||
public views::ButtonListener {
|
||||
class MESSAGE_CENTER_EXPORT NotifierButton : public views::Button,
|
||||
public views::ButtonListener {
|
||||
public:
|
||||
NotifierButton(NotifierSettingsProvider* provider,
|
||||
std::unique_ptr<Notifier> notifier,
|
||||
|
@ -82,7 +82,6 @@ component("views") {
|
||||
"controls/button/blue_button.h",
|
||||
"controls/button/button.h",
|
||||
"controls/button/checkbox.h",
|
||||
"controls/button/custom_button.h",
|
||||
"controls/button/image_button.h",
|
||||
"controls/button/image_button_factory.h",
|
||||
"controls/button/label_button.h",
|
||||
@ -277,7 +276,6 @@ component("views") {
|
||||
"controls/button/blue_button.cc",
|
||||
"controls/button/button.cc",
|
||||
"controls/button/checkbox.cc",
|
||||
"controls/button/custom_button.cc",
|
||||
"controls/button/image_button.cc",
|
||||
"controls/button/image_button_factory.cc",
|
||||
"controls/button/label_button.cc",
|
||||
@ -893,7 +891,7 @@ source_set("views_unittests_sources") {
|
||||
"cocoa/cocoa_mouse_capture_unittest.mm",
|
||||
"cocoa/drag_drop_client_mac_unittest.mm",
|
||||
"controls/button/blue_button_unittest.cc",
|
||||
"controls/button/custom_button_unittest.cc",
|
||||
"controls/button/button_unittest.cc",
|
||||
"controls/button/image_button_factory_unittest.cc",
|
||||
"controls/button/image_button_unittest.cc",
|
||||
"controls/button/label_button_label_unittest.cc",
|
||||
|
@ -22,7 +22,7 @@
|
||||
#include "ui/base/layout.h"
|
||||
#include "ui/base/win/accessibility_misc_utils.h"
|
||||
#include "ui/base/win/atl_module.h"
|
||||
#include "ui/views/controls/button/custom_button.h"
|
||||
#include "ui/views/controls/button/button.h"
|
||||
#include "ui/views/focus/focus_manager.h"
|
||||
#include "ui/views/widget/widget.h"
|
||||
#include "ui/views/win/hwnd_util.h"
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user