Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(347)

Side by Side Diff: blimp/client/core/contents/blimp_contents_view_impl.h

Issue 2320923002: Add a full Blimp integration test. (Closed)
Patch Set: Addressed more comments, added thread restriction bypass for tests. Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2016 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.
4
5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_
6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_
7
8 #include <memory>
9
10 #include "base/macros.h"
11 #include "base/memory/ref_counted.h"
12 #include "base/memory/weak_ptr.h"
13 #include "blimp/client/core/contents/ime_feature.h"
14 #include "blimp/client/public/contents/blimp_contents_view.h"
15 #include "ui/gfx/native_widget_types.h"
16
17 namespace cc {
18 class CopyOutputResult;
19 }
20
21 namespace blimp {
22 namespace client {
23 class BlimpContentsImpl;
24
25 // The internal generic implementation of a BlimpContentsView that implements
26 // the common functionality shared across platforms. Meant to be overridden and
27 // implemented for each supported platform.
28 class BlimpContentsViewImpl : public BlimpContentsView {
29 public:
30 // A factory method that needs to be implemented for each supported platform.
31 static std::unique_ptr<BlimpContentsViewImpl> Create(
32 BlimpContentsImpl* blimp_contents,
33 scoped_refptr<cc::Layer> contents_layer);
34
35 ~BlimpContentsViewImpl() override;
36
37 // Exposes the plaform specific ImeFeature::Delegate. This should handle text
38 // input requests and present them to the user.
39 virtual ImeFeature::Delegate* GetImeDelegate() = 0;
40
41 // BlimpContentsView implementation.
42 scoped_refptr<cc::Layer> GetLayer() override;
43 void SetSizeAndScale(const gfx::Size& size,
44 float device_scale_factor) override;
45 bool OnTouchEvent(const ui::MotionEvent& motion_event) override;
46 void CopyFromCompositingSurface(const ReadbackRequestCallback& callback,
47 bool flush_pending_commits) override;
48
49 protected:
50 BlimpContentsViewImpl(BlimpContentsImpl* blimp_contents,
51 scoped_refptr<cc::Layer> contents_layer);
52
53 private:
54 void StartReadbackRequest();
55 void OnReadbackComplete(std::unique_ptr<cc::CopyOutputResult> result);
56
57 BlimpContentsImpl* blimp_contents_;
58 scoped_refptr<cc::Layer> contents_layer_;
59
60 // The callback for any outstanding readback request.
61 ReadbackRequestCallback readback_callback_;
62
63 base::WeakPtrFactory<BlimpContentsViewImpl> weak_ptr_factory_;
64
65 DISALLOW_COPY_AND_ASSIGN(BlimpContentsViewImpl);
66 };
67
68 } // namespace client
69 } // namespace blimp
70
71 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_VIEW_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698