Include all dupe types (event when value is zero) in scan stats.
[chromium-blink-merge.git] / components / view_manager / server_view_delegate.h
blobc815f9fec74df7b6a4e80d0c4e50cc1bdb425f10
1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef COMPONENTS_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_
6 #define COMPONENTS_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_
8 #include "components/view_manager/public/interfaces/view_manager_constants.mojom.h"
10 namespace gfx {
11 class Rect;
14 namespace mojo {
15 class ViewportMetrics;
18 namespace view_manager {
20 class ServerView;
22 // ServerViewDelegate is notified at key points in the lifetime of a
23 // ServerView. Some of the functions are similar to that of
24 // ServerViewObserver. For example, ServerViewDelegate::PrepareToDestroyView()
25 // and ServerViewObserver::OnWillDestroyView(). The key difference between
26 // the two are the ServerViewDelegate ones are always notified first, and
27 // ServerViewDelegate gets non-const arguments.
28 class ServerViewDelegate {
29 public:
30 // Invoked when a view is about to be destroyed; before any of the children
31 // have been removed and before the view has been removed from its parent.
32 virtual void PrepareToDestroyView(ServerView* view) = 0;
34 virtual void PrepareToChangeViewHierarchy(ServerView* view,
35 ServerView* new_parent,
36 ServerView* old_parent) = 0;
38 virtual void PrepareToChangeViewVisibility(ServerView* view) = 0;
40 virtual void OnScheduleViewPaint(const ServerView* view) = 0;
42 protected:
43 virtual ~ServerViewDelegate() {}
46 } // namespace view_manager
48 #endif // COMPONENTS_VIEW_MANAGER_SERVER_VIEW_DELEGATE_H_