Commit 0b8c9d7f 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=sky@chromium.org

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

Cr-Commit-Position: refs/heads/master@{#301511}
parent 8cd06158
......@@ -59,10 +59,10 @@ class AshEventGeneratorDelegate
: public aura::test::EventGeneratorDelegateAura {
public:
AshEventGeneratorDelegate() {}
virtual ~AshEventGeneratorDelegate() {}
~AshEventGeneratorDelegate() override {}
// aura::test::EventGeneratorDelegateAura overrides:
virtual aura::WindowTreeHost* GetHostAt(
aura::WindowTreeHost* GetHostAt(
const gfx::Point& point_in_screen) const override {
gfx::Screen* screen = Shell::GetScreen();
gfx::Display display = screen->GetDisplayNearestPoint(point_in_screen);
......@@ -70,7 +70,7 @@ class AshEventGeneratorDelegate
GetRootWindowForDisplayId(display.id())->GetHost();
}
virtual aura::client::ScreenPositionClient* GetScreenPositionClient(
aura::client::ScreenPositionClient* GetScreenPositionClient(
const aura::Window* window) const override {
return aura::client::GetScreenPositionClient(window->GetRootWindow());
}
......
......@@ -50,11 +50,11 @@ class TestMetroViewerProcessHost;
class AshTestBase : public testing::Test {
public:
AshTestBase();
virtual ~AshTestBase();
~AshTestBase() override;
// testing::Test:
virtual void SetUp() override;
virtual void TearDown() override;
void SetUp() override;
void TearDown() override;
// Update the display configuration as given in |display_specs|.
// See ash::test::DisplayManagerTestApi::UpdateDisplay for more details.
......@@ -151,7 +151,7 @@ class NoSessionAshTestBase : public AshTestBase {
NoSessionAshTestBase() {
set_start_session(false);
}
virtual ~NoSessionAshTestBase() {}
~NoSessionAshTestBase() override {}
private:
DISALLOW_COPY_AND_ASSIGN(NoSessionAshTestBase);
......
......@@ -17,15 +17,15 @@
class AshTestHelperTest : public testing::Test {
public:
AshTestHelperTest() {}
virtual ~AshTestHelperTest() {}
~AshTestHelperTest() override {}
virtual void SetUp() override {
void SetUp() override {
testing::Test::SetUp();
ash_test_helper_.reset(new ash::test::AshTestHelper(&message_loop_));
ash_test_helper_->SetUp(true);
}
virtual void TearDown() override {
void TearDown() override {
ash_test_helper_->TearDown();
testing::Test::TearDown();
}
......
......@@ -16,13 +16,13 @@ namespace test {
class AshTestViewsDelegate : public views::TestViewsDelegate {
public:
AshTestViewsDelegate();
virtual ~AshTestViewsDelegate();
~AshTestViewsDelegate() override;
// Overriden from TestViewsDelegate.
virtual content::WebContents* CreateWebContents(
content::WebContents* CreateWebContents(
content::BrowserContext* browser_context,
content::SiteInstance* site_instance) override;
virtual void OnBeforeWidgetInit(
void OnBeforeWidgetInit(
views::Widget::InitParams* params,
views::internal::NativeWidgetDelegate* delegate) override;
......
......@@ -58,18 +58,18 @@ void CreateChildModalParent(gfx::NativeView context) {
class ChildModalWindow : public views::WidgetDelegateView {
public:
ChildModalWindow();
virtual ~ChildModalWindow();
~ChildModalWindow() override;
private:
// Overridden from View:
virtual void OnPaint(gfx::Canvas* canvas) override;
virtual gfx::Size GetPreferredSize() const override;
void OnPaint(gfx::Canvas* canvas) override;
gfx::Size GetPreferredSize() const override;
// Overridden from WidgetDelegate:
virtual View* GetContentsView() override;
virtual base::string16 GetWindowTitle() const override;
virtual bool CanResize() const override;
virtual ui::ModalType GetModalType() const override;
View* GetContentsView() override;
base::string16 GetWindowTitle() const override;
bool CanResize() const override;
ui::ModalType GetModalType() const override;
DISALLOW_COPY_AND_ASSIGN(ChildModalWindow);
};
......
......@@ -27,7 +27,7 @@ class ChildModalParent : public views::WidgetDelegateView,
public views::WidgetObserver {
public:
ChildModalParent(gfx::NativeView context);
virtual ~ChildModalParent();
~ChildModalParent() override;
void ShowChild();
gfx::NativeWindow GetModalParent() const;
......@@ -37,22 +37,21 @@ class ChildModalParent : public views::WidgetDelegateView,
views::Widget* CreateChild();
// Overridden from views::WidgetDelegate:
virtual View* GetContentsView() override;
virtual base::string16 GetWindowTitle() const override;
virtual bool CanResize() const override;
virtual void DeleteDelegate() override;
View* GetContentsView() override;
base::string16 GetWindowTitle() const override;
bool CanResize() const override;
void DeleteDelegate() override;
// Overridden from views::View:
virtual void Layout() override;
virtual void ViewHierarchyChanged(
void Layout() override;
void ViewHierarchyChanged(
const ViewHierarchyChangedDetails& details) override;
// Overridden from ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) override;
void ButtonPressed(views::Button* sender, const ui::Event& event) override;
// Overridden from WidgetObserver:
virtual void OnWidgetDestroying(views::Widget* widget) override;
void OnWidgetDestroying(views::Widget* widget) override;
// The button to toggle showing and hiding the child window. The child window
// does not block input to this button.
......
......@@ -19,12 +19,11 @@ namespace {
class TestAPIAnimationObserver : public views::BoundsAnimatorObserver {
public:
TestAPIAnimationObserver() {}
virtual ~TestAPIAnimationObserver() {}
~TestAPIAnimationObserver() override {}
// views::BoundsAnimatorObserver overrides:
virtual void OnBoundsAnimatorProgressed(
views::BoundsAnimator* animator) override {}
virtual void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override {
void OnBoundsAnimatorProgressed(views::BoundsAnimator* animator) override {}
void OnBoundsAnimatorDone(views::BoundsAnimator* animator) override {
base::MessageLoop::current()->Quit();
}
......
......@@ -40,12 +40,12 @@ class TestActivationDelegate : public aura::client::ActivationDelegate,
}
// Overridden from aura::client::ActivationDelegate:
virtual bool ShouldActivate() const override;
bool ShouldActivate() const override;
private:
// Overridden from aura::client::ActivationChangeObserver:
virtual void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) override;
void OnWindowActivated(aura::Window* gained_active,
aura::Window* lost_active) override;
aura::Window* window_;
bool window_was_active_;
......
......@@ -15,14 +15,14 @@ namespace test {
class TestLockStateControllerDelegate : public LockStateControllerDelegate {
public:
TestLockStateControllerDelegate();
virtual ~TestLockStateControllerDelegate();
~TestLockStateControllerDelegate() override;
int num_lock_requests() const { return num_lock_requests_; }
int num_shutdown_requests() const { return num_shutdown_requests_; }
// LockStateControllerDelegate implementation.
virtual void RequestLockScreen() override;
virtual void RequestShutdown() override;
void RequestLockScreen() override;
void RequestShutdown() override;
private:
int num_lock_requests_;
......
......@@ -19,9 +19,9 @@ class TestOverlayDelegate : public OverlayEventFilter::Delegate {
private:
// Overridden from OverlayEventFilter::Delegate:
virtual void Cancel() override;
virtual bool IsCancelingKeyEvent(ui::KeyEvent* event) override;
virtual aura::Window* GetWindow() override;
void Cancel() override;
bool IsCancelingKeyEvent(ui::KeyEvent* event) override;
aura::Window* GetWindow() override;
int cancel_count_;
......
......@@ -16,13 +16,13 @@ namespace test {
class TestScreenshotDelegate : public ScreenshotDelegate {
public:
TestScreenshotDelegate();
virtual ~TestScreenshotDelegate();
~TestScreenshotDelegate() override;
// Overridden from ScreenshotDelegate:
virtual void HandleTakeScreenshotForAllRootWindows() override;
virtual void HandleTakePartialScreenshot(
aura::Window* window, const gfx::Rect& rect) override;
virtual bool CanTakeScreenshot() override;
void HandleTakeScreenshotForAllRootWindows() override;
void HandleTakePartialScreenshot(aura::Window* window,
const gfx::Rect& rect) override;
bool CanTakeScreenshot() override;
int handle_take_screenshot_count() const {
return handle_take_screenshot_count_;
......
......@@ -41,7 +41,7 @@ class TestSessionStateAnimator::AnimationSequence
animator_(animator) {
}
virtual ~AnimationSequence() {}
~AnimationSequence() override {}
virtual void SequenceAttached() {
++sequence_count_;
......@@ -61,9 +61,9 @@ class TestSessionStateAnimator::AnimationSequence
}
// ash::SessionStateAnimator::AnimationSequence:
virtual void StartAnimation(int container_mask,
AnimationType type,
AnimationSpeed speed) override {
void StartAnimation(int container_mask,
AnimationType type,
AnimationSpeed speed) override {
animator_->StartAnimationInSequence(container_mask, type, speed, this);
}
......
......@@ -25,7 +25,7 @@ namespace test {
class TestSessionStateAnimator : public SessionStateAnimator {
public:
TestSessionStateAnimator();
virtual ~TestSessionStateAnimator();
~TestSessionStateAnimator() override;
int last_animation_epoch() {
return last_animation_epoch_;
......@@ -64,19 +64,17 @@ class TestSessionStateAnimator : public SessionStateAnimator {
size_t GetAnimationCount() const;
// ash::SessionStateAnimator:
virtual void StartAnimation(int container_mask,
AnimationType type,
AnimationSpeed speed) override;
virtual void StartAnimationWithCallback(
int container_mask,
AnimationType type,
AnimationSpeed speed,
base::Closure callback) override;
virtual AnimationSequence* BeginAnimationSequence(
base::Closure callback) override;
virtual bool IsBackgroundHidden() const override;
virtual void ShowBackground() override;
virtual void HideBackground() override;
void StartAnimation(int container_mask,
AnimationType type,
AnimationSpeed speed) override;
void StartAnimationWithCallback(int container_mask,
AnimationType type,
AnimationSpeed speed,
base::Closure callback) override;
AnimationSequence* BeginAnimationSequence(base::Closure callback) override;
bool IsBackgroundHidden() const override;
void ShowBackground() override;
void HideBackground() override;
private:
class AnimationSequence;
......
......@@ -32,29 +32,27 @@ std::string GetUserIDFromEmail(const std::string& email) {
class MockUserInfo : public user_manager::UserInfo {
public:
explicit MockUserInfo(const std::string& id) : email_(id) {}
virtual ~MockUserInfo() {}
~MockUserInfo() override {}
void SetUserImage(const gfx::ImageSkia& user_image) {
user_image_ = user_image;
}
virtual base::string16 GetDisplayName() const override {
base::string16 GetDisplayName() const override {
return base::UTF8ToUTF16("Über tray Über tray Über tray Über tray");
}
virtual base::string16 GetGivenName() const override {
base::string16 GetGivenName() const override {
return base::UTF8ToUTF16("Über Über Über Über");
}
virtual std::string GetEmail() const override { return email_; }
std::string GetEmail() const override { return email_; }
virtual std::string GetUserID() const override {
std::string GetUserID() const override {
return GetUserIDFromEmail(GetEmail());
}
virtual const gfx::ImageSkia& GetImage() const override {
return user_image_;
}
const gfx::ImageSkia& GetImage() const override { return user_image_; }
// A test user image.
gfx::ImageSkia user_image_;
......
......@@ -20,39 +20,37 @@ class MockUserInfo;
class TestSessionStateDelegate : public SessionStateDelegate {
public:
TestSessionStateDelegate();
virtual ~TestSessionStateDelegate();
~TestSessionStateDelegate() override;
void set_logged_in_users(int users) { logged_in_users_ = users; }
void AddUser(const std::string user_id);
const user_manager::UserInfo* GetActiveUserInfo() const;
// SessionStateDelegate:
virtual content::BrowserContext* GetBrowserContextByIndex(
content::BrowserContext* GetBrowserContextByIndex(
MultiProfileIndex index) override;
virtual content::BrowserContext* GetBrowserContextForWindow(
content::BrowserContext* GetBrowserContextForWindow(
aura::Window* window) override;
virtual int GetMaximumNumberOfLoggedInUsers() const override;
virtual int NumberOfLoggedInUsers() const override;
virtual bool IsActiveUserSessionStarted() const override;
virtual bool CanLockScreen() const override;
virtual bool IsScreenLocked() const override;
virtual bool ShouldLockScreenBeforeSuspending() const override;
virtual void LockScreen() override;
virtual void UnlockScreen() override;
virtual bool IsUserSessionBlocked() const override;
virtual SessionState GetSessionState() const override;
virtual const user_manager::UserInfo* GetUserInfo(
int GetMaximumNumberOfLoggedInUsers() const override;
int NumberOfLoggedInUsers() const override;
bool IsActiveUserSessionStarted() const override;
bool CanLockScreen() const override;
bool IsScreenLocked() const override;
bool ShouldLockScreenBeforeSuspending() const override;
void LockScreen() override;
void UnlockScreen() override;
bool IsUserSessionBlocked() const override;
SessionState GetSessionState() const override;
const user_manager::UserInfo* GetUserInfo(
ash::MultiProfileIndex index) const override;
virtual const user_manager::UserInfo* GetUserInfo(
const user_manager::UserInfo* GetUserInfo(
content::BrowserContext* context) const override;
virtual bool ShouldShowAvatar(aura::Window* window) const override;
virtual void SwitchActiveUser(const std::string& user_id) override;
virtual void CycleActiveUser(CycleUser cycle_user) override;
virtual bool IsMultiProfileAllowedByPrimaryUserPolicy() const override;
virtual void AddSessionStateObserver(
ash::SessionStateObserver* observer) override;
virtual void RemoveSessionStateObserver(
ash::SessionStateObserver* observer) override;
bool ShouldShowAvatar(aura::Window* window) const override;
void SwitchActiveUser(const std::string& user_id) override;
void CycleActiveUser(CycleUser cycle_user) override;
bool IsMultiProfileAllowedByPrimaryUserPolicy() const override;
void AddSessionStateObserver(ash::SessionStateObserver* observer) override;
void RemoveSessionStateObserver(ash::SessionStateObserver* observer) override;
// TODO(oshima): Use state machine instead of using boolean variables.
......
......@@ -23,7 +23,7 @@ namespace test {
class TestShelfDelegate : public ShelfDelegate, public aura::WindowObserver {
public:
explicit TestShelfDelegate(ShelfModel* model);
virtual ~TestShelfDelegate();
~TestShelfDelegate() override;
void AddShelfItem(aura::Window* window);
void AddShelfItem(aura::Window* window, ShelfItemStatus status);
......@@ -32,19 +32,18 @@ class TestShelfDelegate : public ShelfDelegate, public aura::WindowObserver {
static TestShelfDelegate* instance() { return instance_; }
// WindowObserver implementation
virtual void OnWindowDestroying(aura::Window* window) override;
virtual void OnWindowHierarchyChanging(
const HierarchyChangeParams& params) override;
void OnWindowDestroying(aura::Window* window) override;
void OnWindowHierarchyChanging(const HierarchyChangeParams& params) override;
// ShelfDelegate implementation.
virtual void OnShelfCreated(Shelf* shelf) override;
virtual void OnShelfDestroyed(Shelf* shelf) override;
virtual ShelfID GetShelfIDForAppID(const std::string& app_id) override;
virtual const std::string& GetAppIDForShelfID(ShelfID id) override;
virtual void PinAppWithID(const std::string& app_id) override;
virtual bool CanPin() const override;
virtual bool IsAppPinned(const std::string& app_id) override;
virtual void UnpinAppWithID(const std::string& app_id) override;
void OnShelfCreated(Shelf* shelf) override;
void OnShelfDestroyed(Shelf* shelf) override;
ShelfID GetShelfIDForAppID(const std::string& app_id) override;
const std::string& GetAppIDForShelfID(ShelfID id) override;
void PinAppWithID(const std::string& app_id) override;
bool CanPin() const override;
bool IsAppPinned(const std::string& app_id) override;
void UnpinAppWithID(const std::string& app_id) override;
private:
static TestShelfDelegate* instance_;
......
......@@ -20,16 +20,16 @@ namespace test {
class TestShelfItemDelegate : public ShelfItemDelegate {
public:
explicit TestShelfItemDelegate(aura::Window* window);
virtual ~TestShelfItemDelegate();
~TestShelfItemDelegate() override;
// ShelfItemDelegate:
virtual bool ItemSelected(const ui::Event& event) override;
virtual base::string16 GetTitle() override;
virtual ui::MenuModel* CreateContextMenu(aura::Window* root_window) override;
virtual ShelfMenuModel* CreateApplicationMenu(int event_flags) override;
virtual bool IsDraggable() override;
virtual bool ShouldShowTooltip() override;
virtual void Close() override;
bool ItemSelected(const ui::Event& event) override;
base::string16 GetTitle() override;
ui::MenuModel* CreateContextMenu(aura::Window* root_window) override;
ShelfMenuModel* CreateApplicationMenu(int event_flags) override;
bool IsDraggable() override;
bool ShouldShowTooltip() override;
void Close() override;
private:
aura::Window* window_;
......
......@@ -38,18 +38,18 @@ namespace {
class NewWindowDelegateImpl : public NewWindowDelegate {
public:
NewWindowDelegateImpl() {}
virtual ~NewWindowDelegateImpl() {}
~NewWindowDelegateImpl() override {}
private:
// NewWindowDelegate:
virtual void NewTab() override {}
virtual void NewWindow(bool incognito) override {}
virtual void OpenFileManager() override {}
virtual void OpenCrosh() override {}
virtual void RestoreTab() override {}
virtual void ShowKeyboardOverlay() override {}
virtual void ShowTaskManager() override {}
virtual void OpenFeedbackPage() override {}
void NewTab() override {}
void NewWindow(bool incognito) override {}
void OpenFileManager() override {}
void OpenCrosh() override {}
void RestoreTab() override {}
void ShowKeyboardOverlay() override {}
void ShowTaskManager() override {}
void OpenFeedbackPage() override {}
DISALLOW_COPY_AND_ASSIGN(NewWindowDelegateImpl);
};
......@@ -57,16 +57,16 @@ class NewWindowDelegateImpl : public NewWindowDelegate {
class MediaDelegateImpl : public MediaDelegate {
public:
MediaDelegateImpl() : state_(MEDIA_CAPTURE_NONE) {}
virtual ~MediaDelegateImpl() {}
~MediaDelegateImpl() override {}
void set_media_capture_state(MediaCaptureState state) { state_ = state; }
private:
// MediaDelegate:
virtual void HandleMediaNextTrack() override {}
virtual void HandleMediaPlayPause() override {}
virtual void HandleMediaPrevTrack() override {}
virtual MediaCaptureState GetMediaCaptureState(
void HandleMediaNextTrack() override {}
void HandleMediaPlayPause() override {}
void HandleMediaPrevTrack() override {}
MediaCaptureState GetMediaCaptureState(
content::BrowserContext* context) override {
return state_;
}
......
......@@ -25,43 +25,41 @@ class TestSessionStateDelegate;
class TestShellDelegate : public ShellDelegate {
public:
TestShellDelegate();
virtual ~TestShellDelegate();
~TestShellDelegate() override;
void set_multi_profiles_enabled(bool multi_profiles_enabled) {
multi_profiles_enabled_ = multi_profiles_enabled;
}
// Overridden from ShellDelegate:
virtual bool IsFirstRunAfterBoot() const override;
virtual bool IsIncognitoAllowed() const override;
virtual bool IsMultiProfilesEnabled() const override;
virtual bool IsRunningInForcedAppMode() const override;
virtual bool IsMultiAccountEnabled() const override;
virtual void PreInit() override;
virtual void PreShutdown() override;
virtual void Exit() override;
virtual keyboard::KeyboardControllerProxy*
CreateKeyboardControllerProxy() override;
virtual void VirtualKeyboardActivated(bool activated) override;
virtual void AddVirtualKeyboardStateObserver(
bool IsFirstRunAfterBoot() const override;
bool IsIncognitoAllowed() const override;
bool IsMultiProfilesEnabled() const override;
bool IsRunningInForcedAppMode() const override;
bool IsMultiAccountEnabled() const override;
void PreInit() override;
void PreShutdown() override;
void Exit() override;
keyboard::KeyboardControllerProxy* CreateKeyboardControllerProxy() override;
void VirtualKeyboardActivated(bool activated) override;
void AddVirtualKeyboardStateObserver(
VirtualKeyboardStateObserver* observer) override;
virtual void RemoveVirtualKeyboardStateObserver(
void RemoveVirtualKeyboardStateObserver(
VirtualKeyboardStateObserver* observer) override;
virtual content::BrowserContext* GetActiveBrowserContext() override;
virtual app_list::AppListViewDelegate* GetAppListViewDelegate() override;
virtual ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override;
virtual SystemTrayDelegate* CreateSystemTrayDelegate() override;
virtual UserWallpaperDelegate* CreateUserWallpaperDelegate() override;
virtual SessionStateDelegate* CreateSessionStateDelegate() override;
virtual AccessibilityDelegate* CreateAccessibilityDelegate() override;
virtual NewWindowDelegate* CreateNewWindowDelegate() override;
virtual MediaDelegate* CreateMediaDelegate() override;
virtual ui::MenuModel* CreateContextMenu(
aura::Window* root,
ash::ShelfItemDelegate* item_delegate,
ash::ShelfItem* item) override;
virtual GPUSupport* CreateGPUSupport() override;
virtual base::string16 GetProductName() const override;
content::BrowserContext* GetActiveBrowserContext() override;
app_list::AppListViewDelegate* GetAppListViewDelegate() override;
ShelfDelegate* CreateShelfDelegate(ShelfModel* model) override;
SystemTrayDelegate* CreateSystemTrayDelegate() override;
UserWallpaperDelegate* CreateUserWallpaperDelegate() override;
SessionStateDelegate* CreateSessionStateDelegate() override;
AccessibilityDelegate* CreateAccessibilityDelegate() override;
NewWindowDelegate* CreateNewWindowDelegate() override;
MediaDelegate* CreateMediaDelegate() override;
ui::MenuModel* CreateContextMenu(aura::Window* root,
ash::ShelfItemDelegate* item_delegate,
ash::ShelfItem* item) override;
GPUSupport* CreateGPUSupport() override;
base::string16 GetProductName() const override;
int num_exit_requests() const { return num_exit_requests_; }
......
......@@ -22,8 +22,8 @@ class AuraShellTestSuite : public base::TestSuite {
protected:
// base::TestSuite:
virtual void Initialize() override;
virtual void Shutdown() override;
void Initialize() override;
void Shutdown() override;
private:
#if defined(OS_WIN)
......
......@@ -15,14 +15,14 @@ namespace test {
class TestUserWallpaperDelegate : public DefaultUserWallpaperDelegate {
public:
TestUserWallpaperDelegate();
virtual ~TestUserWallpaperDelegate();
~TestUserWallpaperDelegate() override;
void set_custom_wallpaper(const gfx::ImageSkia& wallpaper) {
custom_wallpaper_ = wallpaper;
}
// DefaultUserWallpaperDelegate overrides:
virtual void UpdateWallpaper(bool clear_cache) override;
void UpdateWallpaper(bool clear_cache) override;
// Returns and clears |update_wallpaper_count_|.
int GetUpdateWallpaperCountAndReset();
......
......@@ -16,7 +16,7 @@ namespace ash {
class TestVolumeControlDelegate : public ash::VolumeControlDelegate {
public:
explicit TestVolumeControlDelegate(bool consume);
virtual ~TestVolumeControlDelegate();
~TestVolumeControlDelegate() override;
int handle_volume_mute_count() const {
return handle_volume_mute_count_;
......@@ -35,9 +35,9 @@ class TestVolumeControlDelegate : public ash::VolumeControlDelegate {
}
// ash::VolumeControlDelegate:
virtual bool HandleVolumeMute(const ui::Accelerator& accelerator) override;
virtual bool HandleVolumeDown(const ui::Accelerator& accelerator) override;
virtual bool HandleVolumeUp(const ui::Accelerator& accelerator) override;
bool HandleVolumeMute(const ui::Accelerator& accelerator) override;
bool HandleVolumeDown(const ui::Accelerator& accelerator) override;
bool HandleVolumeUp(const ui::Accelerator& accelerator) override;
private:
// Keeps track of the return value that should be used for the methods
......
......@@ -54,28 +54,26 @@ class UIControlsAsh : public UIControlsAura {
public:
UIControlsAsh() {
}
virtual ~UIControlsAsh() {
}
~UIControlsAsh() override {}
// UIControslAura overrides:
virtual bool SendKeyPress(gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command) override {
bool SendKeyPress(gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command) override {
return SendKeyPressNotifyWhenDone(
window, key, control, shift, alt, command, base::Closure());
}
virtual bool SendKeyPressNotifyWhenDone(
gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command,
const base::Closure& closure) override {
bool SendKeyPressNotifyWhenDone(gfx::NativeWindow window,
ui::KeyboardCode key,
bool control,
bool shift,
bool alt,
bool command,
const base::Closure& closure) override {
aura::Window* root =
window ? window->GetRootWindow() : ash::Shell::GetTargetRootWindow();
UIControlsAura* ui_controls = GetUIControlsForRootWindow(root);
......@@ -83,43 +81,43 @@ class UIControlsAsh : public UIControlsAura {
window, key, control, shift, alt, command, closure);
}
virtual bool SendMouseMove(long x, long y) override {
bool SendMouseMove(long x, long y) override {
gfx::Point p(x, y);
UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseMove(p.x(), p.y());
}
virtual bool SendMouseMoveNotifyWhenDone(
long x,
long y,
const base::Closure& closure) override {
bool SendMouseMoveNotifyWhenDone(long x,
long y,
const base::Closure& closure) override {
gfx::Point p(x, y);
UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls &&
ui_controls->SendMouseMoveNotifyWhenDone(p.x(), p.y(), closure);
}
virtual bool SendMouseEvents(MouseButton type, int state) override {
bool SendMouseEvents(MouseButton type, int state) override {
gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseEvents(type, state);
}
virtual bool SendMouseEventsNotifyWhenDone(
MouseButton type, int state, const base::Closure& closure) override {
bool SendMouseEventsNotifyWhenDone(MouseButton type,
int state,
const base::Closure& closure) override {
gfx::Point p(aura::Env::GetInstance()->last_mouse_location());
UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseEventsNotifyWhenDone(
type, state, closure);
}
virtual bool SendMouseClick(MouseButton type) override {
bool SendMouseClick(MouseButton type) override {
gfx::Point p(ash::Shell::GetScreen()->GetCursorScreenPoint());
UIControlsAura* ui_controls = GetUIControlsAt(p);
return ui_controls && ui_controls->SendMouseClick(type);
}
virtual void RunClosureAfterAllPendingUIEvents(
void RunClosureAfterAllPendingUIEvents(
const base::Closure& closure) override {
UIControlsAura* ui_controls = GetUIControlsForRootWindow(
ash::Shell::GetTargetRootWindow());
......
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