summaryrefslogtreecommitdiffstats
path: root/components/view_manager/test_server_view_delegate.h
blob: 85186d8749bf0740f1feeeea7f6eb14b20ba0bd7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// Copyright 2014 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef COMPONENTS_VIEW_MANAGER_TEST_SERVER_VIEW_DELEGATE_H_
#define COMPONENTS_VIEW_MANAGER_TEST_SERVER_VIEW_DELEGATE_H_

#include "base/basictypes.h"
#include "components/view_manager/server_view_delegate.h"

namespace view_manager {

class TestServerViewDelegate : public ServerViewDelegate {
 public:
  TestServerViewDelegate();
  ~TestServerViewDelegate() override;

  void set_root_view(const ServerView* view) { root_view_ = view; }
 private:
  // ServerViewDelegate:
  void PrepareToDestroyView(ServerView* view) override;
  void PrepareToChangeViewHierarchy(ServerView* view,
                                    ServerView* new_parent,
                                    ServerView* old_parent) override;
  void PrepareToChangeViewVisibility(ServerView* view) override;
  void OnScheduleViewPaint(const ServerView* view) override;
  const ServerView* GetRootView(const ServerView* view) const override;

  const ServerView* root_view_;

  DISALLOW_COPY_AND_ASSIGN(TestServerViewDelegate);
};

}  // namespace view_manager

#endif  // COMPONENTS_VIEW_MANAGER_TEST_SERVER_VIEW_DELEGATE_H_