Commit 02542c99 authored by dcheng's avatar dcheng Committed by Commit bot

Standardize usage of virtual/override/final specifiers.

The Google C++ style guide states:

  Explicitly annotate overrides of virtual functions or virtual
  destructors with an override or (less frequently) final specifier.
  Older (pre-C++11) code will use the virtual keyword as an inferior
  alternative annotation. For clarity, use exactly one of override,
  final, or virtual when declaring an override.

To better conform to these guidelines, the following constructs have
been rewritten:

- if a base class has a virtual destructor, then:
    virtual ~Foo();                   ->  ~Foo() override;
- virtual void Foo() override;        ->  void Foo() override;
- virtual void Foo() override final;  ->  void Foo() final;

This patch was automatically generated. The clang plugin can generate
fixit hints, which are suggested edits when it is 100% sure it knows how
to fix a problem. The hints from the clang plugin were applied to the
source tree using the tool in https://codereview.chromium.org/598073004.

BUG=417463
R=pkasting@chromium.org

Review URL: https://codereview.chromium.org/680053003

Cr-Commit-Position: refs/heads/master@{#301466}
parent e6e890a7
......@@ -25,14 +25,13 @@ class BackButton : public ToolbarButton {
// Takes ownership of the |model|, which can be null if no menu
// is to be shown.
BackButton(views::ButtonListener* listener, ui::MenuModel* model);
virtual ~BackButton();
~BackButton() override;
void SetLeadingMargin(int margin);
protected:
virtual gfx::Rect GetThemePaintRect() const override;
virtual scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const
override;
gfx::Rect GetThemePaintRect() const override;
scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override;
private:
// Any leading margin to be applied. Used when the back button is in
......
......@@ -69,26 +69,25 @@ class BrowserActionView : public views::MenuButton,
BrowserActionView* view) = 0;
protected:
virtual ~Delegate() {}
~Delegate() override {}
};
BrowserActionView(scoped_ptr<ToolbarActionViewController> view_controller,
Browser* browser,
Delegate* delegate);
virtual ~BrowserActionView();
~BrowserActionView() override;
// Called to update the display to match the browser action's state.
void UpdateState();
// Overridden from views::View:
virtual void GetAccessibleState(ui::AXViewState* state) override;
void GetAccessibleState(ui::AXViewState* state) override;
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// Overridden from content::NotificationObserver:
virtual void Observe(int type,
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
......@@ -97,17 +96,16 @@ class BrowserActionView : public views::MenuButton,
// behavior. MenuButton has the notion of a child popup being shown where the
// button will stay in the pushed state until the "menu" (a popup in this
// case) is dismissed.
virtual bool Activate() override;
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
virtual void OnMouseExited(const ui::MouseEvent& event) override;
virtual bool OnKeyReleased(const ui::KeyEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const
override;
bool Activate() override;
bool OnMousePressed(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
void OnMouseExited(const ui::MouseEvent& event) override;
bool OnKeyReleased(const ui::KeyEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override;
// ToolbarActionViewDelegate: (public because called by others).
virtual content::WebContents* GetCurrentWebContents() const override;
content::WebContents* GetCurrentWebContents() const override;
ToolbarActionViewController* view_controller() {
return view_controller_.get();
......@@ -119,26 +117,25 @@ class BrowserActionView : public views::MenuButton,
private:
// Overridden from views::View:
virtual void ViewHierarchyChanged(
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
virtual void OnDragDone() override;
virtual gfx::Size GetPreferredSize() const override;
virtual void PaintChildren(gfx::Canvas* canvas,
void OnDragDone() override;
gfx::Size GetPreferredSize() const override;
void PaintChildren(gfx::Canvas* canvas,
const views::CullSet& cull_set) override;
// ToolbarActionViewDelegate:
virtual views::View* GetAsView() override;
virtual bool IsShownInMenu() override;
virtual views::FocusManager* GetFocusManagerForAccelerator() override;
virtual views::Widget* GetParentForContextMenu() override;
virtual ToolbarActionViewController* GetPreferredPopupViewController()
override;
virtual views::View* GetReferenceViewForPopup() override;
virtual views::MenuButton* GetContextMenuButton() override;
virtual void HideActivePopup() override;
virtual void OnIconUpdated() override;
virtual void OnPopupShown(bool grant_tab_permissions) override;
virtual void CleanupPopup() override;
views::View* GetAsView() override;
bool IsShownInMenu() override;
views::FocusManager* GetFocusManagerForAccelerator() override;
views::Widget* GetParentForContextMenu() override;
ToolbarActionViewController* GetPreferredPopupViewController() override;
views::View* GetReferenceViewForPopup() override;
views::MenuButton* GetContextMenuButton() override;
void HideActivePopup() override;
void OnIconUpdated() override;
void OnPopupShown(bool grant_tab_permissions) override;
void CleanupPopup() override;
// A lock to keep the MenuButton pressed when a menu or popup is visible.
// This needs to be destroyed after |view_controller_|, because
......
......@@ -137,7 +137,7 @@ class BrowserActionsContainer
// documentation of |main_container|, see class comments.
BrowserActionsContainer(Browser* browser,
BrowserActionsContainer* main_container);
virtual ~BrowserActionsContainer();
~BrowserActionsContainer() override;
void Init();
......@@ -204,49 +204,48 @@ class BrowserActionsContainer
void RemoveObserver(BrowserActionsContainerObserver* observer);
// Overridden from views::View:
virtual gfx::Size GetPreferredSize() const override;
virtual int GetHeightForWidth(int width) const override;
virtual gfx::Size GetMinimumSize() const override;
virtual void Layout() override;
virtual bool GetDropFormats(int* formats,
gfx::Size GetPreferredSize() const override;
int GetHeightForWidth(int width) const override;
gfx::Size GetMinimumSize() const override;
void Layout() override;
bool GetDropFormats(
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool AreDropTypesRequired() override;
virtual bool CanDrop(const ui::OSExchangeData& data) override;
virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
virtual void OnDragExited() override;
virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
bool AreDropTypesRequired() override;
bool CanDrop(const ui::OSExchangeData& data) override;
int OnDragUpdated(const ui::DropTargetEvent& event) override;
void OnDragExited() override;
int OnPerformDrop(const ui::DropTargetEvent& event) override;
void GetAccessibleState(ui::AXViewState* state) override;
// Overridden from views::DragController:
virtual void WriteDragDataForView(View* sender,
void WriteDragDataForView(View* sender,
const gfx::Point& press_pt,
ui::OSExchangeData* data) override;
virtual int GetDragOperationsForView(View* sender,
const gfx::Point& p) override;
virtual bool CanStartDragForView(View* sender,
int GetDragOperationsForView(View* sender, const gfx::Point& p) override;
bool CanStartDragForView(View* sender,
const gfx::Point& press_pt,
const gfx::Point& p) override;
// Overridden from views::ResizeAreaDelegate:
virtual void OnResize(int resize_amount, bool done_resizing) override;
void OnResize(int resize_amount, bool done_resizing) override;
// Overridden from gfx::AnimationDelegate:
virtual void AnimationProgressed(const gfx::Animation* animation) override;
virtual void AnimationEnded(const gfx::Animation* animation) override;
void AnimationProgressed(const gfx::Animation* animation) override;
void AnimationEnded(const gfx::Animation* animation) override;
// Overridden from BrowserActionView::Delegate:
virtual content::WebContents* GetCurrentWebContents() override;
virtual bool ShownInsideMenu() const override;
virtual void OnBrowserActionViewDragDone() override;
virtual views::MenuButton* GetOverflowReferenceView() override;
virtual void SetPopupOwner(BrowserActionView* popup_owner) override;
virtual void HideActivePopup() override;
virtual BrowserActionView* GetMainViewForAction(
BrowserActionView* view) override;
content::WebContents* GetCurrentWebContents() override;
bool ShownInsideMenu() const override;
void OnBrowserActionViewDragDone() override;
views::MenuButton* GetOverflowReferenceView() override;
void SetPopupOwner(BrowserActionView* popup_owner) override;
void HideActivePopup() override;
BrowserActionView* GetMainViewForAction(BrowserActionView* view) override;
// Overridden from extension::ExtensionKeybindingRegistry::Delegate:
virtual extensions::ActiveTabPermissionGranter*
GetActiveTabPermissionGranter() override;
extensions::ActiveTabPermissionGranter* GetActiveTabPermissionGranter()
override;
// Retrieve the current popup. This should only be used by unit tests.
gfx::NativeView TestGetPopup();
......@@ -264,10 +263,10 @@ class BrowserActionsContainer
protected:
// Overridden from views::View:
virtual void ViewHierarchyChanged(
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual void OnThemeChanged() override;
void OnPaint(gfx::Canvas* canvas) override;
void OnThemeChanged() override;
private:
// A struct representing the position at which an action will be dropped.
......@@ -276,20 +275,17 @@ class BrowserActionsContainer
typedef std::vector<BrowserActionView*> BrowserActionViews;
// extensions::ExtensionToolbarModel::Observer implementation.
virtual void ToolbarExtensionAdded(const extensions::Extension* extension,
void ToolbarExtensionAdded(const extensions::Extension* extension,
int index) override;
virtual void ToolbarExtensionRemoved(
const extensions::Extension* extension) override;
virtual void ToolbarExtensionMoved(const extensions::Extension* extension,
void ToolbarExtensionRemoved(const extensions::Extension* extension) override;
void ToolbarExtensionMoved(const extensions::Extension* extension,
int index) override;
virtual void ToolbarExtensionUpdated(
const extensions::Extension* extension) override;
virtual bool ShowExtensionActionPopup(
const extensions::Extension* extension,
void ToolbarExtensionUpdated(const extensions::Extension* extension) override;
bool ShowExtensionActionPopup(const extensions::Extension* extension,
bool grant_active_tab) override;
virtual void ToolbarVisibleCountChanged() override;
virtual void ToolbarHighlightModeChanged(bool is_highlighting) override;
virtual Browser* GetBrowser() override;
void ToolbarVisibleCountChanged() override;
void ToolbarHighlightModeChanged(bool is_highlighting) override;
Browser* GetBrowser() override;
void LoadImages();
......
......@@ -331,8 +331,7 @@ class BrowserActionsContainerOverflowTest
public:
BrowserActionsContainerOverflowTest() : main_bar_(NULL), model_(NULL) {
}
virtual ~BrowserActionsContainerOverflowTest() {
}
~BrowserActionsContainerOverflowTest() override {}
protected:
// Returns true if the order of the BrowserActionViews in |main_bar_|
......@@ -351,9 +350,9 @@ class BrowserActionsContainerOverflowTest
extensions::ExtensionToolbarModel* model() { return model_; }
private:
virtual void SetUpCommandLine(base::CommandLine* command_line) override;
virtual void SetUpOnMainThread() override;
virtual void TearDownOnMainThread() override;
void SetUpCommandLine(base::CommandLine* command_line) override;
void SetUpOnMainThread() override;
void TearDownOnMainThread() override;
// The main BrowserActionsContainer (owned by the browser view).
BrowserActionsContainer* main_bar_;
......
......@@ -43,12 +43,10 @@ class IconUpdater : public ExtensionActionIconFactory::Observer {
DCHECK(view_controller);
view_controller->set_icon_observer(this);
}
virtual ~IconUpdater() {
view_controller_->set_icon_observer(NULL);
}
~IconUpdater() override { view_controller_->set_icon_observer(NULL); }
// BrowserActionView::IconObserver:
virtual void OnIconUpdated() override {
void OnIconUpdated() override {
menu_item_view_->SetIcon(view_controller_->GetIconWithBadge());
}
......@@ -71,7 +69,7 @@ class ChevronMenuButton::MenuController : public views::MenuDelegate {
MenuController(ChevronMenuButton* owner,
BrowserActionsContainer* browser_actions_container,
bool for_drop);
virtual ~MenuController();
~MenuController() override;
// Shows the overflow menu.
void RunMenu(views::Widget* widget);
......@@ -81,34 +79,34 @@ class ChevronMenuButton::MenuController : public views::MenuDelegate {
private:
// views::MenuDelegate:
virtual bool IsCommandEnabled(int id) const override;
virtual void ExecuteCommand(int id) override;
virtual bool ShowContextMenu(views::MenuItemView* source,
bool IsCommandEnabled(int id) const override;
void ExecuteCommand(int id) override;
bool ShowContextMenu(views::MenuItemView* source,
int id,
const gfx::Point& p,
ui::MenuSourceType source_type) override;
virtual void DropMenuClosed(views::MenuItemView* menu) override;
void DropMenuClosed(views::MenuItemView* menu) override;
// These drag functions offer support for dragging icons into the overflow
// menu.
virtual bool GetDropFormats(
bool GetDropFormats(
views::MenuItemView* menu,
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool AreDropTypesRequired(views::MenuItemView* menu) override;
virtual bool CanDrop(views::MenuItemView* menu,
bool AreDropTypesRequired(views::MenuItemView* menu) override;
bool CanDrop(views::MenuItemView* menu,
const ui::OSExchangeData& data) override;
virtual int GetDropOperation(views::MenuItemView* item,
int GetDropOperation(views::MenuItemView* item,
const ui::DropTargetEvent& event,
DropPosition* position) override;
virtual int OnPerformDrop(views::MenuItemView* menu,
int OnPerformDrop(views::MenuItemView* menu,
DropPosition position,
const ui::DropTargetEvent& event) override;
// These three drag functions offer support for dragging icons out of the
// overflow menu.
virtual bool CanDrag(views::MenuItemView* menu) override;
virtual void WriteDragData(views::MenuItemView* sender,
bool CanDrag(views::MenuItemView* menu) override;
void WriteDragData(views::MenuItemView* sender,
ui::OSExchangeData* data) override;
virtual int GetDragOperations(views::MenuItemView* sender) override;
int GetDragOperations(views::MenuItemView* sender) override;
// Returns the offset into |views_| for the given |id|.
size_t IndexForId(int id) const;
......
......@@ -20,7 +20,7 @@ class ChevronMenuButton : public views::MenuButton,
public:
explicit ChevronMenuButton(
BrowserActionsContainer* browser_actions_container);
virtual ~ChevronMenuButton();
~ChevronMenuButton() override;
// Closes the overflow menu (and any context menu), if it is open.
void CloseMenu();
......@@ -29,20 +29,19 @@ class ChevronMenuButton : public views::MenuButton,
class MenuController;
// views::MenuButton:
virtual scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const
override;
virtual bool GetDropFormats(int* formats,
scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override;
bool GetDropFormats(
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool AreDropTypesRequired() override;
virtual bool CanDrop(const ui::OSExchangeData& data) override;
virtual void OnDragEntered(const ui::DropTargetEvent& event) override;
virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
virtual void OnDragExited() override;
virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
bool AreDropTypesRequired() override;
bool CanDrop(const ui::OSExchangeData& data) override;
void OnDragEntered(const ui::DropTargetEvent& event) override;
int OnDragUpdated(const ui::DropTargetEvent& event) override;
void OnDragExited() override;
int OnPerformDrop(const ui::DropTargetEvent& event) override;
// views::MenuButtonListener:
virtual void OnMenuButtonClicked(View* source, const gfx::Point& point)
override;
void OnMenuButtonClicked(View* source, const gfx::Point& point) override;
// Shows the overflow menu.
void ShowOverflowMenu(bool for_drop);
......
......@@ -24,37 +24,36 @@ const char kMockId[] = "mock_action";
class MockComponentAction : public ToolbarActionViewController {
public:
MockComponentAction() : click_count_(0u), id_(kMockId) {}
virtual ~MockComponentAction() {}
~MockComponentAction() override {}
// ToolbarActionButtonController:
virtual const std::string& GetId() const override { return id_; }
virtual void SetDelegate(ToolbarActionViewDelegate* delegate) override {}
virtual gfx::Image GetIcon(content::WebContents* web_contents) override {
const std::string& GetId() const override { return id_; }
void SetDelegate(ToolbarActionViewDelegate* delegate) override {}
gfx::Image GetIcon(content::WebContents* web_contents) override {
return ui::ResourceBundle::GetSharedInstance().GetImageNamed(
IDR_BROWSER_ACTION);
}
virtual gfx::ImageSkia GetIconWithBadge() override {
gfx::ImageSkia GetIconWithBadge() override {
return *GetIcon(nullptr).ToImageSkia();
}
virtual base::string16 GetAccessibleName(content::WebContents* web_contents)
const override {
base::string16 GetAccessibleName(
content::WebContents* web_contents) const override {
return base::ASCIIToUTF16("Component Action");
}
virtual base::string16 GetTooltip(content::WebContents* web_contents)
const override {
base::string16 GetTooltip(content::WebContents* web_contents) const override {
return GetAccessibleName(web_contents);
}
virtual bool IsEnabled(content::WebContents* web_contents) const override {
bool IsEnabled(content::WebContents* web_contents) const override {
return true;
}
virtual bool HasPopup(content::WebContents* web_contents) const override {
bool HasPopup(content::WebContents* web_contents) const override {
return true;
}
virtual void HidePopup() override {}
virtual gfx::NativeView GetPopupNativeView() override { return nullptr; }
virtual bool CanDrag() const override { return false; }
virtual bool IsMenuRunning() const override { return false; }
virtual bool ExecuteAction(bool by_user) override {
void HidePopup() override {}
gfx::NativeView GetPopupNativeView() override { return nullptr; }
bool CanDrag() const override { return false; }
bool IsMenuRunning() const override { return false; }
bool ExecuteAction(bool by_user) override {
++click_count_;
return false;
}
......@@ -75,8 +74,8 @@ class MockComponentToolbarActionsFactory
virtual ~MockComponentToolbarActionsFactory();
// ComponentToolbarActionsFactory:
virtual ScopedVector<ToolbarActionViewController>
GetComponentToolbarActions() override;
ScopedVector<ToolbarActionViewController> GetComponentToolbarActions()
override;
private:
DISALLOW_COPY_AND_ASSIGN(MockComponentToolbarActionsFactory);
......@@ -102,9 +101,9 @@ MockComponentToolbarActionsFactory::GetComponentToolbarActions() {
class ComponentToolbarActionsBrowserTest : public InProcessBrowserTest {
protected:
ComponentToolbarActionsBrowserTest() {}
virtual ~ComponentToolbarActionsBrowserTest() {}
~ComponentToolbarActionsBrowserTest() override {}
virtual void SetUpCommandLine(base::CommandLine* command_line) override {
void SetUpCommandLine(base::CommandLine* command_line) override {
InProcessBrowserTest::SetUpCommandLine(command_line);
enable_redesign_.reset(new extensions::FeatureSwitch::ScopedOverride(
extensions::FeatureSwitch::extension_action_redesign(), true));
......
......@@ -23,7 +23,7 @@ class ExtensionToolbarMenuView : public views::View,
public BrowserActionsContainerObserver {
public:
ExtensionToolbarMenuView(Browser* browser, WrenchMenu* wrench_menu);
virtual ~ExtensionToolbarMenuView();
~ExtensionToolbarMenuView() override;
// Returns whether the wrench menu should show this view. This is true when
// either |container_| has icons to display or the menu was opened for a drag-
......@@ -31,13 +31,13 @@ class ExtensionToolbarMenuView : public views::View,
bool ShouldShow();
// views::View:
virtual gfx::Size GetPreferredSize() const override;
virtual int GetHeightForWidth(int width) const override;
virtual void Layout() override;
gfx::Size GetPreferredSize() const override;
int GetHeightForWidth(int width) const override;
void Layout() override;
private:
// BrowserActionsContainerObserver:
virtual void OnBrowserActionDragDone() override;
void OnBrowserActionDragDone() override;
// Closes the |wrench_menu_|.
void CloseWrenchMenu();
......
......@@ -36,14 +36,14 @@ class HomePageUndoBubble : public views::BubbleDelegateView,
private:
HomePageUndoBubble(Browser* browser, bool undo_value_is_ntp,
const GURL& undo_url, views::View* anchor_view);
virtual ~HomePageUndoBubble();
~HomePageUndoBubble() override;
// views::BubbleDelegateView:
virtual void Init() override;
virtual void WindowClosing() override;
void Init() override;
void WindowClosing() override;
// views::LinkListener:
virtual void LinkClicked(views::Link* source, int event_flags) override;
void LinkClicked(views::Link* source, int event_flags) override;
static HomePageUndoBubble* home_page_undo_bubble_;
......
......@@ -14,19 +14,19 @@ class Browser;
class HomeButton : public ToolbarButton {
public:
HomeButton(views::ButtonListener* listener, Browser* browser);
virtual ~HomeButton();
~HomeButton() override;
// ToolbarButton:
virtual bool GetDropFormats(
bool GetDropFormats(
int* formats,
std::set<OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool CanDrop(const OSExchangeData& data) override;
virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
bool CanDrop(const OSExchangeData& data) override;
int OnDragUpdated(const ui::DropTargetEvent& event) override;
int OnPerformDrop(const ui::DropTargetEvent& event) override;
private:
// ToolbarButton:
virtual void NotifyClick(const ui::Event& event) override;
void NotifyClick(const ui::Event& event) override;
Browser* browser_;
......
......@@ -35,7 +35,7 @@ class ReloadButton : public ToolbarButton,
static const char kViewClassName[];
explicit ReloadButton(CommandUpdater* command_updater);
virtual ~ReloadButton();
~ReloadButton() override;
// Ask for a specified button state. If |force| is true this will be applied
// immediately.
......@@ -47,26 +47,25 @@ class ReloadButton : public ToolbarButton,
void LoadImages();
// ToolbarButton:
virtual void OnMouseExited(const ui::MouseEvent& event) override;
virtual bool GetTooltipText(const gfx::Point& p,
void OnMouseExited(const ui::MouseEvent& event) override;
bool GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const override;
virtual const char* GetClassName() const override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual bool ShouldShowMenu() override;
virtual void ShowDropDownMenu(ui::MenuSourceType source_type) override;
const char* GetClassName() const override;
void GetAccessibleState(ui::AXViewState* state) override;
bool ShouldShowMenu() override;
void ShowDropDownMenu(ui::MenuSourceType source_type) override;
// views::ButtonListener:
virtual void ButtonPressed(views::Button* /* button */,
void ButtonPressed(views::Button* /* button */,
const ui::Event& event) override;
// ui::SimpleMenuModel::Delegate:
virtual bool IsCommandIdChecked(int command_id) const override;
virtual bool IsCommandIdEnabled(int command_id) const override;
virtual bool IsCommandIdVisible(int command_id) const override;
virtual bool GetAcceleratorForCommandId(
int command_id,
bool IsCommandIdChecked(int command_id) const override;
bool IsCommandIdEnabled(int command_id) const override;
bool IsCommandIdVisible(int command_id) const override;
bool GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) override;
virtual void ExecuteCommand(int command_id, int event_flags) override;
void ExecuteCommand(int command_id, int event_flags) override;
private:
friend class ReloadButtonTest;
......
......@@ -25,7 +25,7 @@ class ToolbarButton : public views::LabelButton,
// Takes ownership of the |model|, which can be null if no menu
// is to be shown.
ToolbarButton(views::ButtonListener* listener, ui::MenuModel* model);
virtual ~ToolbarButton();
~ToolbarButton() override;
// Set up basic mouseover border behavior.
// Should be called before first paint.
......@@ -36,20 +36,19 @@ class ToolbarButton : public views::LabelButton,
bool IsMenuShowing() const;
// views::LabelButton:
virtual gfx::Size GetPreferredSize() const override;
virtual bool OnMousePressed(const ui::MouseEvent& event) override;
virtual bool OnMouseDragged(const ui::MouseEvent& event) override;
virtual void OnMouseReleased(const ui::MouseEvent& event) override;
gfx::Size GetPreferredSize() const override;
bool OnMousePressed(const ui::MouseEvent& event) override;
bool OnMouseDragged(const ui::MouseEvent& event) override;
void OnMouseReleased(const ui::MouseEvent& event) override;
// Showing the drop down results in a MouseCaptureLost, we need to ignore it.
virtual void OnMouseCaptureLost() override;
virtual void OnMouseExited(const ui::MouseEvent& event) override;
virtual void OnGestureEvent(ui::GestureEvent* event) override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
virtual scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const
override;
void OnMouseCaptureLost() override;
void OnMouseExited(const ui::MouseEvent& event) override;
void OnGestureEvent(ui::GestureEvent* event) override;
void GetAccessibleState(ui::AXViewState* state) override;
scoped_ptr<views::LabelButtonBorder> CreateDefaultBorder() const override;
// views::ContextMenuController:
virtual void ShowContextMenuForView(View* source,
void ShowContextMenuForView(View* source,
const gfx::Point& point,
ui::MenuSourceType source_type) override;
......@@ -58,7 +57,7 @@ class ToolbarButton : public views::LabelButton,
// pressed when a user holds the mouse down over the button. For this
// implementation, both left and right mouse buttons can trigger a change
// to the PUSHED state.
virtual bool ShouldEnterPushedState(const ui::Event& event) override;
bool ShouldEnterPushedState(const ui::Event& event) override;
// Returns if menu should be shown. Override this to change default behavior.
virtual bool ShouldShowMenu();
......
......@@ -57,7 +57,7 @@ class ToolbarView : public views::AccessiblePaneView,
static const char kViewClassName[];
explicit ToolbarView(Browser* browser);
virtual ~ToolbarView();
~ToolbarView() override;
// Create the contents of the Browser Toolbar.
void Init();
......@@ -107,58 +107,56 @@ class ToolbarView : public views::AccessiblePaneView,
HomeButton* home_button() const { return home_; }
// AccessiblePaneView:
virtual bool SetPaneFocus(View* initial_focus) override;
virtual void GetAccessibleState(ui::AXViewState* state) override;
bool SetPaneFocus(View* initial_focus) override;
void GetAccessibleState(ui::AXViewState* state) override;
// views::MenuButtonListener:
virtual void OnMenuButtonClicked(views::View* source,
void OnMenuButtonClicked(views::View* source,
const gfx::Point& point) override;
// LocationBarView::Delegate:
virtual content::WebContents* GetWebContents() override;
virtual ToolbarModel* GetToolbarModel() override;
virtual const ToolbarModel* GetToolbarModel() const override;
virtual InstantController* GetInstant() override;
virtual views::Widget* CreateViewsBubble(
content::WebContents* GetWebContents() override;
ToolbarModel* GetToolbarModel() override;
const ToolbarModel* GetToolbarModel() const override;
InstantController* GetInstant() override;
views::Widget* CreateViewsBubble(
views::BubbleDelegateView* bubble_delegate) override;
virtual PageActionImageView* CreatePageActionImageView(
LocationBarView* owner, ExtensionAction* action) override;
virtual ContentSettingBubbleModelDelegate*
GetContentSettingBubbleModelDelegate() override;
virtual void ShowWebsiteSettings(content::WebContents* web_contents,
PageActionImageView* CreatePageActionImageView(
LocationBarView* owner,
ExtensionAction* action) override;
ContentSettingBubbleModelDelegate* GetContentSettingBubbleModelDelegate()
override;
void ShowWebsiteSettings(content::WebContents* web_contents,
const GURL& url,
const content::SSLStatus& ssl) override;
// CommandObserver:
virtual void EnabledStateChangedForCommand(int id, bool enabled) override;
void EnabledStateChangedForCommand(int id, bool enabled) override;
// views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// views::WidgetObserver:
virtual void OnWidgetVisibilityChanged(views::Widget* widget,
bool visible) override;
virtual void OnWidgetActivationChanged(views::Widget* widget,
bool active) override;
void OnWidgetVisibilityChanged(views::Widget* widget, bool visible) override;
void OnWidgetActivationChanged(views::Widget* widget, bool active) override;
// content::NotificationObserver:
virtual void Observe(int type,
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
// ui::AcceleratorProvider:
virtual bool GetAcceleratorForCommandId(
int command_id, ui::Accelerator* accelerator) override;
bool GetAcceleratorForCommandId(int command_id,
ui::Accelerator* accelerator) override;
// views::View:
virtual gfx::Size GetPreferredSize() const override;
virtual gfx::Size GetMinimumSize() const override;
virtual void Layout() override;
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual void OnThemeChanged() override;
virtual const char* GetClassName() const override;
virtual bool AcceleratorPressed(const ui::Accelerator& acc) override;
gfx::Size GetPreferredSize() const override;
gfx::Size GetMinimumSize() const override;
void Layout() override;
void OnPaint(gfx::Canvas* canvas) override;
void OnThemeChanged() override;
const char* GetClassName() const override;
bool AcceleratorPressed(const ui::Accelerator& acc) override;
// Whether the wrench/hotdogs menu is currently showing.
bool IsWrenchMenuShowing() const;
......@@ -179,8 +177,8 @@ class ToolbarView : public views::AccessiblePaneView,
protected:
// AccessiblePaneView:
virtual bool SetPaneFocusAndFocusDefault() override;
virtual void RemovePaneFocus() override;
bool SetPaneFocusAndFocusDefault() override;
void RemovePaneFocus() override;
private:
// Types of display mode this toolbar can have.
......@@ -191,11 +189,11 @@ class ToolbarView : public views::AccessiblePaneView,
};
// views::ViewTargeterDelegate:
virtual bool DoesIntersectRect(const views::View* target,
bool DoesIntersectRect(const views::View* target,
const gfx::Rect& rect) const override;
// WrenchMenuBadgeController::Delegate:
virtual void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type,
void UpdateBadgeSeverity(WrenchMenuBadgeController::BadgeType type,
WrenchIconPainter::Severity severity,
bool animate) override;
......
......@@ -25,7 +25,7 @@
class ToolbarViewInteractiveUITest : public ExtensionBrowserTest {
public:
ToolbarViewInteractiveUITest();
virtual ~ToolbarViewInteractiveUITest();
~ToolbarViewInteractiveUITest() override;
protected:
ToolbarView* toolbar_view() { return toolbar_view_; }
......@@ -46,9 +46,9 @@ class ToolbarViewInteractiveUITest : public ExtensionBrowserTest {
void FinishDragAndDrop(const base::Closure& quit_closure);
// InProcessBrowserTest:
virtual void SetUpCommandLine(base::CommandLine* command_line) override;
virtual void SetUpOnMainThread() override;
virtual void TearDownOnMainThread() override;
void SetUpCommandLine(base::CommandLine* command_line) override;
void SetUpOnMainThread() override;
void TearDownOnMainThread() override;
ToolbarView* toolbar_view_;
......
......@@ -106,7 +106,7 @@ class FullscreenButton : public ImageButton {
: ImageButton(listener) { }
// Overridden from ImageButton.
virtual gfx::Size GetPreferredSize() const override {
gfx::Size GetPreferredSize() const override {
gfx::Size pref = ImageButton::GetPreferredSize();
if (border()) {
gfx::Insets insets = border()->GetInsets();
......@@ -148,7 +148,7 @@ class InMenuButtonBackground : public views::Background {
}
// Overridden from views::Background.
virtual void Paint(gfx::Canvas* canvas, View* view) const override {
void Paint(gfx::Canvas* canvas, View* view) const override {
CustomButton* button = CustomButton::AsCustomButton(view);
views::Button::ButtonState state =
button ? button->state() : views::Button::STATE_NORMAL;
......@@ -258,7 +258,7 @@ class InMenuButton : public LabelButton {
public:
InMenuButton(views::ButtonListener* listener, const base::string16& text)
: LabelButton(listener, text), in_menu_background_(NULL) {}
virtual ~InMenuButton() {}
~InMenuButton() override {}
void Init(InMenuButtonBackground::ButtonType type) {
SetFocusable(true);
......@@ -276,7 +276,7 @@ class InMenuButton : public LabelButton {
}
// views::LabelButton
virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
const MenuConfig& menu_config = MenuConfig::instance(theme);
SetBorder(views::Border::CreateEmptyBorder(
0, kHorizontalPadding, 0, kHorizontalPadding));
......@@ -319,13 +319,13 @@ class WrenchMenuView : public views::View,
menu_->AddObserver(this);
}
virtual ~WrenchMenuView() {
~WrenchMenuView() override {
if (menu_)
menu_->RemoveObserver(this);
}
// Overridden from views::View.
virtual void SchedulePaintInRect(const gfx::Rect& r) override {
void SchedulePaintInRect(const gfx::Rect& r) override {
// Normally when the mouse enters/exits a button the buttons invokes
// SchedulePaint. As part of the button border (InMenuButtonBackground) is
// rendered by the button to the left/right of it SchedulePaint on the the
......@@ -364,7 +364,7 @@ class WrenchMenuView : public views::View,
}
// Overridden from WrenchMenuObserver:
virtual void WrenchMenuDestroyed() override {
void WrenchMenuDestroyed() override {
menu_->RemoveObserver(this);
menu_ = NULL;
menu_model_ = NULL;
......@@ -393,9 +393,9 @@ class HoveredImageSource : public gfx::ImageSkiaSource {
: image_(image),
color_(color) {
}
virtual ~HoveredImageSource() {}
~HoveredImageSource() override {}
virtual gfx::ImageSkiaRep GetImageForScale(float scale) override {
gfx::ImageSkiaRep GetImageForScale(float scale) override {
const gfx::ImageSkiaRep& rep = image_.GetRepresentation(scale);
SkBitmap bitmap = rep.sk_bitmap();
SkBitmap white;
......@@ -444,13 +444,13 @@ class WrenchMenu::CutCopyPasteView : public WrenchMenuView {
}
// Overridden from View.
virtual gfx::Size GetPreferredSize() const override {
gfx::Size GetPreferredSize() const override {
// Returned height doesn't matter as MenuItemView forces everything to the
// height of the menuitemview.
return gfx::Size(GetMaxChildViewPreferredWidth() * child_count(), 0);
}
virtual void Layout() override {
void Layout() override {
// All buttons are given the same width.
int width = GetMaxChildViewPreferredWidth();
for (int i = 0; i < child_count(); ++i)
......@@ -458,8 +458,7 @@ class WrenchMenu::CutCopyPasteView : public WrenchMenuView {
}
// Overridden from ButtonListener.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override {
void ButtonPressed(views::Button* sender, const ui::Event& event) override {
menu()->CancelAndEvaluate(menu_model(), sender->tag());
}
......@@ -553,10 +552,10 @@ class WrenchMenu::ZoomView : public WrenchMenuView {
UpdateZoomControls();
}
virtual ~ZoomView() {}
~ZoomView() override {}
// Overridden from View.
virtual gfx::Size GetPreferredSize() const override {
gfx::Size GetPreferredSize() const override {
// The increment/decrement button are forced to the same width.
int button_width = std::max(increment_button_->GetPreferredSize().width(),
decrement_button_->GetPreferredSize().width());
......@@ -569,7 +568,7 @@ class WrenchMenu::ZoomView : public WrenchMenuView {
fullscreen_width, 0);
}
virtual void Layout() override {
void Layout() override {
int x = 0;
int button_width = std::max(increment_button_->GetPreferredSize().width(),
decrement_button_->GetPreferredSize().width());
......@@ -594,7 +593,7 @@ class WrenchMenu::ZoomView : public WrenchMenuView {
fullscreen_button_->SetBoundsRect(bounds);
}
virtual void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
void OnNativeThemeChanged(const ui::NativeTheme* theme) override {
WrenchMenuView::OnNativeThemeChanged(theme);
const MenuConfig& menu_config = MenuConfig::instance(theme);
......@@ -622,8 +621,7 @@ class WrenchMenu::ZoomView : public WrenchMenuView {
}
// Overridden from ButtonListener.
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override {
void ButtonPressed(views::Button* sender, const ui::Event& event) override {
if (sender->tag() == fullscreen_index_) {
menu()->CancelAndEvaluate(menu_model(), sender->tag());
} else {
......@@ -633,9 +631,7 @@ class WrenchMenu::ZoomView : public WrenchMenuView {
}
// Overridden from WrenchMenuObserver.
virtual void WrenchMenuDestroyed() override {
WrenchMenuView::WrenchMenuDestroyed();
}
void WrenchMenuDestroyed() override { WrenchMenuView::WrenchMenuDestroyed(); }
private:
void OnZoomLevelChanged(const HostZoomMap::ZoomLevelChange& change) {
......@@ -723,7 +719,7 @@ class WrenchMenu::RecentTabsMenuModelDelegate : public ui::MenuModelDelegate {
model_->SetMenuModelDelegate(this);
}
virtual ~RecentTabsMenuModelDelegate() {
~RecentTabsMenuModelDelegate() override {
model_->SetMenuModelDelegate(NULL);
}
......@@ -739,7 +735,7 @@ class WrenchMenu::RecentTabsMenuModelDelegate : public ui::MenuModelDelegate {
// ui::MenuModelDelegate implementation:
virtual void OnIconChanged(int index) override {
void OnIconChanged(int index) override {
int command_id = model_->GetCommandIdAt(index);
views::MenuItemView* item = menu_item_->GetMenuItemByID(command_id);
DCHECK(item);
......@@ -748,7 +744,7 @@ class WrenchMenu::RecentTabsMenuModelDelegate : public ui::MenuModelDelegate {
item->SetIcon(*icon.ToImageSkia());
}
virtual void OnMenuStructureChanged() override {
void OnMenuStructureChanged() override {
if (menu_item_->HasSubmenu()) {
// Remove all menu items from submenu.
views::SubmenuView* submenu = menu_item_->GetSubmenu();
......
......@@ -43,7 +43,7 @@ class WrenchMenu : public views::MenuDelegate,
};
WrenchMenu(Browser* browser, int run_flags);
virtual ~WrenchMenu();
~WrenchMenu() override;
void Init(ui::MenuModel* model);
......@@ -62,49 +62,49 @@ class WrenchMenu : public views::MenuDelegate,
void RemoveObserver(WrenchMenuObserver* observer);
// MenuDelegate overrides:
virtual const gfx::FontList* GetLabelFontList(int command_id) const override;
virtual bool GetShouldUseDisabledEmphasizedForegroundColor(
const gfx::FontList* GetLabelFontList(int command_id) const override;
bool GetShouldUseDisabledEmphasizedForegroundColor(
int command_id) const override;
virtual base::string16 GetTooltipText(int command_id,
base::string16 GetTooltipText(int command_id,
const gfx::Point& p) const override;
virtual bool IsTriggerableEvent(views::MenuItemView* menu,
bool IsTriggerableEvent(views::MenuItemView* menu,
const ui::Event& e) override;
virtual bool GetDropFormats(
bool GetDropFormats(
views::MenuItemView* menu,
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool AreDropTypesRequired(views::MenuItemView* menu) override;
virtual bool CanDrop(views::MenuItemView* menu,
bool AreDropTypesRequired(views::MenuItemView* menu) override;
bool CanDrop(views::MenuItemView* menu,
const ui::OSExchangeData& data) override;
virtual int GetDropOperation(views::MenuItemView* item,
int GetDropOperation(views::MenuItemView* item,
const ui::DropTargetEvent& event,
DropPosition* position) override;
virtual int OnPerformDrop(views::MenuItemView* menu,
int OnPerformDrop(views::MenuItemView* menu,
DropPosition position,
const ui::DropTargetEvent& event) override;
virtual bool ShowContextMenu(views::MenuItemView* source,
bool ShowContextMenu(views::MenuItemView* source,
int command_id,
const gfx::Point& p,
ui::MenuSourceType source_type) override;
virtual bool CanDrag(views::MenuItemView* menu) override;
virtual void WriteDragData(views::MenuItemView* sender,
bool CanDrag(views::MenuItemView* menu) override;
void WriteDragData(views::MenuItemView* sender,
ui::OSExchangeData* data) override;
virtual int GetDragOperations(views::MenuItemView* sender) override;
virtual int GetMaxWidthForMenu(views::MenuItemView* menu) override;
virtual bool IsItemChecked(int command_id) const override;
virtual bool IsCommandEnabled(int command_id) const override;
virtual void ExecuteCommand(int command_id, int mouse_event_flags) override;
virtual bool GetAccelerator(int command_id,
int GetDragOperations(views::MenuItemView* sender) override;
int GetMaxWidthForMenu(views::MenuItemView* menu) override;
bool IsItemChecked(int command_id) const override;
bool IsCommandEnabled(int command_id) const override;
void ExecuteCommand(int command_id, int mouse_event_flags) override;
bool GetAccelerator(int command_id,
ui::Accelerator* accelerator) const override;
virtual void WillShowMenu(views::MenuItemView* menu) override;
virtual void WillHideMenu(views::MenuItemView* menu) override;
virtual bool ShouldCloseOnDragComplete() override;
void WillShowMenu(views::MenuItemView* menu) override;
void WillHideMenu(views::MenuItemView* menu) override;
bool ShouldCloseOnDragComplete() override;
// BaseBookmarkModelObserver overrides:
virtual void BookmarkModelChanged() override;
void BookmarkModelChanged() override;
// content::NotificationObserver overrides:
virtual void Observe(int type,
void Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) override;
......
......@@ -18,16 +18,16 @@ class WrenchToolbarButton : public views::MenuButton,
public WrenchIconPainter::Delegate {
public:
explicit WrenchToolbarButton(ToolbarView* toolbar_view);
virtual ~WrenchToolbarButton();
~WrenchToolbarButton() override;
void SetSeverity(WrenchIconPainter::Severity severity, bool animate);
// views::MenuButton:
virtual gfx::Size GetPreferredSize() const override;
virtual void OnPaint(gfx::Canvas* canvas) override;
gfx::Size GetPreferredSize() const override;
void OnPaint(gfx::Canvas* canvas) override;
// WrenchIconPainter::Delegate:
virtual void ScheduleWrenchIconPaint() override;
void ScheduleWrenchIconPaint() override;
// Opens the wrench menu immediately during a drag-and-drop operation.
// Used only in testing.
......@@ -35,14 +35,15 @@ class WrenchToolbarButton : public views::MenuButton,
private:
// views::View:
virtual bool GetDropFormats(int* formats,
bool GetDropFormats(
int* formats,
std::set<ui::OSExchangeData::CustomFormat>* custom_formats) override;
virtual bool AreDropTypesRequired() override;
virtual bool CanDrop(const ui::OSExchangeData& data) override;
virtual void OnDragEntered(const ui::DropTargetEvent& event) override;
virtual int OnDragUpdated(const ui::DropTargetEvent& event) override;
virtual void OnDragExited() override;
virtual int OnPerformDrop(const ui::DropTargetEvent& event) override;
bool AreDropTypesRequired() override;
bool CanDrop(const ui::OSExchangeData& data) override;
void OnDragEntered(const ui::DropTargetEvent& event) override;
int OnDragUpdated(const ui::DropTargetEvent& event) override;
void OnDragExited() override;
int OnPerformDrop(const ui::DropTargetEvent& event) override;
// Show the extension action overflow menu (which is in the app menu).
void ShowOverflowMenu();
......
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