diff options
author | Viet-Trung Luu <viettrungluu@chromium.org> | 2014-10-21 11:57:19 -0700 |
---|---|---|
committer | Viet-Trung Luu <viettrungluu@chromium.org> | 2014-10-21 18:58:44 +0000 |
commit | 353493d702c3c9b4f7cecccfbc4188012bf813ef (patch) | |
tree | d4836721727d1dfe15791e66cb543fdfdd07816d /mojo | |
parent | 8aac4344364604d598e935a5a49137ad3181815f (diff) | |
download | chromium_src-353493d702c3c9b4f7cecccfbc4188012bf813ef.zip chromium_src-353493d702c3c9b4f7cecccfbc4188012bf813ef.tar.gz chromium_src-353493d702c3c9b4f7cecccfbc4188012bf813ef.tar.bz2 |
Mojo: More virtual/override style fixes in mojo/.
This patch was automatically generated by applying clang fixit hints
generated by the plugin to the source tree. (Run on Linux, for the mojo
target.)
R=sky@chromium.org
Review URL: https://codereview.chromium.org/667223002
Cr-Commit-Position: refs/heads/master@{#300530}
Diffstat (limited to 'mojo')
26 files changed, 294 insertions, 341 deletions
diff --git a/mojo/aura/screen_mojo.h b/mojo/aura/screen_mojo.h index 184ccff..2fab17f 100644 --- a/mojo/aura/screen_mojo.h +++ b/mojo/aura/screen_mojo.h @@ -20,26 +20,22 @@ namespace mojo { class ScreenMojo : public gfx::Screen { public: static ScreenMojo* Create(); - virtual ~ScreenMojo(); + ~ScreenMojo() override; protected: // gfx::Screen overrides: - virtual bool IsDIPEnabled() override; - virtual gfx::Point GetCursorScreenPoint() override; - virtual gfx::NativeWindow GetWindowUnderCursor() override; - virtual gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) - override; - virtual int GetNumDisplays() const override; - virtual std::vector<gfx::Display> GetAllDisplays() const override; - virtual gfx::Display GetDisplayNearestWindow( - gfx::NativeView view) const override; - virtual gfx::Display GetDisplayNearestPoint( - const gfx::Point& point) const override; - virtual gfx::Display GetDisplayMatching( - const gfx::Rect& match_rect) const override; - virtual gfx::Display GetPrimaryDisplay() const override; - virtual void AddObserver(gfx::DisplayObserver* observer) override; - virtual void RemoveObserver(gfx::DisplayObserver* observer) override; + bool IsDIPEnabled() override; + gfx::Point GetCursorScreenPoint() override; + gfx::NativeWindow GetWindowUnderCursor() override; + gfx::NativeWindow GetWindowAtScreenPoint(const gfx::Point& point) override; + int GetNumDisplays() const override; + std::vector<gfx::Display> GetAllDisplays() const override; + gfx::Display GetDisplayNearestWindow(gfx::NativeView view) const override; + gfx::Display GetDisplayNearestPoint(const gfx::Point& point) const override; + gfx::Display GetDisplayMatching(const gfx::Rect& match_rect) const override; + gfx::Display GetPrimaryDisplay() const override; + void AddObserver(gfx::DisplayObserver* observer) override; + void RemoveObserver(gfx::DisplayObserver* observer) override; private: explicit ScreenMojo(const gfx::Rect& screen_bounds); diff --git a/mojo/aura/surface_binding.cc b/mojo/aura/surface_binding.cc index fc1d31a..8c1da68 100644 --- a/mojo/aura/surface_binding.cc +++ b/mojo/aura/surface_binding.cc @@ -35,10 +35,10 @@ namespace { class SurfaceClientImpl : public SurfaceClient { public: SurfaceClientImpl() {} - virtual ~SurfaceClientImpl() {} + ~SurfaceClientImpl() override {} // SurfaceClient: - virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override { + void ReturnResources(Array<ReturnedResourcePtr> resources) override { // TODO (sky|jamesr): figure out right way to recycle resources. } @@ -56,10 +56,10 @@ class OutputSurfaceImpl : public cc::OutputSurface { const scoped_refptr<cc::ContextProvider>& context_provider, Surface* surface, cc::SurfaceIdAllocator* id_allocator); - virtual ~OutputSurfaceImpl(); + ~OutputSurfaceImpl() override; // cc::OutputSurface: - virtual void SwapBuffers(cc::CompositorFrame* frame) override; + void SwapBuffers(cc::CompositorFrame* frame) override; private: View* view_; diff --git a/mojo/aura/surface_context_factory.h b/mojo/aura/surface_context_factory.h index 8dd4721..d60080e 100644 --- a/mojo/aura/surface_context_factory.h +++ b/mojo/aura/surface_context_factory.h @@ -15,26 +15,24 @@ class View; class SurfaceContextFactory : public ui::ContextFactory { public: SurfaceContextFactory(Shell* shell, View* view); - virtual ~SurfaceContextFactory(); + ~SurfaceContextFactory() override; private: // ContextFactory: - virtual scoped_ptr<cc::OutputSurface> CreateOutputSurface( + scoped_ptr<cc::OutputSurface> CreateOutputSurface( ui::Compositor* compositor, bool software_fallback) override; - virtual scoped_refptr<ui::Reflector> CreateReflector( + scoped_refptr<ui::Reflector> CreateReflector( ui::Compositor* mirrored_compositor, ui::Layer* mirroring_layer) override; - virtual void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; - virtual scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() - override; - virtual void RemoveCompositor(ui::Compositor* compositor) override; - virtual bool DoesCreateTestContexts() override; - virtual cc::SharedBitmapManager* GetSharedBitmapManager() override; - virtual cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; - virtual base::MessageLoopProxy* GetCompositorMessageLoop() override; - virtual scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() - override; + void RemoveReflector(scoped_refptr<ui::Reflector> reflector) override; + scoped_refptr<cc::ContextProvider> SharedMainThreadContextProvider() override; + void RemoveCompositor(ui::Compositor* compositor) override; + bool DoesCreateTestContexts() override; + cc::SharedBitmapManager* GetSharedBitmapManager() override; + cc::GpuMemoryBufferManager* GetGpuMemoryBufferManager() override; + base::MessageLoopProxy* GetCompositorMessageLoop() override; + scoped_ptr<cc::SurfaceIdAllocator> CreateSurfaceIdAllocator() override; SurfaceBinding surface_binding_; diff --git a/mojo/aura/window_tree_host_mojo.h b/mojo/aura/window_tree_host_mojo.h index f43e90d..f3f4be91 100644 --- a/mojo/aura/window_tree_host_mojo.h +++ b/mojo/aura/window_tree_host_mojo.h @@ -27,7 +27,7 @@ class WindowTreeHostMojo : public aura::WindowTreeHost, public ViewObserver { public: WindowTreeHostMojo(Shell* shell, View* view); - virtual ~WindowTreeHostMojo(); + ~WindowTreeHostMojo() override; const gfx::Rect& bounds() const { return bounds_; } @@ -37,27 +37,27 @@ class WindowTreeHostMojo : public aura::WindowTreeHost, private: // WindowTreeHost: - virtual ui::EventSource* GetEventSource() override; - virtual gfx::AcceleratedWidget GetAcceleratedWidget() override; - virtual void Show() override; - virtual void Hide() override; - virtual gfx::Rect GetBounds() const override; - virtual void SetBounds(const gfx::Rect& bounds) override; - virtual gfx::Point GetLocationOnNativeScreen() const override; - virtual void SetCapture() override; - virtual void ReleaseCapture() override; - virtual void PostNativeEvent(const base::NativeEvent& native_event) override; - virtual void SetCursorNative(gfx::NativeCursor cursor) override; - virtual void MoveCursorToNative(const gfx::Point& location) override; - virtual void OnCursorVisibilityChangedNative(bool show) override; + ui::EventSource* GetEventSource() override; + gfx::AcceleratedWidget GetAcceleratedWidget() override; + void Show() override; + void Hide() override; + gfx::Rect GetBounds() const override; + void SetBounds(const gfx::Rect& bounds) override; + gfx::Point GetLocationOnNativeScreen() const override; + void SetCapture() override; + void ReleaseCapture() override; + void PostNativeEvent(const base::NativeEvent& native_event) override; + void SetCursorNative(gfx::NativeCursor cursor) override; + void MoveCursorToNative(const gfx::Point& location) override; + void OnCursorVisibilityChangedNative(bool show) override; // ui::EventSource: - virtual ui::EventProcessor* GetEventProcessor() override; + ui::EventProcessor* GetEventProcessor() override; // ViewObserver: - virtual void OnViewBoundsChanged(View* view, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnViewBoundsChanged(View* view, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; View* view_; diff --git a/mojo/public/python/src/python_system_helper.cc b/mojo/public/python/src/python_system_helper.cc index 50b5fb0..22b6bbb 100644 --- a/mojo/public/python/src/python_system_helper.cc +++ b/mojo/public/python/src/python_system_helper.cc @@ -57,7 +57,7 @@ class PythonClosure : public mojo::Closure::Runnable { MOJO_DCHECK(callable); } - virtual void Run() const override { + void Run() const override { ScopedGIL acquire_gil; ScopedPyRef empty_tuple(PyTuple_New(0)); if (!empty_tuple) { @@ -101,7 +101,7 @@ class PythonAsyncWaiter::AsyncWaiterRunnable void set_wait_id(int wait_id) { wait_id_ = wait_id; } - virtual void Run(MojoResult mojo_result) const override { + void Run(MojoResult mojo_result) const override { MOJO_DCHECK(wait_id_); // Remove to reference to this object from PythonAsyncWaiter and ensure this diff --git a/mojo/services/native_viewport/platform_viewport_x11.cc b/mojo/services/native_viewport/platform_viewport_x11.cc index b34928e..099b31c 100644 --- a/mojo/services/native_viewport/platform_viewport_x11.cc +++ b/mojo/services/native_viewport/platform_viewport_x11.cc @@ -24,14 +24,14 @@ class PlatformViewportX11 : public PlatformViewport, explicit PlatformViewportX11(Delegate* delegate) : delegate_(delegate) { } - virtual ~PlatformViewportX11() { + ~PlatformViewportX11() override { // Destroy the platform-window while |this| is still alive. platform_window_.reset(); } private: // Overridden from PlatformViewport: - virtual void Init(const gfx::Rect& bounds) override { + void Init(const gfx::Rect& bounds) override { CHECK(!event_source_); CHECK(!platform_window_); @@ -41,44 +41,31 @@ class PlatformViewportX11 : public PlatformViewport, platform_window_->SetBounds(bounds); } - virtual void Show() override { - platform_window_->Show(); - } + void Show() override { platform_window_->Show(); } - virtual void Hide() override { - platform_window_->Hide(); - } + void Hide() override { platform_window_->Hide(); } - virtual void Close() override { - platform_window_->Close(); - } + void Close() override { platform_window_->Close(); } - virtual gfx::Size GetSize() override { - return bounds_.size(); - } + gfx::Size GetSize() override { return bounds_.size(); } - virtual void SetBounds(const gfx::Rect& bounds) override { + void SetBounds(const gfx::Rect& bounds) override { platform_window_->SetBounds(bounds); } - virtual void SetCapture() override { - platform_window_->SetCapture(); - } + void SetCapture() override { platform_window_->SetCapture(); } - virtual void ReleaseCapture() override { - platform_window_->ReleaseCapture(); - } + void ReleaseCapture() override { platform_window_->ReleaseCapture(); } // ui::PlatformWindowDelegate: - virtual void OnBoundsChanged(const gfx::Rect& new_bounds) override { + void OnBoundsChanged(const gfx::Rect& new_bounds) override { bounds_ = new_bounds; delegate_->OnBoundsChanged(new_bounds); } - virtual void OnDamageRect(const gfx::Rect& damaged_region) override { - } + void OnDamageRect(const gfx::Rect& damaged_region) override {} - virtual void DispatchEvent(ui::Event* event) override { + void DispatchEvent(ui::Event* event) override { delegate_->OnEvent(event); // We want to emulate the WM_CHAR generation behaviour of Windows. @@ -113,26 +100,19 @@ class PlatformViewportX11 : public PlatformViewport, } } - virtual void OnCloseRequest() override { - platform_window_->Close(); - } + void OnCloseRequest() override { platform_window_->Close(); } - virtual void OnClosed() override { - delegate_->OnDestroyed(); - } + void OnClosed() override { delegate_->OnDestroyed(); } - virtual void OnWindowStateChanged(ui::PlatformWindowState state) override { - } + void OnWindowStateChanged(ui::PlatformWindowState state) override {} - virtual void OnLostCapture() override { - } + void OnLostCapture() override {} - virtual void OnAcceleratedWidgetAvailable( - gfx::AcceleratedWidget widget) override { + void OnAcceleratedWidgetAvailable(gfx::AcceleratedWidget widget) override { delegate_->OnAcceleratedWidgetAvailable(widget); } - virtual void OnActivationChanged(bool active) override {} + void OnActivationChanged(bool active) override {} scoped_ptr<ui::PlatformEventSource> event_source_; scoped_ptr<ui::PlatformWindow> platform_window_; diff --git a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h index 28d3c24..439fa1c 100644 --- a/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h +++ b/mojo/services/public/cpp/view_manager/lib/view_manager_test_suite.h @@ -12,10 +12,10 @@ namespace mojo { class ViewManagerTestSuite : public base::TestSuite { public: ViewManagerTestSuite(int argc, char** argv); - virtual ~ViewManagerTestSuite(); + ~ViewManagerTestSuite() override; protected: - virtual void Initialize() override; + void Initialize() override; private: DISALLOW_COPY_AND_ASSIGN(ViewManagerTestSuite); diff --git a/mojo/services/view_manager/connection_manager.h b/mojo/services/view_manager/connection_manager.h index 1917439..618460f 100644 --- a/mojo/services/view_manager/connection_manager.h +++ b/mojo/services/view_manager/connection_manager.h @@ -68,7 +68,7 @@ class MOJO_VIEW_MANAGER_EXPORT ConnectionManager : public ServerViewDelegate { ConnectionManager(ApplicationConnection* app_connection, const Callback<void()>& native_viewport_closed_callback); - virtual ~ConnectionManager(); + ~ConnectionManager() override; // Returns the id for the next ViewManagerServiceImpl. ConnectionSpecificId GetAndAdvanceNextConnectionId(); @@ -164,21 +164,21 @@ class MOJO_VIEW_MANAGER_EXPORT ConnectionManager : public ServerViewDelegate { InterfaceRequest<ServiceProvider> service_provider); // Overridden from ServerViewDelegate: - virtual void OnViewDestroyed(const ServerView* view) override; - virtual void OnWillChangeViewHierarchy(const ServerView* view, - const ServerView* new_parent, - const ServerView* old_parent) override; - virtual void OnViewHierarchyChanged(const ServerView* view, - const ServerView* new_parent, - const ServerView* old_parent) override; - virtual void OnViewBoundsChanged(const ServerView* view, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; - virtual void OnViewSurfaceIdChanged(const ServerView* view) override; - virtual void OnViewReordered(const ServerView* view, - const ServerView* relative, - OrderDirection direction) override; - virtual void OnWillChangeViewVisibility(const ServerView* view) override; + void OnViewDestroyed(const ServerView* view) override; + void OnWillChangeViewHierarchy(const ServerView* view, + const ServerView* new_parent, + const ServerView* old_parent) override; + void OnViewHierarchyChanged(const ServerView* view, + const ServerView* new_parent, + const ServerView* old_parent) override; + void OnViewBoundsChanged(const ServerView* view, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; + void OnViewSurfaceIdChanged(const ServerView* view) override; + void OnViewReordered(const ServerView* view, + const ServerView* relative, + OrderDirection direction) override; + void OnWillChangeViewVisibility(const ServerView* view) override; ApplicationConnection* app_connection_; diff --git a/mojo/services/view_manager/default_access_policy.h b/mojo/services/view_manager/default_access_policy.h index d8c0194..a57ecc2 100644 --- a/mojo/services/view_manager/default_access_policy.h +++ b/mojo/services/view_manager/default_access_policy.h @@ -18,24 +18,23 @@ class DefaultAccessPolicy : public AccessPolicy { public: DefaultAccessPolicy(ConnectionSpecificId connection_id, AccessPolicyDelegate* delegate); - virtual ~DefaultAccessPolicy(); + ~DefaultAccessPolicy() override; // AccessPolicy: - virtual bool CanRemoveViewFromParent(const ServerView* view) const override; - virtual bool CanAddView(const ServerView* parent, - const ServerView* child) const override; - virtual bool CanReorderView(const ServerView* view, - const ServerView* relative_view, - OrderDirection direction) const override; - virtual bool CanDeleteView(const ServerView* view) const override; - virtual bool CanGetViewTree(const ServerView* view) const override; - virtual bool CanDescendIntoViewForViewTree( - const ServerView* view) const override; - virtual bool CanEmbed(const ServerView* view) const override; - virtual bool CanChangeViewVisibility(const ServerView* view) const override; - virtual bool CanSetViewSurfaceId(const ServerView* view) const override; - virtual bool CanSetViewBounds(const ServerView* view) const override; - virtual bool ShouldNotifyOnHierarchyChange( + bool CanRemoveViewFromParent(const ServerView* view) const override; + bool CanAddView(const ServerView* parent, + const ServerView* child) const override; + bool CanReorderView(const ServerView* view, + const ServerView* relative_view, + OrderDirection direction) const override; + bool CanDeleteView(const ServerView* view) const override; + bool CanGetViewTree(const ServerView* view) const override; + bool CanDescendIntoViewForViewTree(const ServerView* view) const override; + bool CanEmbed(const ServerView* view) const override; + bool CanChangeViewVisibility(const ServerView* view) const override; + bool CanSetViewSurfaceId(const ServerView* view) const override; + bool CanSetViewBounds(const ServerView* view) const override; + bool ShouldNotifyOnHierarchyChange( const ServerView* view, const ServerView** new_parent, const ServerView** old_parent) const override; diff --git a/mojo/services/view_manager/display_manager.h b/mojo/services/view_manager/display_manager.h index 8b95a57..1f5f930 100644 --- a/mojo/services/view_manager/display_manager.h +++ b/mojo/services/view_manager/display_manager.h @@ -40,7 +40,7 @@ class MOJO_VIEW_MANAGER_EXPORT DisplayManager DisplayManager(ApplicationConnection* app_connection, ConnectionManager* connection_manager, const Callback<void()>& native_viewport_closed_callback); - virtual ~DisplayManager(); + ~DisplayManager() override; // Schedules a paint for the specified region of the specified view. void SchedulePaint(const ServerView* view, const gfx::Rect& bounds); @@ -54,13 +54,12 @@ class MOJO_VIEW_MANAGER_EXPORT DisplayManager void Draw(); // NativeViewportClient implementation. - virtual void OnDestroyed() override; - virtual void OnSizeChanged(SizePtr size) override; - virtual void OnEvent(EventPtr event, - const mojo::Callback<void()>& callback) override; + void OnDestroyed() override; + void OnSizeChanged(SizePtr size) override; + void OnEvent(EventPtr event, const mojo::Callback<void()>& callback) override; // SurfaceClient implementation. - virtual void ReturnResources(Array<ReturnedResourcePtr> resources) override; + void ReturnResources(Array<ReturnedResourcePtr> resources) override; ConnectionManager* connection_manager_; diff --git a/mojo/services/view_manager/main.cc b/mojo/services/view_manager/main.cc index cd14dc0..39c48d6b 100644 --- a/mojo/services/view_manager/main.cc +++ b/mojo/services/view_manager/main.cc @@ -16,10 +16,9 @@ class ViewManagerApp : public ApplicationDelegate, public InterfaceFactory<ViewManagerInitService> { public: ViewManagerApp() {} - virtual ~ViewManagerApp() {} + ~ViewManagerApp() override {} - virtual bool ConfigureIncomingConnection( - ApplicationConnection* connection) override { + bool ConfigureIncomingConnection(ApplicationConnection* connection) override { context_.ConfigureIncomingConnection(connection); // TODO(sky): this needs some sort of authentication as well as making sure // we only ever have one active at a time. @@ -27,9 +26,8 @@ class ViewManagerApp : public ApplicationDelegate, return true; } - virtual void Create( - ApplicationConnection* connection, - InterfaceRequest<ViewManagerInitService> request) override { + void Create(ApplicationConnection* connection, + InterfaceRequest<ViewManagerInitService> request) override { BindToRequest(new ViewManagerInitServiceImpl(connection, &context_), &request); } diff --git a/mojo/services/view_manager/view_manager_init_service_impl.h b/mojo/services/view_manager/view_manager_init_service_impl.h index 63fbc38..b36efbe 100644 --- a/mojo/services/view_manager/view_manager_init_service_impl.h +++ b/mojo/services/view_manager/view_manager_init_service_impl.h @@ -34,13 +34,13 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerInitServiceImpl public: ViewManagerInitServiceImpl(ApplicationConnection* connection, ViewManagerInitServiceContext* context); - virtual ~ViewManagerInitServiceImpl(); + ~ViewManagerInitServiceImpl() override; private: // ViewManagerInitService overrides: - virtual void Embed(const String& url, - ServiceProviderPtr service_provider, - const Callback<void(bool)>& callback) override; + void Embed(const String& url, + ServiceProviderPtr service_provider, + const Callback<void(bool)>& callback) override; ViewManagerInitServiceContext* context_; diff --git a/mojo/services/view_manager/view_manager_service_impl.h b/mojo/services/view_manager/view_manager_service_impl.h index c77f285..bb15fcd 100644 --- a/mojo/services/view_manager/view_manager_service_impl.h +++ b/mojo/services/view_manager/view_manager_service_impl.h @@ -47,7 +47,7 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerServiceImpl const std::string& url, const ViewId& root_id, InterfaceRequest<ServiceProvider> service_provider); - virtual ~ViewManagerServiceImpl(); + ~ViewManagerServiceImpl() override; // Used to mark this connection as originating from a call to // ViewManagerService::Connect(). When set OnConnectionError() deletes |this|. @@ -96,7 +96,7 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerServiceImpl // TODO(sky): move this to private section (currently can't because of // bindings). // InterfaceImp overrides: - virtual void OnConnectionError() override; + void OnConnectionError() override; private: typedef std::map<ConnectionSpecificId, ServerView*> ViewMap; @@ -147,45 +147,42 @@ class MOJO_VIEW_MANAGER_EXPORT ViewManagerServiceImpl void NotifyDrawnStateChanged(const ServerView* view, bool new_drawn_value); // ViewManagerService: - virtual void CreateView(Id transport_view_id, - const Callback<void(ErrorCode)>& callback) override; - virtual void DeleteView(Id transport_view_id, - const Callback<void(bool)>& callback) override; - virtual void AddView(Id parent_id, - Id child_id, - const Callback<void(bool)>& callback) override; - virtual void RemoveViewFromParent( - Id view_id, - const Callback<void(bool)>& callback) override; - virtual void ReorderView(Id view_id, - Id relative_view_id, - OrderDirection direction, - const Callback<void(bool)>& callback) override; - virtual void GetViewTree( - Id view_id, - const Callback<void(Array<ViewDataPtr>)>& callback) override; - virtual void SetViewSurfaceId(Id view_id, - SurfaceIdPtr surface_id, - const Callback<void(bool)>& callback) override; - virtual void SetViewBounds(Id view_id, - RectPtr bounds, - const Callback<void(bool)>& callback) override; - virtual void SetViewVisibility(Id view_id, - bool visible, - const Callback<void(bool)>& callback) override; - virtual void Embed(const String& url, - Id view_id, - ServiceProviderPtr service_provider, + void CreateView(Id transport_view_id, + const Callback<void(ErrorCode)>& callback) override; + void DeleteView(Id transport_view_id, + const Callback<void(bool)>& callback) override; + void AddView(Id parent_id, + Id child_id, + const Callback<void(bool)>& callback) override; + void RemoveViewFromParent(Id view_id, + const Callback<void(bool)>& callback) override; + void ReorderView(Id view_id, + Id relative_view_id, + OrderDirection direction, + const Callback<void(bool)>& callback) override; + void GetViewTree(Id view_id, + const Callback<void(Array<ViewDataPtr>)>& callback) override; + void SetViewSurfaceId(Id view_id, + SurfaceIdPtr surface_id, + const Callback<void(bool)>& callback) override; + void SetViewBounds(Id view_id, + RectPtr bounds, const Callback<void(bool)>& callback) override; + void SetViewVisibility(Id view_id, + bool visible, + const Callback<void(bool)>& callback) override; + void Embed(const String& url, + Id view_id, + ServiceProviderPtr service_provider, + const Callback<void(bool)>& callback) override; // InterfaceImpl: - virtual void OnConnectionEstablished() override; + void OnConnectionEstablished() override; // AccessPolicyDelegate: - virtual const base::hash_set<Id>& GetRootsForAccessPolicy() const override; - virtual bool IsViewKnownForAccessPolicy( - const ServerView* view) const override; - virtual bool IsViewRootOfAnotherConnectionForAccessPolicy( + const base::hash_set<Id>& GetRootsForAccessPolicy() const override; + bool IsViewKnownForAccessPolicy(const ServerView* view) const override; + bool IsViewRootOfAnotherConnectionForAccessPolicy( const ServerView* view) const override; ConnectionManager* connection_manager_; diff --git a/mojo/services/view_manager/view_manager_unittest.cc b/mojo/services/view_manager/view_manager_unittest.cc index abf874e..073ad4c 100644 --- a/mojo/services/view_manager/view_manager_unittest.cc +++ b/mojo/services/view_manager/view_manager_unittest.cc @@ -65,8 +65,7 @@ class ViewManagerProxy : public TestChangeTracker::Delegate { SetInstance(this); } - virtual ~ViewManagerProxy() { - } + ~ViewManagerProxy() override {} // Returns true if in an initial state. If this returns false it means the // last test didn't clean up properly, or most likely didn't invoke @@ -288,7 +287,7 @@ class ViewManagerProxy : public TestChangeTracker::Delegate { } // TestChangeTracker::Delegate: - virtual void OnChangeAdded() override { + void OnChangeAdded() override { if (quit_count_ > 0 && --quit_count_ == 0) QuitCountReached(); } @@ -336,45 +335,44 @@ class TestViewManagerClientConnection ViewManagerProxy* proxy() { return &proxy_; } // InterfaceImpl: - virtual void OnConnectionEstablished() override { + void OnConnectionEstablished() override { proxy_.set_router(internal_state()->router()); proxy_.set_view_manager(client()); } // ViewManagerClient: - virtual void OnEmbed( - ConnectionSpecificId connection_id, - const String& creator_url, - ViewDataPtr root, - InterfaceRequest<ServiceProvider> services) override { + void OnEmbed(ConnectionSpecificId connection_id, + const String& creator_url, + ViewDataPtr root, + InterfaceRequest<ServiceProvider> services) override { tracker_.OnEmbed(connection_id, creator_url, root.Pass()); } - virtual void OnViewBoundsChanged(Id view_id, - RectPtr old_bounds, - RectPtr new_bounds) override { + void OnViewBoundsChanged(Id view_id, + RectPtr old_bounds, + RectPtr new_bounds) override { tracker_.OnViewBoundsChanged(view_id, old_bounds.Pass(), new_bounds.Pass()); } - virtual void OnViewHierarchyChanged(Id view, - Id new_parent, - Id old_parent, - Array<ViewDataPtr> views) override { + void OnViewHierarchyChanged(Id view, + Id new_parent, + Id old_parent, + Array<ViewDataPtr> views) override { tracker_.OnViewHierarchyChanged(view, new_parent, old_parent, views.Pass()); } - virtual void OnViewReordered(Id view_id, - Id relative_view_id, - OrderDirection direction) override { + void OnViewReordered(Id view_id, + Id relative_view_id, + OrderDirection direction) override { tracker_.OnViewReordered(view_id, relative_view_id, direction); } - virtual void OnViewDeleted(Id view) override { tracker_.OnViewDeleted(view); } - virtual void OnViewVisibilityChanged(uint32_t view, bool visible) override { + void OnViewDeleted(Id view) override { tracker_.OnViewDeleted(view); } + void OnViewVisibilityChanged(uint32_t view, bool visible) override { tracker_.OnViewVisibilityChanged(view, visible); } - virtual void OnViewDrawnStateChanged(uint32_t view, bool drawn) override { + void OnViewDrawnStateChanged(uint32_t view, bool drawn) override { tracker_.OnViewDrawnStateChanged(view, drawn); } - virtual void OnViewInputEvent(Id view_id, - EventPtr event, - const Callback<void()>& callback) override { + void OnViewInputEvent(Id view_id, + EventPtr event, + const Callback<void()>& callback) override { tracker_.OnViewInputEvent(view_id, event.Pass()); } @@ -389,20 +387,19 @@ class WindowManagerServiceImpl : public InterfaceImpl<WindowManagerService> { public: explicit WindowManagerServiceImpl(TestViewManagerClientConnection* connection) : connection_(connection) {} - virtual ~WindowManagerServiceImpl() {} + ~WindowManagerServiceImpl() override {} // InterfaceImpl: - virtual void OnConnectionEstablished() override { + void OnConnectionEstablished() override { connection_->proxy()->set_window_manager_client(client()); } // WindowManagerService: - virtual void Embed( - const String& url, - InterfaceRequest<ServiceProvider> service_provider) override { + void Embed(const String& url, + InterfaceRequest<ServiceProvider> service_provider) override { connection_->tracker()->DelegateEmbed(url); } - virtual void OnViewInputEvent(mojo::EventPtr event) override {} + void OnViewInputEvent(mojo::EventPtr event) override {} private: TestViewManagerClientConnection* connection_; @@ -418,12 +415,12 @@ class EmbedApplicationLoader : public ApplicationLoader, public InterfaceFactory<WindowManagerService> { public: EmbedApplicationLoader() : last_view_manager_client_(nullptr) {} - virtual ~EmbedApplicationLoader() {} + ~EmbedApplicationLoader() override {} // ApplicationLoader implementation: - virtual void Load(ApplicationManager* manager, - const GURL& url, - scoped_refptr<LoadCallbacks> callbacks) override { + void Load(ApplicationManager* manager, + const GURL& url, + scoped_refptr<LoadCallbacks> callbacks) override { ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); if (!shell_handle.is_valid()) return; @@ -431,25 +428,24 @@ class EmbedApplicationLoader : public ApplicationLoader, shell_handle.Pass())); apps_.push_back(app.release()); } - virtual void OnApplicationError(ApplicationManager* manager, - const GURL& url) override {} + void OnApplicationError(ApplicationManager* manager, + const GURL& url) override {} // ApplicationDelegate implementation: - virtual bool ConfigureIncomingConnection(ApplicationConnection* connection) - override { + bool ConfigureIncomingConnection(ApplicationConnection* connection) override { connection->AddService<ViewManagerClient>(this); connection->AddService<WindowManagerService>(this); return true; } // InterfaceFactory<ViewManagerClient> implementation: - virtual void Create(ApplicationConnection* connection, - InterfaceRequest<ViewManagerClient> request) override { + void Create(ApplicationConnection* connection, + InterfaceRequest<ViewManagerClient> request) override { last_view_manager_client_ = new TestViewManagerClientConnection; BindToRequest(last_view_manager_client_, &request); } - virtual void Create(ApplicationConnection* connection, - InterfaceRequest<WindowManagerService> request) override { + void Create(ApplicationConnection* connection, + InterfaceRequest<WindowManagerService> request) override { BindToRequest(new WindowManagerServiceImpl(last_view_manager_client_), &request); } diff --git a/mojo/services/view_manager/window_manager_access_policy.h b/mojo/services/view_manager/window_manager_access_policy.h index aa44fd6..7b8e7a9 100644 --- a/mojo/services/view_manager/window_manager_access_policy.h +++ b/mojo/services/view_manager/window_manager_access_policy.h @@ -17,24 +17,23 @@ class WindowManagerAccessPolicy : public AccessPolicy { public: WindowManagerAccessPolicy(ConnectionSpecificId connection_id, AccessPolicyDelegate* delegate); - virtual ~WindowManagerAccessPolicy(); + ~WindowManagerAccessPolicy() override; // AccessPolicy: - virtual bool CanRemoveViewFromParent(const ServerView* view) const override; - virtual bool CanAddView(const ServerView* parent, - const ServerView* child) const override; - virtual bool CanReorderView(const ServerView* view, - const ServerView* relative_view, - OrderDirection direction) const override; - virtual bool CanDeleteView(const ServerView* view) const override; - virtual bool CanGetViewTree(const ServerView* view) const override; - virtual bool CanDescendIntoViewForViewTree( - const ServerView* view) const override; - virtual bool CanEmbed(const ServerView* view) const override; - virtual bool CanChangeViewVisibility(const ServerView* view) const override; - virtual bool CanSetViewSurfaceId(const ServerView* view) const override; - virtual bool CanSetViewBounds(const ServerView* view) const override; - virtual bool ShouldNotifyOnHierarchyChange( + bool CanRemoveViewFromParent(const ServerView* view) const override; + bool CanAddView(const ServerView* parent, + const ServerView* child) const override; + bool CanReorderView(const ServerView* view, + const ServerView* relative_view, + OrderDirection direction) const override; + bool CanDeleteView(const ServerView* view) const override; + bool CanGetViewTree(const ServerView* view) const override; + bool CanDescendIntoViewForViewTree(const ServerView* view) const override; + bool CanEmbed(const ServerView* view) const override; + bool CanChangeViewVisibility(const ServerView* view) const override; + bool CanSetViewSurfaceId(const ServerView* view) const override; + bool CanSetViewBounds(const ServerView* view) const override; + bool ShouldNotifyOnHierarchyChange( const ServerView* view, const ServerView** new_parent, const ServerView** old_parent) const override; diff --git a/mojo/services/view_manager/window_manager_client_impl.h b/mojo/services/view_manager/window_manager_client_impl.h index b25aafe..704489d 100644 --- a/mojo/services/view_manager/window_manager_client_impl.h +++ b/mojo/services/view_manager/window_manager_client_impl.h @@ -30,14 +30,13 @@ class MOJO_VIEW_MANAGER_EXPORT WindowManagerClientImpl : public InterfaceImpl<WindowManagerClient> { public: explicit WindowManagerClientImpl(ConnectionManager* connection_manager); - virtual ~WindowManagerClientImpl(); + ~WindowManagerClientImpl() override; // WindowManagerClient: - virtual void DispatchInputEventToView(Id transport_view_id, - EventPtr event) override; + void DispatchInputEventToView(Id transport_view_id, EventPtr event) override; // InterfaceImp overrides: - virtual void OnConnectionError() override; + void OnConnectionError() override; private: ConnectionManager* connection_manager_; diff --git a/mojo/services/window_manager/main.cc b/mojo/services/window_manager/main.cc index 3e2d37c..028795b 100644 --- a/mojo/services/window_manager/main.cc +++ b/mojo/services/window_manager/main.cc @@ -26,33 +26,31 @@ class DefaultWindowManager : public ApplicationDelegate, : window_manager_app_(new WindowManagerApp(this, this)), view_manager_(NULL), root_(NULL) {} - virtual ~DefaultWindowManager() {} + ~DefaultWindowManager() override {} private: // Overridden from ApplicationDelegate: - virtual void Initialize(ApplicationImpl* impl) override { + void Initialize(ApplicationImpl* impl) override { window_manager_app_->Initialize(impl); } - virtual bool ConfigureIncomingConnection( - ApplicationConnection* connection) override { + bool ConfigureIncomingConnection(ApplicationConnection* connection) override { window_manager_app_->ConfigureIncomingConnection(connection); return true; } // Overridden from ViewManagerDelegate: - virtual void OnEmbed(ViewManager* view_manager, - View* root, - ServiceProviderImpl* exported_services, - scoped_ptr<ServiceProvider> imported_services) override { + void OnEmbed(ViewManager* view_manager, + View* root, + ServiceProviderImpl* exported_services, + scoped_ptr<ServiceProvider> imported_services) override { view_manager_ = view_manager; root_ = root; } - virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {} + void OnViewManagerDisconnected(ViewManager* view_manager) override {} // Overridden from WindowManagerDelegate: - virtual void Embed( - const String& url, - InterfaceRequest<ServiceProvider> service_provider) override { + void Embed(const String& url, + InterfaceRequest<ServiceProvider> service_provider) override { View* view = View::Create(view_manager_); root_->AddChild(view); view->Embed(url, scoped_ptr<mojo::ServiceProviderImpl>( diff --git a/mojo/services/window_manager/window_manager_api_unittest.cc b/mojo/services/window_manager/window_manager_api_unittest.cc index 7f89283..d5cad73 100644 --- a/mojo/services/window_manager/window_manager_api_unittest.cc +++ b/mojo/services/window_manager/window_manager_api_unittest.cc @@ -54,7 +54,7 @@ class TestWindowManagerClient : public WindowManagerClient2 { explicit TestWindowManagerClient(base::RunLoop* run_loop) : run_loop_(run_loop) {} - virtual ~TestWindowManagerClient() {} + ~TestWindowManagerClient() override {} void set_focus_changed_callback(const TwoNodeCallback& callback) { focus_changed_callback_ = callback; @@ -65,16 +65,15 @@ class TestWindowManagerClient : public WindowManagerClient2 { private: // Overridden from WindowManagerClient: - virtual void OnWindowManagerReady() override { run_loop_->Quit(); } - virtual void OnCaptureChanged(Id old_capture_node_id, - Id new_capture_node_id) override {} - virtual void OnFocusChanged(Id old_focused_node_id, - Id new_focused_node_id) override { + void OnWindowManagerReady() override { run_loop_->Quit(); } + void OnCaptureChanged(Id old_capture_node_id, + Id new_capture_node_id) override {} + void OnFocusChanged(Id old_focused_node_id, Id new_focused_node_id) override { if (!focus_changed_callback_.is_null()) focus_changed_callback_.Run(old_focused_node_id, new_focused_node_id); } - virtual void OnActiveWindowChanged(Id old_active_window, - Id new_active_window) override { + void OnActiveWindowChanged(Id old_active_window, + Id new_active_window) override { if (!active_window_changed_callback_.is_null()) active_window_changed_callback_.Run(old_active_window, new_active_window); } @@ -94,13 +93,13 @@ class TestApplicationLoader : public ApplicationLoader, explicit TestApplicationLoader(const RootAddedCallback& root_added_callback) : root_added_callback_(root_added_callback) {} - virtual ~TestApplicationLoader() {} + ~TestApplicationLoader() override {} private: // Overridden from ApplicationLoader: - virtual void Load(ApplicationManager* application_manager, - const GURL& url, - scoped_refptr<LoadCallbacks> callbacks) override { + void Load(ApplicationManager* application_manager, + const GURL& url, + scoped_refptr<LoadCallbacks> callbacks) override { ScopedMessagePipeHandle shell_handle = callbacks->RegisterApplication(); if (!shell_handle.is_valid()) return; @@ -108,29 +107,28 @@ class TestApplicationLoader : public ApplicationLoader, new ApplicationImpl(this, shell_handle.Pass())); apps_.push_back(app.release()); } - virtual void OnApplicationError(ApplicationManager* application_manager, - const GURL& url) override {} + void OnApplicationError(ApplicationManager* application_manager, + const GURL& url) override {} // Overridden from ApplicationDelegate: - virtual void Initialize(ApplicationImpl* app) override { + void Initialize(ApplicationImpl* app) override { view_manager_client_factory_.reset( new ViewManagerClientFactory(app->shell(), this)); } - virtual bool ConfigureIncomingConnection( - ApplicationConnection* connection) override { + bool ConfigureIncomingConnection(ApplicationConnection* connection) override { connection->AddService(view_manager_client_factory_.get()); return true; } // Overridden from ViewManagerDelegate: - virtual void OnEmbed(ViewManager* view_manager, - View* root, - ServiceProviderImpl* exported_services, - scoped_ptr<ServiceProvider> imported_services) override { + void OnEmbed(ViewManager* view_manager, + View* root, + ServiceProviderImpl* exported_services, + scoped_ptr<ServiceProvider> imported_services) override { root_added_callback_.Run(root); } - virtual void OnViewManagerDisconnected(ViewManager* view_manager) override {} + void OnViewManagerDisconnected(ViewManager* view_manager) override {} RootAddedCallback root_added_callback_; diff --git a/mojo/services/window_manager/window_manager_app.cc b/mojo/services/window_manager/window_manager_app.cc index ffd80a8..2852bd2 100644 --- a/mojo/services/window_manager/window_manager_app.cc +++ b/mojo/services/window_manager/window_manager_app.cc @@ -34,32 +34,34 @@ namespace mojo { class DummyDelegate : public aura::WindowDelegate { public: DummyDelegate() {} - virtual ~DummyDelegate() {} + ~DummyDelegate() override {} private: // WindowDelegate overrides: - virtual gfx::Size GetMinimumSize() const override { return gfx::Size(); } - virtual gfx::Size GetMaximumSize() const override { return gfx::Size(); } - virtual void OnBoundsChanged(const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override {} - virtual gfx::NativeCursor GetCursor(const gfx::Point& point) override { + gfx::Size GetMinimumSize() const override { return gfx::Size(); } + gfx::Size GetMaximumSize() const override { return gfx::Size(); } + void OnBoundsChanged(const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override {} + gfx::NativeCursor GetCursor(const gfx::Point& point) override { return gfx::kNullCursor; } - virtual int GetNonClientComponent(const gfx::Point& point) const override { + int GetNonClientComponent(const gfx::Point& point) const override { return HTCAPTION; } - virtual bool ShouldDescendIntoChildForEventHandling( + bool ShouldDescendIntoChildForEventHandling( aura::Window* child, - const gfx::Point& location) override { return true; } - virtual bool CanFocus() override { return true; } - virtual void OnCaptureLost() override {} - virtual void OnPaint(gfx::Canvas* canvas) override {} - virtual void OnDeviceScaleFactorChanged(float device_scale_factor) override {} - virtual void OnWindowDestroying(aura::Window* window) override {} - virtual void OnWindowDestroyed(aura::Window* window) override {} - virtual void OnWindowTargetVisibilityChanged(bool visible) override {} - virtual bool HasHitTestMask() const override { return false; } - virtual void GetHitTestMask(gfx::Path* mask) const override {} + const gfx::Point& location) override { + return true; + } + bool CanFocus() override { return true; } + void OnCaptureLost() override {} + void OnPaint(gfx::Canvas* canvas) override {} + void OnDeviceScaleFactorChanged(float device_scale_factor) override {} + void OnWindowDestroying(aura::Window* window) override {} + void OnWindowDestroyed(aura::Window* window) override {} + void OnWindowTargetVisibilityChanged(bool visible) override {} + bool HasHitTestMask() const override { return false; } + void GetHitTestMask(gfx::Path* mask) const override {} DISALLOW_COPY_AND_ASSIGN(DummyDelegate); }; diff --git a/mojo/services/window_manager/window_manager_app.h b/mojo/services/window_manager/window_manager_app.h index 8c9c244..c7d2dc3 100644 --- a/mojo/services/window_manager/window_manager_app.h +++ b/mojo/services/window_manager/window_manager_app.h @@ -64,7 +64,7 @@ class WindowManagerApp public: WindowManagerApp(ViewManagerDelegate* view_manager_delegate, WindowManagerDelegate* window_manager_delegate); - virtual ~WindowManagerApp(); + ~WindowManagerApp() override; static View* GetViewForWindow(aura::Window* window); aura::Window* GetWindowForViewId(Id view); @@ -95,39 +95,37 @@ class WindowManagerApp } // Overridden from ApplicationDelegate: - virtual void Initialize(ApplicationImpl* impl) override; - virtual bool ConfigureIncomingConnection( - ApplicationConnection* connection) override; + void Initialize(ApplicationImpl* impl) override; + bool ConfigureIncomingConnection(ApplicationConnection* connection) override; private: typedef std::set<WindowManagerService2Impl*> Connections; typedef std::map<Id, aura::Window*> ViewIdToWindowMap; // Overridden from ViewManagerDelegate: - virtual void OnEmbed(ViewManager* view_manager, - View* root, - ServiceProviderImpl* exported_services, - scoped_ptr<ServiceProvider> imported_services) override; - virtual void OnViewManagerDisconnected(ViewManager* view_manager) override; + void OnEmbed(ViewManager* view_manager, + View* root, + ServiceProviderImpl* exported_services, + scoped_ptr<ServiceProvider> imported_services) override; + void OnViewManagerDisconnected(ViewManager* view_manager) override; // Overridden from ViewObserver: - virtual void OnTreeChanged( - const ViewObserver::TreeChangeParams& params) override; - virtual void OnViewDestroying(View* view) override; - virtual void OnViewBoundsChanged(View* view, - const gfx::Rect& old_bounds, - const gfx::Rect& new_bounds) override; + void OnTreeChanged(const ViewObserver::TreeChangeParams& params) override; + void OnViewDestroying(View* view) override; + void OnViewBoundsChanged(View* view, + const gfx::Rect& old_bounds, + const gfx::Rect& new_bounds) override; // Overridden from ui::EventHandler: - virtual void OnEvent(ui::Event* event) override; + void OnEvent(ui::Event* event) override; // Overridden from aura::client::FocusChangeObserver: - virtual void OnWindowFocused(aura::Window* gained_focus, - aura::Window* lost_focus) override; + void OnWindowFocused(aura::Window* gained_focus, + aura::Window* lost_focus) override; // 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; // Creates an aura::Window for every view in the hierarchy beneath |view|, // and adds to the registry so that it can be retrieved later via diff --git a/mojo/services/window_manager/window_manager_service2_impl.h b/mojo/services/window_manager/window_manager_service2_impl.h index be129b4..a09db91 100644 --- a/mojo/services/window_manager/window_manager_service2_impl.h +++ b/mojo/services/window_manager/window_manager_service2_impl.h @@ -16,7 +16,7 @@ class WindowManagerApp; class WindowManagerService2Impl : public InterfaceImpl<WindowManagerService2> { public: explicit WindowManagerService2Impl(WindowManagerApp* manager); - virtual ~WindowManagerService2Impl(); + ~WindowManagerService2Impl() override; void NotifyReady(); void NotifyViewFocused(Id new_focused_id, Id old_focused_id); @@ -24,15 +24,12 @@ class WindowManagerService2Impl : public InterfaceImpl<WindowManagerService2> { private: // Overridden from WindowManagerService: - virtual void SetCapture(Id view, - const Callback<void(bool)>& callback) override; - virtual void FocusWindow(Id view, - const Callback<void(bool)>& callback) override; - virtual void ActivateWindow(Id view, - const Callback<void(bool)>& callback) override; + void SetCapture(Id view, const Callback<void(bool)>& callback) override; + void FocusWindow(Id view, const Callback<void(bool)>& callback) override; + void ActivateWindow(Id view, const Callback<void(bool)>& callback) override; // Overridden from InterfaceImpl: - virtual void OnConnectionEstablished() override; + void OnConnectionEstablished() override; WindowManagerApp* window_manager_; diff --git a/mojo/services/window_manager/window_manager_service_impl.h b/mojo/services/window_manager/window_manager_service_impl.h index ba2d29e..39349c2 100644 --- a/mojo/services/window_manager/window_manager_service_impl.h +++ b/mojo/services/window_manager/window_manager_service_impl.h @@ -15,17 +15,16 @@ class WindowManagerApp; class WindowManagerServiceImpl : public InterfaceImpl<WindowManagerService> { public: explicit WindowManagerServiceImpl(WindowManagerApp* app); - virtual ~WindowManagerServiceImpl(); + ~WindowManagerServiceImpl() override; private: // WindowManagerServiceImpl: - virtual void Embed( - const String& url, - InterfaceRequest<ServiceProvider> service_provider) override; - virtual void OnViewInputEvent(mojo::EventPtr event) override; + void Embed(const String& url, + InterfaceRequest<ServiceProvider> service_provider) override; + void OnViewInputEvent(mojo::EventPtr event) override; // InterfaceImpl: - virtual void OnConnectionEstablished() override; + void OnConnectionEstablished() override; WindowManagerApp* app_; diff --git a/mojo/services/window_manager/window_manager_unittests.cc b/mojo/services/window_manager/window_manager_unittests.cc index dbd9a48..dd05b455 100644 --- a/mojo/services/window_manager/window_manager_unittests.cc +++ b/mojo/services/window_manager/window_manager_unittests.cc @@ -16,10 +16,10 @@ namespace mojo { class WindowManagerTestSuite : public base::TestSuite { public: WindowManagerTestSuite(int argc, char** argv) : TestSuite(argc, argv) {} - virtual ~WindowManagerTestSuite() {} + ~WindowManagerTestSuite() override {} protected: - virtual void Initialize() override { + void Initialize() override { #if defined(USE_X11) // Each test ends up creating a new thread for the native viewport service. // In other words we'll use X on different threads, so tell it that. diff --git a/mojo/shell/external_application_listener_unittest.cc b/mojo/shell/external_application_listener_unittest.cc index 7f675ae..2fc5511 100644 --- a/mojo/shell/external_application_listener_unittest.cc +++ b/mojo/shell/external_application_listener_unittest.cc @@ -56,7 +56,7 @@ namespace { class StubShellImpl : public InterfaceImpl<Shell> { private: - virtual void ConnectToApplication( + void ConnectToApplication( const String& requestor_url, InterfaceRequest<ServiceProvider> in_service_provider) override { ServiceProviderPtr out_service_provider; @@ -106,10 +106,10 @@ class QuitLoopOnConnectApplicationImpl : public InterfaceImpl<Application> { : url_(url), to_quit_(loop), quit_callback_(quit_callback) {} private: - virtual void Initialize(Array<String> args) override {} + void Initialize(Array<String> args) override {} - virtual void AcceptConnection(const String& requestor_url, - ServiceProviderPtr p) override { + void AcceptConnection(const String& requestor_url, + ServiceProviderPtr p) override { DVLOG(1) << url_ << " accepting connection from " << requestor_url; to_quit_->PostTask(FROM_HERE, quit_callback_); } diff --git a/mojo/shell/external_application_registrar_connection.h b/mojo/shell/external_application_registrar_connection.h index 327d19b..dbe02e6 100644 --- a/mojo/shell/external_application_registrar_connection.h +++ b/mojo/shell/external_application_registrar_connection.h @@ -29,10 +29,10 @@ class ExternalApplicationRegistrarConnection : public ErrorHandler { // Configures client_socket_ to point at socket_path. explicit ExternalApplicationRegistrarConnection( const base::FilePath& socket_path); - virtual ~ExternalApplicationRegistrarConnection(); + ~ExternalApplicationRegistrarConnection() override; // Implementation of ErrorHandler - virtual void OnConnectionError() override; + void OnConnectionError() override; // Connects client_socket_ and binds it to registrar_. // Status code is passed to callback upon success or failure. diff --git a/mojo/shell/incoming_connection_listener_unittest.cc b/mojo/shell/incoming_connection_listener_unittest.cc index 5488c98..61b0a5e 100644 --- a/mojo/shell/incoming_connection_listener_unittest.cc +++ b/mojo/shell/incoming_connection_listener_unittest.cc @@ -25,10 +25,10 @@ namespace { class TestDelegate : public IncomingConnectionListenerPosix::Delegate { public: TestDelegate() {} - virtual ~TestDelegate() {} + ~TestDelegate() override {} - virtual void OnListening(int rv) override { EXPECT_EQ(net::OK, rv); } - virtual void OnConnection(net::SocketDescriptor incoming) override { + void OnListening(int rv) override { EXPECT_EQ(net::OK, rv); } + void OnConnection(net::SocketDescriptor incoming) override { EXPECT_NE(net::kInvalidSocket, incoming); } }; @@ -38,10 +38,10 @@ class ListeningFailsDelegate : public IncomingConnectionListenerPosix::Delegate { public: explicit ListeningFailsDelegate(int expected) : expected_error_(expected) {} - virtual ~ListeningFailsDelegate() {} + ~ListeningFailsDelegate() override {} - virtual void OnListening(int rv) override { EXPECT_EQ(expected_error_, rv); } - virtual void OnConnection(net::SocketDescriptor incoming) override { + void OnListening(int rv) override { EXPECT_EQ(expected_error_, rv); } + void OnConnection(net::SocketDescriptor incoming) override { FAIL() << "No connection should be attempted."; } |