summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordcheng <dcheng@chromium.org>2014-10-21 18:58:00 -0700
committerCommit bot <commit-bot@chromium.org>2014-10-22 04:03:45 +0000
commit45ccfbadf5bf0a02bfd402e24c24ac1f096f3a46 (patch)
treed7baedbf08bfe9b2c418b29e28898df7f1ae6551
parentb0eda3b45fb71dbb87a9f526b06c9b9b21879b16 (diff)
downloadchromium_src-45ccfbadf5bf0a02bfd402e24c24ac1f096f3a46.zip
chromium_src-45ccfbadf5bf0a02bfd402e24c24ac1f096f3a46.tar.gz
chromium_src-45ccfbadf5bf0a02bfd402e24c24ac1f096f3a46.tar.bz2
Standardize usage of virtual/override/final in chrome/browser/notifications
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=dewittj@chromium.org Review URL: https://codereview.chromium.org/667283002 Cr-Commit-Position: refs/heads/master@{#300617}
-rw-r--r--chrome/browser/notifications/desktop_notification_infobar_delegate.h6
-rw-r--r--chrome/browser/notifications/desktop_notification_service.h15
-rw-r--r--chrome/browser/notifications/desktop_notification_service_factory.h6
-rw-r--r--chrome/browser/notifications/extension_welcome_notification.cc23
-rw-r--r--chrome/browser/notifications/extension_welcome_notification.h4
-rw-r--r--chrome/browser/notifications/extension_welcome_notification_factory.h6
-rw-r--r--chrome/browser/notifications/extension_welcome_notification_unittest.cc32
-rw-r--r--chrome/browser/notifications/fullscreen_notification_blocker.h12
-rw-r--r--chrome/browser/notifications/google_now_notification_stats_collector.h6
-rw-r--r--chrome/browser/notifications/message_center_notification_manager.h33
-rw-r--r--chrome/browser/notifications/message_center_notifications_browsertest.cc20
-rw-r--r--chrome/browser/notifications/message_center_settings_controller.h39
-rw-r--r--chrome/browser/notifications/message_center_stats_collector.h24
-rw-r--r--chrome/browser/notifications/notification.h2
-rw-r--r--chrome/browser/notifications/notification_browsertest.cc14
-rw-r--r--chrome/browser/notifications/notification_delegate.h2
-rw-r--r--chrome/browser/notifications/notification_object_proxy.h12
-rw-r--r--chrome/browser/notifications/notification_system_observer.h8
-rw-r--r--chrome/browser/notifications/notification_test_util.h35
-rw-r--r--chrome/browser/notifications/screen_lock_notification_blocker.h6
-rw-r--r--chrome/browser/notifications/sync_notifier/chrome_notifier_service.h4
-rw-r--r--chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h4
22 files changed, 147 insertions, 166 deletions
diff --git a/chrome/browser/notifications/desktop_notification_infobar_delegate.h b/chrome/browser/notifications/desktop_notification_infobar_delegate.h
index 4f5b876..7d02942 100644
--- a/chrome/browser/notifications/desktop_notification_infobar_delegate.h
+++ b/chrome/browser/notifications/desktop_notification_infobar_delegate.h
@@ -25,11 +25,11 @@ class DesktopNotificationInfoBarDelegate : public PermissionInfobarDelegate {
const GURL& requesting_frame,
int contents_unique_id,
const std::string& display_languages);
- virtual ~DesktopNotificationInfoBarDelegate();
+ ~DesktopNotificationInfoBarDelegate() override;
// PermissionInfoBarDelegate:
- virtual base::string16 GetMessageText() const override;
- virtual int GetIconID() const override;
+ base::string16 GetMessageText() const override;
+ int GetIconID() const override;
GURL requesting_frame_;
std::string display_languages_;
diff --git a/chrome/browser/notifications/desktop_notification_service.h b/chrome/browser/notifications/desktop_notification_service.h
index f337c9f..e323d1a 100644
--- a/chrome/browser/notifications/desktop_notification_service.h
+++ b/chrome/browser/notifications/desktop_notification_service.h
@@ -80,7 +80,7 @@ class DesktopNotificationService : public PermissionContextBase
Profile* profile);
explicit DesktopNotificationService(Profile* profile);
- virtual ~DesktopNotificationService();
+ ~DesktopNotificationService() override;
// Requests Web Notification permission for |requesting_frame|. The |callback|
// will be invoked after the user has made a decision.
@@ -133,16 +133,15 @@ class DesktopNotificationService : public PermissionContextBase
#if defined(ENABLE_EXTENSIONS)
// extensions::ExtensionRegistryObserver:
- virtual void OnExtensionUninstalled(
- content::BrowserContext* browser_context,
- const extensions::Extension* extension,
- extensions::UninstallReason reason) override;
+ void OnExtensionUninstalled(content::BrowserContext* browser_context,
+ const extensions::Extension* extension,
+ extensions::UninstallReason reason) override;
#endif
// PermissionContextBase:
- virtual void UpdateContentSetting(const GURL& requesting_origin,
- const GURL& embedder_origin,
- bool allowed) override;
+ void UpdateContentSetting(const GURL& requesting_origin,
+ const GURL& embedder_origin,
+ bool allowed) override;
// The profile which owns this object.
Profile* profile_;
diff --git a/chrome/browser/notifications/desktop_notification_service_factory.h b/chrome/browser/notifications/desktop_notification_service_factory.h
index 63bcc1c..8f06900 100644
--- a/chrome/browser/notifications/desktop_notification_service_factory.h
+++ b/chrome/browser/notifications/desktop_notification_service_factory.h
@@ -28,12 +28,12 @@ class DesktopNotificationServiceFactory
friend struct DefaultSingletonTraits<DesktopNotificationServiceFactory>;
DesktopNotificationServiceFactory();
- virtual ~DesktopNotificationServiceFactory();
+ ~DesktopNotificationServiceFactory() override;
// BrowserContextKeyedServiceFactory:
- virtual KeyedService* BuildServiceInstanceFor(
+ KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
- virtual content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
};
diff --git a/chrome/browser/notifications/extension_welcome_notification.cc b/chrome/browser/notifications/extension_welcome_notification.cc
index 1963c3b..c061dd8 100644
--- a/chrome/browser/notifications/extension_welcome_notification.cc
+++ b/chrome/browser/notifications/extension_welcome_notification.cc
@@ -47,10 +47,10 @@ class NotificationCallbacks
}
// Overridden from NotificationDelegate:
- virtual void Display() override {}
- virtual void Error() override {}
+ void Display() override {}
+ void Error() override {}
- virtual void Close(bool by_user) override {
+ void Close(bool by_user) override {
if (by_user) {
// Setting the preference here may cause the notification erasing
// to reenter. Posting a task avoids this issue.
@@ -60,8 +60,8 @@ class NotificationCallbacks
}
}
- virtual void Click() override {}
- virtual void ButtonClick(int index) override {
+ void Click() override {}
+ void ButtonClick(int index) override {
if (index == 0) {
OpenNotificationLearnMoreTab();
} else if (index == 1) {
@@ -98,7 +98,7 @@ class NotificationCallbacks
notifier, false);
}
- virtual ~NotificationCallbacks() {}
+ ~NotificationCallbacks() override {}
Profile* const profile_;
@@ -116,17 +116,14 @@ class DefaultDelegate : public ExtensionWelcomeNotification::Delegate {
public:
DefaultDelegate() {}
- virtual message_center::MessageCenter* GetMessageCenter() override {
+ message_center::MessageCenter* GetMessageCenter() override {
return g_browser_process->message_center();
}
- virtual base::Time GetCurrentTime() override {
- return base::Time::Now();
- }
+ base::Time GetCurrentTime() override { return base::Time::Now(); }
- virtual void PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) override {
+ void PostTask(const tracked_objects::Location& from_here,
+ const base::Closure& task) override {
base::MessageLoop::current()->PostTask(from_here, task);
}
diff --git a/chrome/browser/notifications/extension_welcome_notification.h b/chrome/browser/notifications/extension_welcome_notification.h
index fd26c07..8a46fb9 100644
--- a/chrome/browser/notifications/extension_welcome_notification.h
+++ b/chrome/browser/notifications/extension_welcome_notification.h
@@ -64,7 +64,7 @@ class ExtensionWelcomeNotification : public KeyedService,
// The extension Id associated with the Google Now extension.
static const char kChromeNowExtensionID[];
- virtual ~ExtensionWelcomeNotification();
+ ~ExtensionWelcomeNotification() override;
// To workaround the lack of delegating constructors prior to C++11, we use
// static Create methods.
@@ -76,7 +76,7 @@ class ExtensionWelcomeNotification : public KeyedService,
Delegate* const delegate);
// PrefServiceSyncableObserver
- virtual void OnIsSyncingChanged() override;
+ void OnIsSyncingChanged() override;
// Adds in the welcome notification if required for components built
// into Chrome that show notifications like Chrome Now.
diff --git a/chrome/browser/notifications/extension_welcome_notification_factory.h b/chrome/browser/notifications/extension_welcome_notification_factory.h
index 194e8dc..e51a9ac 100644
--- a/chrome/browser/notifications/extension_welcome_notification_factory.h
+++ b/chrome/browser/notifications/extension_welcome_notification_factory.h
@@ -25,12 +25,12 @@ class ExtensionWelcomeNotificationFactory
friend struct DefaultSingletonTraits<ExtensionWelcomeNotificationFactory>;
ExtensionWelcomeNotificationFactory();
- virtual ~ExtensionWelcomeNotificationFactory();
+ ~ExtensionWelcomeNotificationFactory() override;
// BrowserContextKeyedServiceFactory:
- virtual KeyedService* BuildServiceInstanceFor(
+ KeyedService* BuildServiceInstanceFor(
content::BrowserContext* context) const override;
- virtual content::BrowserContext* GetBrowserContextToUse(
+ content::BrowserContext* GetBrowserContextToUse(
content::BrowserContext* context) const override;
};
diff --git a/chrome/browser/notifications/extension_welcome_notification_unittest.cc b/chrome/browser/notifications/extension_welcome_notification_unittest.cc
index 4e6917b..2c4544d 100644
--- a/chrome/browser/notifications/extension_welcome_notification_unittest.cc
+++ b/chrome/browser/notifications/extension_welcome_notification_unittest.cc
@@ -38,14 +38,14 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
}
// message_center::FakeMessageCenter Overrides
- virtual message_center::Notification* FindVisibleNotificationById(
+ message_center::Notification* FindVisibleNotificationById(
const std::string& id) override {
if (last_notification.get() && last_notification->id() == id)
return last_notification.get();
return NULL;
}
- virtual void AddNotification(
+ void AddNotification(
scoped_ptr<message_center::Notification> notification) override {
EXPECT_FALSE(last_notification.get());
last_notification.swap(notification);
@@ -54,8 +54,7 @@ class MockMessageCenter : public message_center::FakeMessageCenter {
notifications_with_shown_as_popup_++;
}
- virtual void RemoveNotification(const std::string& id,
- bool by_user) override {
+ void RemoveNotification(const std::string& id, bool by_user) override {
EXPECT_TRUE(last_notification.get());
last_notification.reset();
remove_notification_calls_++;
@@ -85,17 +84,14 @@ public:
}
// ExtensionWelcomeNotification::Delegate
- virtual message_center::MessageCenter* GetMessageCenter() override {
+ message_center::MessageCenter* GetMessageCenter() override {
return message_center_.get();
}
- virtual base::Time GetCurrentTime() override {
- return start_time_ + elapsed_time_;
- }
+ base::Time GetCurrentTime() override { return start_time_ + elapsed_time_; }
- virtual void PostTask(
- const tracked_objects::Location& from_here,
- const base::Closure& task) override {
+ void PostTask(const tracked_objects::Location& from_here,
+ const base::Closure& task) override {
EXPECT_TRUE(pending_task_.is_null());
pending_task_ = task;
}
@@ -209,16 +205,16 @@ class ExtensionWelcomeNotificationTest : public testing::Test {
explicit TestNotificationDelegate(const std::string& id) : id_(id) {}
// Overridden from NotificationDelegate:
- virtual void Display() override {}
- virtual void Error() override {}
- virtual void Close(bool by_user) override {}
- virtual void Click() override {}
- virtual void ButtonClick(int index) override {}
+ void Display() override {}
+ void Error() override {}
+ void Close(bool by_user) override {}
+ void Click() override {}
+ void ButtonClick(int index) override {}
- virtual std::string id() const override { return id_; }
+ std::string id() const override { return id_; }
private:
- virtual ~TestNotificationDelegate() {}
+ ~TestNotificationDelegate() override {}
const std::string id_;
diff --git a/chrome/browser/notifications/fullscreen_notification_blocker.h b/chrome/browser/notifications/fullscreen_notification_blocker.h
index de51ec0..439e766 100644
--- a/chrome/browser/notifications/fullscreen_notification_blocker.h
+++ b/chrome/browser/notifications/fullscreen_notification_blocker.h
@@ -17,20 +17,20 @@ class FullscreenNotificationBlocker
public:
explicit FullscreenNotificationBlocker(
message_center::MessageCenter* message_center);
- virtual ~FullscreenNotificationBlocker();
+ ~FullscreenNotificationBlocker() override;
bool is_fullscreen_mode() const { return is_fullscreen_mode_; }
// message_center::NotificationBlocker overrides:
- virtual void CheckState() override;
- virtual bool ShouldShowNotificationAsPopup(
+ void CheckState() override;
+ bool ShouldShowNotificationAsPopup(
const message_center::NotifierId& notifier_id) const override;
private:
// content::NotificationObserver override.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
bool is_fullscreen_mode_;
diff --git a/chrome/browser/notifications/google_now_notification_stats_collector.h b/chrome/browser/notifications/google_now_notification_stats_collector.h
index 3ead046..9ce460b 100644
--- a/chrome/browser/notifications/google_now_notification_stats_collector.h
+++ b/chrome/browser/notifications/google_now_notification_stats_collector.h
@@ -18,14 +18,14 @@ class GoogleNowNotificationStatsCollector
public:
explicit GoogleNowNotificationStatsCollector(
message_center::MessageCenter* message_center);
- virtual ~GoogleNowNotificationStatsCollector();
+ ~GoogleNowNotificationStatsCollector() override;
private:
// MessageCenterObserver
- virtual void OnNotificationDisplayed(
+ void OnNotificationDisplayed(
const std::string& notification_id,
const message_center::DisplaySource source) override;
- virtual void OnCenterVisibilityChanged(
+ void OnCenterVisibilityChanged(
message_center::Visibility visibility) override;
// Counts the number of Google Now Notifications in the message center.
diff --git a/chrome/browser/notifications/message_center_notification_manager.h b/chrome/browser/notifications/message_center_notification_manager.h
index e3c5929..443c89b 100644
--- a/chrome/browser/notifications/message_center_notification_manager.h
+++ b/chrome/browser/notifications/message_center_notification_manager.h
@@ -45,33 +45,30 @@ class MessageCenterNotificationManager
message_center::MessageCenter* message_center,
PrefService* local_state,
scoped_ptr<message_center::NotifierSettingsProvider> settings_provider);
- virtual ~MessageCenterNotificationManager();
+ ~MessageCenterNotificationManager() override;
// Registers preferences.
static void RegisterPrefs(PrefRegistrySimple* registry);
// NotificationUIManager
- virtual void Add(const Notification& notification,
- Profile* profile) override;
- virtual bool Update(const Notification& notification,
- Profile* profile) override;
- virtual const Notification* FindById(const std::string& delegate_id,
- ProfileID profile_id) const override;
- virtual bool CancelById(const std::string& delegate_id,
- ProfileID profile_id) override;
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
+ void Add(const Notification& notification, Profile* profile) override;
+ bool Update(const Notification& notification, Profile* profile) override;
+ const Notification* FindById(const std::string& delegate_id,
+ ProfileID profile_id) const override;
+ bool CancelById(const std::string& delegate_id,
+ ProfileID profile_id) override;
+ std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
Profile* profile,
const GURL& source) override;
- virtual bool CancelAllBySourceOrigin(const GURL& source_origin) override;
- virtual bool CancelAllByProfile(ProfileID profile_id) override;
- virtual void CancelAll() override;
+ bool CancelAllBySourceOrigin(const GURL& source_origin) override;
+ bool CancelAllByProfile(ProfileID profile_id) override;
+ void CancelAll() override;
// MessageCenterObserver
- virtual void OnNotificationRemoved(const std::string& notification_id,
- bool by_user) override;
- virtual void OnCenterVisibilityChanged(message_center::Visibility) override;
- virtual void OnNotificationUpdated(const std::string& notification_id)
- override;
+ void OnNotificationRemoved(const std::string& notification_id,
+ bool by_user) override;
+ void OnCenterVisibilityChanged(message_center::Visibility) override;
+ void OnNotificationUpdated(const std::string& notification_id) override;
void EnsureMessageCenterClosed();
diff --git a/chrome/browser/notifications/message_center_notifications_browsertest.cc b/chrome/browser/notifications/message_center_notifications_browsertest.cc
index 87c00c4..e11f906 100644
--- a/chrome/browser/notifications/message_center_notifications_browsertest.cc
+++ b/chrome/browser/notifications/message_center_notifications_browsertest.cc
@@ -29,16 +29,16 @@ class TestAddObserver : public message_center::MessageCenterObserver {
message_center_->AddObserver(this);
}
- virtual ~TestAddObserver() { message_center_->RemoveObserver(this); }
+ ~TestAddObserver() override { message_center_->RemoveObserver(this); }
- virtual void OnNotificationAdded(const std::string& id) override {
+ void OnNotificationAdded(const std::string& id) override {
std::string log = logs_[id];
if (log != "")
log += "_";
logs_[id] = log + "add-" + id;
}
- virtual void OnNotificationUpdated(const std::string& id) override {
+ void OnNotificationUpdated(const std::string& id) override {
std::string log = logs_[id];
if (log != "")
log += "_";
@@ -72,23 +72,23 @@ class MessageCenterNotificationsTest : public InProcessBrowserTest {
public:
explicit TestDelegate(const std::string& id) : id_(id) {}
- virtual void Display() override { log_ += "Display_"; }
- virtual void Error() override { log_ += "Error_"; }
- virtual void Close(bool by_user) override {
+ void Display() override { log_ += "Display_"; }
+ void Error() override { log_ += "Error_"; }
+ void Close(bool by_user) override {
log_ += "Close_";
log_ += ( by_user ? "by_user_" : "programmatically_");
}
- virtual void Click() override { log_ += "Click_"; }
- virtual void ButtonClick(int button_index) override {
+ void Click() override { log_ += "Click_"; }
+ void ButtonClick(int button_index) override {
log_ += "ButtonClick_";
log_ += base::IntToString(button_index) + "_";
}
- virtual std::string id() const override { return id_; }
+ std::string id() const override { return id_; }
const std::string& log() { return log_; }
private:
- virtual ~TestDelegate() {}
+ ~TestDelegate() override {}
std::string id_;
std::string log_;
diff --git a/chrome/browser/notifications/message_center_settings_controller.h b/chrome/browser/notifications/message_center_settings_controller.h
index 408db71..78346ae 100644
--- a/chrome/browser/notifications/message_center_settings_controller.h
+++ b/chrome/browser/notifications/message_center_settings_controller.h
@@ -53,28 +53,26 @@ class MessageCenterSettingsController
public:
explicit MessageCenterSettingsController(
ProfileInfoCache* profile_info_cache);
- virtual ~MessageCenterSettingsController();
+ ~MessageCenterSettingsController() override;
// Overridden from message_center::NotifierSettingsProvider.
- virtual void AddObserver(
+ void AddObserver(message_center::NotifierSettingsObserver* observer) override;
+ void RemoveObserver(
message_center::NotifierSettingsObserver* observer) override;
- virtual void RemoveObserver(
- message_center::NotifierSettingsObserver* observer) override;
- virtual size_t GetNotifierGroupCount() const override;
- virtual const message_center::NotifierGroup& GetNotifierGroupAt(
+ size_t GetNotifierGroupCount() const override;
+ const message_center::NotifierGroup& GetNotifierGroupAt(
size_t index) const override;
- virtual bool IsNotifierGroupActiveAt(size_t index) const override;
- virtual void SwitchToNotifierGroup(size_t index) override;
- virtual const message_center::NotifierGroup& GetActiveNotifierGroup() const
- override;
- virtual void GetNotifierList(
+ bool IsNotifierGroupActiveAt(size_t index) const override;
+ void SwitchToNotifierGroup(size_t index) override;
+ const message_center::NotifierGroup& GetActiveNotifierGroup() const override;
+ void GetNotifierList(
std::vector<message_center::Notifier*>* notifiers) override;
- virtual void SetNotifierEnabled(const message_center::Notifier& notifier,
- bool enabled) override;
- virtual void OnNotifierSettingsClosing() override;
- virtual bool NotifierHasAdvancedSettings(
+ void SetNotifierEnabled(const message_center::Notifier& notifier,
+ bool enabled) override;
+ void OnNotifierSettingsClosing() override;
+ bool NotifierHasAdvancedSettings(
const message_center::NotifierId& notifier_id) const override;
- virtual void OnNotifierAdvancedSettingsRequested(
+ void OnNotifierAdvancedSettingsRequested(
const message_center::NotifierId& notifier_id,
const std::string* notification_id) override;
@@ -85,14 +83,13 @@ class MessageCenterSettingsController
#endif
// Overridden from extensions::AppIconLoader::Delegate.
- virtual void SetAppImage(const std::string& id,
- const gfx::ImageSkia& image) override;
+ void SetAppImage(const std::string& id, const gfx::ImageSkia& image) override;
private:
// Overridden from content::NotificationObserver.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
void OnFaviconLoaded(const GURL& url,
const favicon_base::FaviconImageResult& favicon_result);
diff --git a/chrome/browser/notifications/message_center_stats_collector.h b/chrome/browser/notifications/message_center_stats_collector.h
index a64765e..f5808d0 100644
--- a/chrome/browser/notifications/message_center_stats_collector.h
+++ b/chrome/browser/notifications/message_center_stats_collector.h
@@ -39,7 +39,7 @@ class MessageCenterStatsCollector
explicit MessageCenterStatsCollector(
message_center::MessageCenter* message_center);
- virtual ~MessageCenterStatsCollector();
+ ~MessageCenterStatsCollector() override;
private:
// Represents the aggregate stats for each notification.
@@ -63,21 +63,19 @@ class MessageCenterStatsCollector
};
// MessageCenterObserver
- virtual void OnNotificationAdded(const std::string& notification_id) override;
- virtual void OnNotificationRemoved(const std::string& notification_id,
- bool by_user) override;
- virtual void OnNotificationUpdated(
- const std::string& notification_id) override;
- virtual void OnNotificationClicked(
- const std::string& notification_id) override;
- virtual void OnNotificationButtonClicked(const std::string& notification_id,
- int button_index) override;
- virtual void OnNotificationDisplayed(
+ void OnNotificationAdded(const std::string& notification_id) override;
+ void OnNotificationRemoved(const std::string& notification_id,
+ bool by_user) override;
+ void OnNotificationUpdated(const std::string& notification_id) override;
+ void OnNotificationClicked(const std::string& notification_id) override;
+ void OnNotificationButtonClicked(const std::string& notification_id,
+ int button_index) override;
+ void OnNotificationDisplayed(
const std::string& notification_id,
const message_center::DisplaySource source) override;
- virtual void OnCenterVisibilityChanged(
+ void OnCenterVisibilityChanged(
message_center::Visibility visibility) override;
- virtual void OnQuietModeChanged(bool in_quiet_mode) override;
+ void OnQuietModeChanged(bool in_quiet_mode) override;
// Weak, global.
message_center::MessageCenter* message_center_;
diff --git a/chrome/browser/notifications/notification.h b/chrome/browser/notifications/notification.h
index dbf3898..363ece7 100644
--- a/chrome/browser/notifications/notification.h
+++ b/chrome/browser/notifications/notification.h
@@ -48,7 +48,7 @@ class Notification : public message_center::Notification {
Notification(const std::string& id, const Notification& notification);
Notification(const Notification& notification);
- virtual ~Notification();
+ ~Notification() override;
Notification& operator=(const Notification& notification);
// The origin URL of the script which requested the notification.
diff --git a/chrome/browser/notifications/notification_browsertest.cc b/chrome/browser/notifications/notification_browsertest.cc
index fbbaeca..2b0545b 100644
--- a/chrome/browser/notifications/notification_browsertest.cc
+++ b/chrome/browser/notifications/notification_browsertest.cc
@@ -72,12 +72,12 @@ class MessageCenterChangeObserver
message_center::MessageCenter::Get()->AddObserver(this);
}
- virtual ~MessageCenterChangeObserver() {
+ ~MessageCenterChangeObserver() override {
message_center::MessageCenter::Get()->RemoveObserver(this);
}
// NotificationChangeObserver:
- virtual bool Wait() override {
+ bool Wait() override {
if (notification_received_)
return true;
@@ -87,18 +87,16 @@ class MessageCenterChangeObserver
}
// message_center::MessageCenterObserver:
- virtual void OnNotificationAdded(
- const std::string& notification_id) override {
+ void OnNotificationAdded(const std::string& notification_id) override {
OnMessageCenterChanged();
}
- virtual void OnNotificationRemoved(const std::string& notification_id,
- bool by_user) override {
+ void OnNotificationRemoved(const std::string& notification_id,
+ bool by_user) override {
OnMessageCenterChanged();
}
- virtual void OnNotificationUpdated(
- const std::string& notification_id) override {
+ void OnNotificationUpdated(const std::string& notification_id) override {
OnMessageCenterChanged();
}
diff --git a/chrome/browser/notifications/notification_delegate.h b/chrome/browser/notifications/notification_delegate.h
index afd3911..c478869 100644
--- a/chrome/browser/notifications/notification_delegate.h
+++ b/chrome/browser/notifications/notification_delegate.h
@@ -23,7 +23,7 @@ class NotificationDelegate : public message_center::NotificationDelegate {
virtual std::string id() const = 0;
protected:
- virtual ~NotificationDelegate() {}
+ ~NotificationDelegate() override {}
};
#endif // CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_DELEGATE_H_
diff --git a/chrome/browser/notifications/notification_object_proxy.h b/chrome/browser/notifications/notification_object_proxy.h
index 937c535..df82d54 100644
--- a/chrome/browser/notifications/notification_object_proxy.h
+++ b/chrome/browser/notifications/notification_object_proxy.h
@@ -28,16 +28,16 @@ class NotificationObjectProxy
scoped_ptr<content::DesktopNotificationDelegate> delegate);
// NotificationDelegate implementation.
- virtual void Display() override;
- virtual void Error() override;
- virtual void Close(bool by_user) override;
- virtual void Click() override;
- virtual std::string id() const override;
+ void Display() override;
+ void Error() override;
+ void Close(bool by_user) override;
+ void Click() override;
+ std::string id() const override;
protected:
friend class base::RefCountedThreadSafe<NotificationObjectProxy>;
- virtual ~NotificationObjectProxy();
+ ~NotificationObjectProxy() override;
private:
scoped_ptr<content::DesktopNotificationDelegate> delegate_;
diff --git a/chrome/browser/notifications/notification_system_observer.h b/chrome/browser/notifications/notification_system_observer.h
index 88ea169c..7b5fe88 100644
--- a/chrome/browser/notifications/notification_system_observer.h
+++ b/chrome/browser/notifications/notification_system_observer.h
@@ -15,13 +15,13 @@ class NotificationUIManager;
class NotificationSystemObserver : public content::NotificationObserver {
public:
explicit NotificationSystemObserver(NotificationUIManager* ui_manager);
- virtual ~NotificationSystemObserver();
+ ~NotificationSystemObserver() override;
protected:
// content::NotificationObserver override.
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
+ void Observe(int type,
+ const content::NotificationSource& source,
+ const content::NotificationDetails& details) override;
private:
// Registrar for the other kind of notifications (event signaling).
diff --git a/chrome/browser/notifications/notification_test_util.h b/chrome/browser/notifications/notification_test_util.h
index c01634a..eba7834 100644
--- a/chrome/browser/notifications/notification_test_util.h
+++ b/chrome/browser/notifications/notification_test_util.h
@@ -22,14 +22,14 @@ class MockNotificationDelegate : public NotificationDelegate {
explicit MockNotificationDelegate(const std::string& id);
// NotificationDelegate interface.
- virtual void Display() override {}
- virtual void Error() override {}
- virtual void Close(bool by_user) override {}
- virtual void Click() override {}
- virtual std::string id() const override;
+ void Display() override {}
+ void Error() override {}
+ void Close(bool by_user) override {}
+ void Click() override {}
+ std::string id() const override;
private:
- virtual ~MockNotificationDelegate();
+ ~MockNotificationDelegate() override;
std::string id_;
@@ -79,39 +79,38 @@ class LoggingNotificationDelegate : public NotificationDelegate {
class StubNotificationUIManager : public NotificationUIManager {
public:
explicit StubNotificationUIManager(const GURL& welcome_origin);
- virtual ~StubNotificationUIManager();
+ ~StubNotificationUIManager() override;
// Adds a notification to be displayed. Virtual for unit test override.
- virtual void Add(const Notification& notification, Profile* profile) override;
- virtual bool Update(const Notification& notification,
- Profile* profile) override;
+ void Add(const Notification& notification, Profile* profile) override;
+ bool Update(const Notification& notification, Profile* profile) override;
// Returns NULL if no notifications match the supplied ID, either currently
// displayed or in the queue.
- virtual const Notification* FindById(const std::string& delegate_id,
- ProfileID profile_id) const override;
+ const Notification* FindById(const std::string& delegate_id,
+ ProfileID profile_id) const override;
// Removes any notifications matching the supplied ID, either currently
// displayed or in the queue. Returns true if anything was removed.
- virtual bool CancelById(const std::string& delegate_id,
- ProfileID profile_id) override;
+ bool CancelById(const std::string& delegate_id,
+ ProfileID profile_id) override;
// Adds the delegate_id for each outstanding notification to the set
// |delegate_ids| (must not be NULL).
- virtual std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
+ std::set<std::string> GetAllIdsByProfileAndSourceOrigin(
Profile* profile,
const GURL& source) override;
// Removes notifications matching the |source_origin| (which could be an
// extension ID). Returns true if anything was removed.
- virtual bool CancelAllBySourceOrigin(const GURL& source_origin) override;
+ bool CancelAllBySourceOrigin(const GURL& source_origin) override;
// Removes notifications matching |profile|. Returns true if any were removed.
- virtual bool CancelAllByProfile(ProfileID profile_id) override;
+ bool CancelAllByProfile(ProfileID profile_id) override;
// Cancels all pending notifications and closes anything currently showing.
// Used when the app is terminating.
- virtual void CancelAll() override;
+ void CancelAll() override;
// Test hook to get the notification so we can check it
const Notification& notification() const { return notification_; }
diff --git a/chrome/browser/notifications/screen_lock_notification_blocker.h b/chrome/browser/notifications/screen_lock_notification_blocker.h
index 8c5c944..698ba28 100644
--- a/chrome/browser/notifications/screen_lock_notification_blocker.h
+++ b/chrome/browser/notifications/screen_lock_notification_blocker.h
@@ -16,13 +16,13 @@ class ScreenLockNotificationBlocker
public:
explicit ScreenLockNotificationBlocker(
message_center::MessageCenter* message_center);
- virtual ~ScreenLockNotificationBlocker();
+ ~ScreenLockNotificationBlocker() override;
bool is_locked() const { return is_locked_; }
// message_center::NotificationBlocker overrides:
- virtual void CheckState() override;
- virtual bool ShouldShowNotificationAsPopup(
+ void CheckState() override;
+ bool ShouldShowNotificationAsPopup(
const message_center::NotifierId& notifier_id) const override;
private:
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
index 824203a..0daf4c3 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service.h
@@ -24,10 +24,10 @@ namespace notifier {
class ChromeNotifierService : public KeyedService {
public:
explicit ChromeNotifierService(Profile* profile);
- virtual ~ChromeNotifierService();
+ ~ChromeNotifierService() override;
// KeyedService implementation.
- virtual void Shutdown() override;
+ void Shutdown() override;
// Returns the SyncableService for syncer::SYNCED_NOTIFICATIONS and
// syncer::SYNCED_NOTIFICATION_APP_INFO
diff --git a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h
index 2cbf326..66d36cf 100644
--- a/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h
+++ b/chrome/browser/notifications/sync_notifier/chrome_notifier_service_factory.h
@@ -34,10 +34,10 @@ class ChromeNotifierServiceFactory : public BrowserContextKeyedServiceFactory {
friend struct DefaultSingletonTraits<ChromeNotifierServiceFactory>;
ChromeNotifierServiceFactory();
- virtual ~ChromeNotifierServiceFactory();
+ ~ChromeNotifierServiceFactory() override;
// BrowserContextKeyedServiceFactory:
- virtual KeyedService* BuildServiceInstanceFor(
+ KeyedService* BuildServiceInstanceFor(
content::BrowserContext* profile) const override;
};