Commit 07a3b281 authored by Peter Kasting's avatar Peter Kasting Committed by Chromium LUCI CQ

Add metadata for misc. files in c/b/ui/views.

Bug: 1159562
Change-Id: Ib43a3205a0c553e97693e63ecc8838edaa540a9a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2628020
Commit-Queue: Peter Kasting <pkasting@chromium.org>
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Auto-Submit: Peter Kasting <pkasting@chromium.org>
Reviewed-by: default avatarAllen Bauer <kylixrd@chromium.org>
Cr-Commit-Position: refs/heads/master@{#843627}
parent 488d85a1
......@@ -16,6 +16,7 @@
#include "content/public/browser/render_process_host.h"
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/metadata/metadata_impl_macros.h"
FileSystemAccessIconView::FileSystemAccessIconView(
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
......@@ -97,6 +98,5 @@ const gfx::VectorIcon& FileSystemAccessIconView::GetVectorIcon() const {
: vector_icons::kInsertDriveFileOutlineIcon;
}
const char* FileSystemAccessIconView::GetClassName() const {
return "FileSystemAccessIconView";
}
BEGIN_METADATA(FileSystemAccessIconView, PageActionIconView)
END_METADATA
......@@ -6,15 +6,19 @@
#define CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_ICON_VIEW_H_
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
// Page action icon indicating if the current page is using the File System
// Access API. Shows different icons for read access to directories and write
// access to files or directories.
class FileSystemAccessIconView : public PageActionIconView {
public:
METADATA_HEADER(FileSystemAccessIconView);
FileSystemAccessIconView(
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate);
FileSystemAccessIconView(const FileSystemAccessIconView&) = delete;
FileSystemAccessIconView& operator=(const FileSystemAccessIconView&) = delete;
// PageActionIconView:
views::BubbleDialogDelegate* GetBubble() const override;
......@@ -22,12 +26,9 @@ class FileSystemAccessIconView : public PageActionIconView {
base::string16 GetTextForTooltipAndAccessibleName() const override;
void OnExecuting(ExecuteSource execute_source) override;
const gfx::VectorIcon& GetVectorIcon() const override;
const char* GetClassName() const override;
private:
bool has_write_access_ = false;
DISALLOW_COPY_AND_ASSIGN(FileSystemAccessIconView);
};
#endif // CHROME_BROWSER_UI_VIEWS_FILE_SYSTEM_ACCESS_FILE_SYSTEM_ACCESS_ICON_VIEW_H_
......@@ -21,6 +21,7 @@
#include "ui/base/l10n/l10n_util.h"
#include "ui/events/event_utils.h"
#include "ui/views/layout/animating_layout_manager_test_util.h"
#include "ui/views/view_utils.h"
// The param indicates if the feature showing password icon in the new toolbar
// status chip is enabled.
......@@ -53,7 +54,7 @@ class ManagePasswordsIconViewTest : public ManagePasswordsTest,
BrowserView::GetBrowserViewForBrowser(browser())
->toolbar_button_provider()
->GetPageActionIconView(PageActionIconType::kManagePasswords);
DCHECK_EQ(view->GetClassName(), ManagePasswordsIconViews::kClassName);
DCHECK(views::IsViewClass<ManagePasswordsIconViews>(view));
return static_cast<ManagePasswordsIconViews*>(view);
}
......
......@@ -13,8 +13,7 @@
#include "content/public/browser/web_contents.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
const char ManagePasswordsIconViews::kClassName[] = "ManagePasswordsIconViews";
#include "ui/views/metadata/metadata_impl_macros.h"
ManagePasswordsIconViews::ManagePasswordsIconViews(
CommandUpdater* updater,
......@@ -108,6 +107,5 @@ void ManagePasswordsIconViews::AboutToRequestFocusFromTabTraversal(
PasswordBubbleViewBase::ActivateBubble();
}
const char* ManagePasswordsIconViews::GetClassName() const {
return kClassName;
}
BEGIN_METADATA(ManagePasswordsIconViews, PageActionIconView)
END_METADATA
......@@ -5,11 +5,11 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEWS_H_
#define CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEWS_H_
#include "base/macros.h"
#include "chrome/browser/ui/passwords/manage_passwords_icon_view.h"
#include "chrome/browser/ui/views/location_bar/location_bar_view.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "ui/views/controls/image_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
class CommandUpdater;
......@@ -17,12 +17,13 @@ class CommandUpdater;
class ManagePasswordsIconViews : public ManagePasswordsIconView,
public PageActionIconView {
public:
static const char kClassName[];
METADATA_HEADER(ManagePasswordsIconViews);
ManagePasswordsIconViews(
CommandUpdater* updater,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate);
ManagePasswordsIconViews(const ManagePasswordsIconViews&) = delete;
ManagePasswordsIconViews& operator=(const ManagePasswordsIconViews&) = delete;
~ManagePasswordsIconViews() override;
// ManagePasswordsIconView:
......@@ -38,7 +39,6 @@ class ManagePasswordsIconViews : public ManagePasswordsIconView,
// views::View:
void AboutToRequestFocusFromTabTraversal(bool reverse) override;
const char* GetClassName() const override;
private:
friend class ManagePasswordsIconViewTest;
......@@ -47,8 +47,6 @@ class ManagePasswordsIconViews : public ManagePasswordsIconView,
void UpdateUiForState();
password_manager::ui::State state_ = password_manager::ui::INACTIVE_STATE;
DISALLOW_COPY_AND_ASSIGN(ManagePasswordsIconViews);
};
#endif // CHROME_BROWSER_UI_VIEWS_PASSWORDS_MANAGE_PASSWORDS_ICON_VIEWS_H_
......@@ -102,7 +102,7 @@ void PaymentRequestItemList::Item::Init() {
content->SetCanProcessEventsWithinSubtree(false);
layout->AddView(std::move(content));
layout->AddView(CreateCheckmark(selected() && clickable()));
layout->AddView(CreateCheckmark(selected() && GetClickable()));
if (extra_view)
layout->AddView(std::move(extra_view));
......
......@@ -9,13 +9,11 @@
#include "ui/native_theme/native_theme.h"
#include "ui/views/background.h"
#include "ui/views/border.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "ui/views/widget/widget.h"
namespace payments {
// static
constexpr char PaymentRequestRowView::kClassName[];
PaymentRequestRowView::PaymentRequestRowView(PressedCallback callback,
bool clickable,
const gfx::Insets& insets)
......@@ -34,8 +32,8 @@ PaymentRequestRowView::PaymentRequestRowView(PressedCallback callback,
PaymentRequestRowView::~PaymentRequestRowView() {}
const char* PaymentRequestRowView::GetClassName() const {
return kClassName;
bool PaymentRequestRowView::GetClickable() const {
return clickable_;
}
void PaymentRequestRowView::SetActiveBackground() {
......@@ -73,7 +71,7 @@ void PaymentRequestRowView::SetIsHighlighted(bool highlighted) {
void PaymentRequestRowView::StateChanged(ButtonState old_state) {
Button::StateChanged(old_state);
if (!clickable())
if (!GetClickable())
return;
SetIsHighlighted(GetState() == views::Button::STATE_HOVERED ||
......@@ -81,17 +79,21 @@ void PaymentRequestRowView::StateChanged(ButtonState old_state) {
}
void PaymentRequestRowView::OnFocus() {
if (clickable()) {
if (GetClickable()) {
SetIsHighlighted(true);
SchedulePaint();
}
}
void PaymentRequestRowView::OnBlur() {
if (clickable()) {
if (GetClickable()) {
SetIsHighlighted(false);
SchedulePaint();
}
}
BEGIN_METADATA(PaymentRequestRowView, views::Button)
ADD_READONLY_PROPERTY_METADATA(bool, Clickable)
END_METADATA
} // namespace payments
......@@ -5,9 +5,9 @@
#ifndef CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_PAYMENTS_PAYMENT_REQUEST_ROW_VIEW_H_
#include "base/macros.h"
#include "base/memory/weak_ptr.h"
#include "ui/views/controls/button/button.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace payments {
......@@ -17,24 +17,22 @@ class PaymentRequestRowView
: public views::Button,
public base::SupportsWeakPtr<PaymentRequestRowView> {
public:
static constexpr char kClassName[] = "PaymentRequestRowView";
METADATA_HEADER(PaymentRequestRowView);
// 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.
PaymentRequestRowView(PressedCallback callback,
bool clickable,
const gfx::Insets& insets);
PaymentRequestRowView(const PaymentRequestRowView&) = delete;
PaymentRequestRowView& operator=(const PaymentRequestRowView&) = delete;
~PaymentRequestRowView() override;
void set_previous_row(base::WeakPtr<PaymentRequestRowView> previous_row) {
previous_row_ = previous_row;
}
// views::View:
const char* GetClassName() const override;
protected:
bool clickable() { return clickable_; }
bool GetClickable() const;
private:
// Sets this row's background to the theme's hovered color to indicate that
......@@ -64,8 +62,6 @@ class PaymentRequestRowView
// A non-owned pointer to the previous row object in the UI. Used to hide the
// bottom border of the previous row when highlighting this one. May be null.
base::WeakPtr<PaymentRequestRowView> previous_row_;
DISALLOW_COPY_AND_ASSIGN(PaymentRequestRowView);
};
} // namespace payments
......
......@@ -85,12 +85,12 @@ class ProfileItem : public PaymentRequestItemList::Item {
// In order to be selectable, a profile entry needs to be enabled, and the
// profile valid according to the controller. If either condition is false,
// PerformSelectionFallback() is called.
return clickable() && controller_->IsValidProfile(*profile_);
return GetClickable() && controller_->IsValidProfile(*profile_);
}
void PerformSelectionFallback() override {
// If enabled, the editor is opened to complete the invalid profile.
if (clickable())
if (GetClickable())
controller_->ShowEditor(profile_);
}
......
......@@ -39,6 +39,7 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/controls/button/button_controller.h"
#include "ui/views/controls/highlight_path_generator.h"
#include "ui/views/metadata/metadata_impl_macros.h"
#include "url/gurl.h"
namespace {
......@@ -113,10 +114,6 @@ ReadLaterButton::ReadLaterButton(Browser* browser)
ReadLaterButton::~ReadLaterButton() = default;
const char* ReadLaterButton::GetClassName() const {
return "ReadLaterButton";
}
void ReadLaterButton::CloseBubble() {
if (webui_bubble_manager_->GetBubbleWidget())
webui_bubble_manager_->CloseBubble();
......@@ -215,3 +212,6 @@ void ReadLaterButton::ButtonPressed() {
}
}
}
BEGIN_METADATA(ReadLaterButton, views::LabelButton)
END_METADATA
......@@ -11,6 +11,7 @@
#include "components/reading_list/core/reading_list_model.h"
#include "components/reading_list/core/reading_list_model_observer.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/widget/widget_observer.h"
#include "ui/views/widget/widget_utils.h"
......@@ -24,13 +25,12 @@ class ReadLaterButton : public views::LabelButton,
public views::WidgetObserver,
public ReadingListModelObserver {
public:
METADATA_HEADER(ReadLaterButton);
explicit ReadLaterButton(Browser* browser);
ReadLaterButton(const ReadLaterButton&) = delete;
ReadLaterButton& operator=(const ReadLaterButton&) = delete;
~ReadLaterButton() override;
const char* GetClassName() const override;
void CloseBubble();
private:
......
......@@ -18,6 +18,7 @@
#include "services/metrics/public/cpp/ukm_builders.h"
#include "services/metrics/public/cpp/ukm_recorder.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/views/metadata/metadata_impl_macros.h"
using dom_distiller::UMAHelper;
using dom_distiller::url_utils::IsDistilledPage;
......@@ -134,10 +135,6 @@ base::string16 ReaderModeIconView::GetTextForTooltipAndAccessibleName() const {
: IDS_DISTILL_PAGE);
}
const char* ReaderModeIconView::GetClassName() const {
return "ReaderModeIconView";
}
// TODO(gilmanmh): Consider displaying a bubble the first time a user
// activates the icon to explain what Reader Mode is.
views::BubbleDialogDelegate* ReaderModeIconView::GetBubble() const {
......@@ -186,3 +183,6 @@ void ReaderModeIconView::OnResult(
UMAHelper::ReaderModePageType page_type = GetPageType(web_contents);
UMAHelper::StartTimerIfNeeded(web_contents, page_type);
}
BEGIN_METADATA(ReaderModeIconView, PageActionIconView)
END_METADATA
......@@ -5,12 +5,12 @@
#ifndef CHROME_BROWSER_UI_VIEWS_READER_MODE_READER_MODE_ICON_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_READER_MODE_READER_MODE_ICON_VIEW_H_
#include "base/macros.h"
#include "base/strings/string16.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "components/dom_distiller/content/browser/distillable_page_utils.h"
#include "content/public/browser/web_contents_observer.h"
#include "ui/gfx/vector_icon_types.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace content {
class NavigationHandle;
......@@ -23,10 +23,13 @@ class ReaderModeIconView : public PageActionIconView,
public dom_distiller::DistillabilityObserver,
public content::WebContentsObserver {
public:
METADATA_HEADER(ReaderModeIconView);
ReaderModeIconView(CommandUpdater* command_updater,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate,
PrefService* pref_service);
ReaderModeIconView(const ReaderModeIconView&) = delete;
ReaderModeIconView& operator=(const ReaderModeIconView&) = delete;
~ReaderModeIconView() override;
protected:
......@@ -43,7 +46,6 @@ class ReaderModeIconView : public PageActionIconView,
void UpdateImpl() override;
const gfx::VectorIcon& GetVectorIcon() const override;
base::string16 GetTextForTooltipAndAccessibleName() const override;
const char* GetClassName() const override;
void OnExecuting(PageActionIconView::ExecuteSource execute_source) override;
// GetBubble() is required by PageActionIconView; however, the icon
......@@ -55,8 +57,6 @@ class ReaderModeIconView : public PageActionIconView,
private:
PrefService* pref_service_;
DISALLOW_COPY_AND_ASSIGN(ReaderModeIconView);
};
#endif // CHROME_BROWSER_UI_VIEWS_READER_MODE_READER_MODE_ICON_VIEW_H_
......@@ -16,6 +16,7 @@
#include "components/send_tab_to_self/features.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace send_tab_to_self {
......@@ -100,10 +101,6 @@ const gfx::VectorIcon& SendTabToSelfIconView::GetVectorIcon() const {
return kSendTabToSelfIcon;
}
const char* SendTabToSelfIconView::GetClassName() const {
return "SendTabToSelfIconView";
}
base::string16 SendTabToSelfIconView::GetTextForTooltipAndAccessibleName()
const {
return l10n_util::GetStringUTF16(IDS_OMNIBOX_TOOLTIP_SEND_TAB_TO_SELF);
......@@ -159,4 +156,7 @@ void SendTabToSelfIconView::UpdateOpacity() {
static_cast<float>(kLargeNumber));
}
BEGIN_METADATA(SendTabToSelfIconView, PageActionIconView)
END_METADATA
} // namespace send_tab_to_self
......@@ -5,8 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_ICON_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_SEND_TAB_TO_SELF_SEND_TAB_TO_SELF_ICON_VIEW_H_
#include "base/macros.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
class CommandUpdater;
......@@ -18,10 +18,13 @@ class SendTabToSelfBubbleController;
// choose to share the url to a target device.
class SendTabToSelfIconView : public PageActionIconView {
public:
METADATA_HEADER(SendTabToSelfIconView);
SendTabToSelfIconView(
CommandUpdater* command_updater,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate);
SendTabToSelfIconView(const SendTabToSelfIconView&) = delete;
SendTabToSelfIconView& operator=(const SendTabToSelfIconView&) = delete;
~SendTabToSelfIconView() override;
// PageActionIconView:
......@@ -37,7 +40,6 @@ class SendTabToSelfIconView : public PageActionIconView {
// PageActionIconView:
void OnExecuting(PageActionIconView::ExecuteSource execute_source) override;
const gfx::VectorIcon& GetVectorIcon() const override;
const char* GetClassName() const override;
// Updates the opacity according to the length of the label view as it is
// shrinking.
......@@ -53,8 +55,6 @@ class SendTabToSelfIconView : public PageActionIconView {
// Indicates whether the "Sending..." animation has been shown since the last
// time the omnibox was in focus.
AnimationState sending_animation_state_ = AnimationState::kNotShown;
DISALLOW_COPY_AND_ASSIGN(SendTabToSelfIconView);
};
} // namespace send_tab_to_self
......
......@@ -12,6 +12,7 @@
#include "ui/strings/grit/ui_strings.h"
#include "ui/views/animation/ink_drop.h"
#include "ui/views/bubble/bubble_dialog_delegate_view.h"
#include "ui/views/metadata/metadata_impl_macros.h"
namespace {
// Progress state when the full length of the animation text is visible.
......@@ -85,7 +86,7 @@ void SharingIconView::UpdateImpl() {
const bool is_bubble_showing = IsBubbleShowing();
const bool is_visible =
is_bubble_showing || IsLoadingAnimationVisible() || label()->GetVisible();
is_bubble_showing || loading_animation_ || label()->GetVisible();
SetVisible(is_visible);
UpdateInkDrop(is_bubble_showing);
......@@ -151,10 +152,6 @@ const gfx::VectorIcon& SharingIconView::GetVectorIconBadge() const {
void SharingIconView::OnExecuting(
PageActionIconView::ExecuteSource execute_source) {}
bool SharingIconView::IsLoadingAnimationVisible() {
return loading_animation_;
}
views::BubbleDialogDelegate* SharingIconView::GetBubble() const {
auto* controller = GetController();
return controller ? get_bubble_callback_.Run(controller->dialog()) : nullptr;
......@@ -171,6 +168,5 @@ base::string16 SharingIconView::GetTextForTooltipAndAccessibleName() const {
: base::string16();
}
const char* SharingIconView::GetClassName() const {
return "SharingIconView";
}
BEGIN_METADATA(SharingIconView, PageActionIconView)
END_METADATA
......@@ -8,6 +8,7 @@
#include "chrome/browser/sharing/sharing_ui_controller.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "third_party/skia/include/core/SkColor.h"
#include "ui/views/metadata/metadata_header_macros.h"
namespace views {
// TODO(ellyjones): Remove this.
......@@ -17,17 +18,20 @@ class BubbleDialogDelegateView;
// The location bar icon to show the sharing features bubble.
class SharingIconView : public PageActionIconView {
public:
METADATA_HEADER(SharingIconView);
using GetControllerCallback =
base::RepeatingCallback<SharingUiController*(content::WebContents*)>;
using GetBubbleCallback =
base::RepeatingCallback<views::BubbleDialogDelegateView*(SharingDialog*)>;
explicit SharingIconView(
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate,
GetControllerCallback get_controller,
GetBubbleCallback get_bubble);
SharingIconView(IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate,
GetControllerCallback get_controller,
GetBubbleCallback get_bubble);
SharingIconView(const SharingIconView&) = delete;
SharingIconView& operator=(const SharingIconView&) = delete;
~SharingIconView() override;
void StartLoadingAnimation();
......@@ -42,7 +46,6 @@ class SharingIconView : public PageActionIconView {
void UpdateImpl() override;
const gfx::VectorIcon& GetVectorIcon() const override;
base::string16 GetTextForTooltipAndAccessibleName() const override;
const char* GetClassName() const override;
// gfx::AnimationDelegate:
void AnimationProgressed(const gfx::Animation* animation) override;
......@@ -52,7 +55,6 @@ class SharingIconView : public PageActionIconView {
void UpdateInkDrop(bool activate);
void UpdateOpacity();
bool IsLoadingAnimationVisible();
private:
SharingUiController* last_controller_ = nullptr;
......@@ -60,7 +62,5 @@ class SharingIconView : public PageActionIconView {
bool should_show_error_ = false;
GetControllerCallback get_controller_callback_;
GetBubbleCallback get_bubble_callback_;
DISALLOW_COPY_AND_ASSIGN(SharingIconView);
};
#endif // CHROME_BROWSER_UI_VIEWS_SHARING_SHARING_ICON_VIEW_H_
......@@ -20,6 +20,7 @@
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/controls/label.h"
#include "ui/views/layout/box_layout.h"
#include "ui/views/metadata/metadata_impl_macros.h"
DiceBubbleSyncPromoView::DiceBubbleSyncPromoView(
Profile* profile,
......@@ -86,6 +87,5 @@ void DiceBubbleSyncPromoView::EnableSync() {
delegate_->OnEnableSync(account.value_or(AccountInfo()));
}
const char* DiceBubbleSyncPromoView::GetClassName() const {
return "DiceBubbleSyncPromoView";
}
BEGIN_METADATA(DiceBubbleSyncPromoView, views::View)
END_METADATA
......@@ -8,9 +8,9 @@
#include <memory>
#include <vector>
#include "base/macros.h"
#include "chrome/browser/ui/sync/bubble_sync_promo_delegate.h"
#include "components/signin/public/base/signin_metrics.h"
#include "ui/views/metadata/metadata_header_macros.h"
#include "ui/views/style/typography.h"
#include "ui/views/view.h"
......@@ -27,6 +27,7 @@ class DiceSigninButtonView;
// with the user full name and avatar icon and allows the user to enable sync.
class DiceBubbleSyncPromoView : public views::View {
public:
METADATA_HEADER(DiceBubbleSyncPromoView);
// Creates a personalized sync promo view.
// |delegate| is not owned by DiceBubbleSyncPromoView.
// The promo message is set to |accounts_promo_message_resource_id| when
......@@ -42,6 +43,8 @@ class DiceBubbleSyncPromoView : public views::View {
int accounts_promo_message_resource_id = 0,
bool signin_button_prominent = true,
int text_style = views::style::STYLE_PRIMARY);
DiceBubbleSyncPromoView(const DiceBubbleSyncPromoView&) = delete;
DiceBubbleSyncPromoView& operator=(const DiceBubbleSyncPromoView&) = delete;
~DiceBubbleSyncPromoView() override;
// Returns the sign-in button.
......@@ -52,13 +55,8 @@ class DiceBubbleSyncPromoView : public views::View {
// pressed.
void EnableSync();
// views::View:
const char* GetClassName() const override;
// Delegate, to handle clicks on the sign-in buttons.
BubbleSyncPromoDelegate* delegate_;
DiceSigninButtonView* signin_button_view_ = nullptr;
DISALLOW_COPY_AND_ASSIGN(DiceBubbleSyncPromoView);
};
#endif // CHROME_BROWSER_UI_VIEWS_SYNC_DICE_BUBBLE_SYNC_PROMO_VIEW_H_
......@@ -19,6 +19,7 @@
#include "components/translate/core/browser/translate_metrics_logger.h"
#include "ui/base/l10n/l10n_util.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/views/metadata/metadata_impl_macros.h"
TranslateIconView::TranslateIconView(
CommandUpdater* command_updater,
......@@ -75,6 +76,5 @@ base::string16 TranslateIconView::GetTextForTooltipAndAccessibleName() const {
return l10n_util::GetStringUTF16(IDS_TOOLTIP_TRANSLATE);
}
const char* TranslateIconView::GetClassName() const {
return "TranslateIconView";
}
BEGIN_METADATA(TranslateIconView, PageActionIconView)
END_METADATA
......@@ -5,8 +5,8 @@
#ifndef CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_
#define CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_
#include "base/macros.h"
#include "chrome/browser/ui/views/page_action/page_action_icon_view.h"
#include "ui/views/metadata/metadata_header_macros.h"
class CommandUpdater;
......@@ -14,9 +14,12 @@ class CommandUpdater;
// the page translated.
class TranslateIconView : public PageActionIconView {
public:
METADATA_HEADER(TranslateIconView);
TranslateIconView(CommandUpdater* command_updater,
IconLabelBubbleView::Delegate* icon_label_bubble_delegate,
PageActionIconView::Delegate* page_action_icon_delegate);
TranslateIconView(const TranslateIconView&) = delete;
TranslateIconView& operator=(const TranslateIconView&) = delete;
~TranslateIconView() override;
// PageActionIconView:
......@@ -29,10 +32,6 @@ class TranslateIconView : public PageActionIconView {
void OnPressed(bool activated) override;
const gfx::VectorIcon& GetVectorIcon() const override;
base::string16 GetTextForTooltipAndAccessibleName() const override;
const char* GetClassName() const override;
private:
DISALLOW_COPY_AND_ASSIGN(TranslateIconView);
};
#endif // CHROME_BROWSER_UI_VIEWS_TRANSLATE_TRANSLATE_ICON_VIEW_H_
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment