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

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

Issue 2292723003: Move remaining Blimp feature code to core. (Closed)
Patch Set: Fix build break 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
1 // Copyright 2016 The Chromium Authors. All rights reserved. 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 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_ 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_
6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_ 6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/observer_list.h" 9 #include "base/observer_list.h"
10 #include "blimp/client/core/compositor/blimp_compositor_manager.h"
10 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h" 11 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h"
11 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h" 12 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h"
12 #include "blimp/client/public/contents/blimp_contents.h" 13 #include "blimp/client/public/contents/blimp_contents.h"
13 #include "ui/gfx/geometry/size.h" 14 #include "ui/gfx/geometry/size.h"
14 #include "url/gurl.h" 15 #include "url/gurl.h"
15 16
16 #if defined(OS_ANDROID) 17 #if defined(OS_ANDROID)
17 #include "base/android/scoped_java_ref.h" 18 #include "base/android/scoped_java_ref.h"
18 #endif // defined(OS_ANDROID) 19 #endif // defined(OS_ANDROID)
19 20
20 namespace blimp { 21 namespace blimp {
21 namespace client { 22 namespace client {
22 23
23 #if defined(OS_ANDROID) 24 #if defined(OS_ANDROID)
24 class BlimpContentsImplAndroid; 25 class BlimpContentsImplAndroid;
25 #endif // defined(OS_ANDROID) 26 #endif // defined(OS_ANDROID)
26 27
28 class BlimpCompositorDependencies;
27 class BlimpContentsObserver; 29 class BlimpContentsObserver;
28 class BlimpContentsView; 30 class BlimpContentsView;
29 class BlimpNavigationController; 31 class BlimpNavigationController;
30 class ImeFeature; 32 class ImeFeature;
31 class NavigationFeature; 33 class NavigationFeature;
34 class RenderWidgetFeature;
32 class TabControlFeature; 35 class TabControlFeature;
33 36
34 class BlimpContentsImpl : public BlimpContents, 37 class BlimpContentsImpl : public BlimpContents,
35 public BlimpNavigationControllerDelegate { 38 public BlimpNavigationControllerDelegate {
36 public: 39 public:
37 // Ownership of the features remains with the caller. 40 // Ownership of the features remains with the caller.
38 explicit BlimpContentsImpl(int id, 41 explicit BlimpContentsImpl(int id,
42 BlimpCompositorDependencies* compositor_deps,
39 ImeFeature* ime_feature, 43 ImeFeature* ime_feature,
40 NavigationFeature* navigation_feature, 44 NavigationFeature* navigation_feature,
45 RenderWidgetFeature* render_widget_feature,
41 TabControlFeature* tab_control_feature); 46 TabControlFeature* tab_control_feature);
42 ~BlimpContentsImpl() override; 47 ~BlimpContentsImpl() override;
43 48
44 #if defined(OS_ANDROID) 49 #if defined(OS_ANDROID)
45 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; 50 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override;
46 BlimpContentsImplAndroid* GetBlimpContentsImplAndroid(); 51 BlimpContentsImplAndroid* GetBlimpContentsImplAndroid();
47 #endif // defined(OS_ANDROID) 52 #endif // defined(OS_ANDROID)
48 53
49 // BlimpContents implementation. 54 // BlimpContents implementation.
50 BlimpNavigationControllerImpl& GetNavigationController() override; 55 BlimpNavigationControllerImpl& GetNavigationController() override;
51 void AddObserver(BlimpContentsObserver* observer) override; 56 void AddObserver(BlimpContentsObserver* observer) override;
52 void RemoveObserver(BlimpContentsObserver* observer) override; 57 void RemoveObserver(BlimpContentsObserver* observer) override;
53 gfx::NativeView GetNativeView() override; 58 gfx::NativeView GetNativeView() override;
59 void Show() override;
60 void Hide() override;
54 61
55 // Check if some observer is in the observer list. 62 // Check if some observer is in the observer list.
56 bool HasObserver(BlimpContentsObserver* observer); 63 bool HasObserver(BlimpContentsObserver* observer);
57 64
58 // BlimpNavigationControllerDelegate implementation. 65 // BlimpNavigationControllerDelegate implementation.
59 void OnNavigationStateChanged() override; 66 void OnNavigationStateChanged() override;
60 67
61 // Pushes the size and scale information to the engine, which will affect the 68 // Pushes the size and scale information to the engine, which will affect the
62 // web content display area for all tabs. 69 // web content display area for all tabs.
63 void SetSizeAndScale(const gfx::Size& size, float device_pixel_ratio); 70 void SetSizeAndScale(const gfx::Size& size, float device_pixel_ratio);
64 71
65 int id() { return id_; } 72 int id() { return id_; }
66 73
67 private: 74 private:
68 // Handles the back/forward list and loading URLs. 75 // Handles the back/forward list and loading URLs.
69 BlimpNavigationControllerImpl navigation_controller_; 76 BlimpNavigationControllerImpl navigation_controller_;
70 77
78 // Holds onto all active BlimpCompositor instances for this BlimpContents.
79 // This properly exposes the right rendered page content for the correct
80 // BlimpCompositor based on the engine state.
81 BlimpCompositorManager compositor_manager_;
82
71 // A list of all the observers of this BlimpContentsImpl. 83 // A list of all the observers of this BlimpContentsImpl.
72 base::ObserverList<BlimpContentsObserver> observers_; 84 base::ObserverList<BlimpContentsObserver> observers_;
73 85
74 // The id is assigned during contents creation. It is used by 86 // The id is assigned during contents creation. It is used by
75 // BlimpContentsManager to control the life time of the its observer. 87 // BlimpContentsManager to control the life time of the its observer.
76 int id_; 88 int id_;
77 89
78 // The tab control feature through which the BlimpContentsImpl is able to 90 // The tab control feature through which the BlimpContentsImpl is able to
79 // set size and scale. 91 // set size and scale.
80 // TODO(mlliu): in the long term, we want to put size and scale in a different 92 // TODO(mlliu): in the long term, we want to put size and scale in a different
81 // feature instead of tab control feature. crbug.com/639154. 93 // feature instead of tab control feature. crbug.com/639154.
82 TabControlFeature* tab_control_feature_ = nullptr; 94 TabControlFeature* tab_control_feature_ = nullptr;
83 95
84 // The BlimpContentsView abstracts the platform specific view system details 96 // The BlimpContentsView abstracts the platform specific view system details
85 // from the BlimpContents. 97 // from the BlimpContents.
86 std::unique_ptr<BlimpContentsView> blimp_contents_view_; 98 std::unique_ptr<BlimpContentsView> blimp_contents_view_;
87 99
88 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl); 100 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl);
89 }; 101 };
90 102
91 } // namespace client 103 } // namespace client
92 } // namespace blimp 104 } // namespace blimp
93 105
94 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_ 106 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698