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