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

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

Issue 2279403003: blimp: Hook up the layer holding the tab content into Chrome. (Closed)
Patch Set: tab_android 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/contents/blimp_navigation_controller_delegate.h" 10 #include "blimp/client/core/contents/blimp_navigation_controller_delegate.h"
11 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h" 11 #include "blimp/client/core/contents/blimp_navigation_controller_impl.h"
12 #include "blimp/client/public/contents/blimp_contents.h" 12 #include "blimp/client/public/contents/blimp_contents.h"
13 #include "ui/gfx/geometry/size.h" 13 #include "ui/gfx/geometry/size.h"
14 #include "url/gurl.h" 14 #include "url/gurl.h"
15 15
16 #if defined(OS_ANDROID) 16 #if defined(OS_ANDROID)
17 #include "base/android/scoped_java_ref.h" 17 #include "base/android/scoped_java_ref.h"
18 #endif // defined(OS_ANDROID) 18 #endif // defined(OS_ANDROID)
19 19
20 namespace blimp { 20 namespace blimp {
21 namespace client { 21 namespace client {
22 22
23 #if defined(OS_ANDROID) 23 #if defined(OS_ANDROID)
24 class BlimpContentsImplAndroid; 24 class BlimpContentsImplAndroid;
25 #endif // defined(OS_ANDROID) 25 #endif // defined(OS_ANDROID)
26 26
27 class BlimpContentsObserver; 27 class BlimpContentsObserver;
28 class BlimpContentsView;
28 class BlimpNavigationController; 29 class BlimpNavigationController;
29 class TabControlFeature; 30 class TabControlFeature;
30 31
31 class BlimpContentsImpl : public BlimpContents, 32 class BlimpContentsImpl : public BlimpContents,
32 public BlimpNavigationControllerDelegate { 33 public BlimpNavigationControllerDelegate {
33 public: 34 public:
34 explicit BlimpContentsImpl(int id, TabControlFeature* tab_control_feature); 35 explicit BlimpContentsImpl(int id, TabControlFeature* tab_control_feature);
35 ~BlimpContentsImpl() override; 36 ~BlimpContentsImpl() override;
36 37
37 #if defined(OS_ANDROID) 38 #if defined(OS_ANDROID)
38 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override; 39 base::android::ScopedJavaLocalRef<jobject> GetJavaObject() override;
39 BlimpContentsImplAndroid* GetBlimpContentsImplAndroid(); 40 BlimpContentsImplAndroid* GetBlimpContentsImplAndroid();
40 #endif // defined(OS_ANDROID) 41 #endif // defined(OS_ANDROID)
41 42
42 // BlimpContents implementation. 43 // BlimpContents implementation.
43 BlimpNavigationControllerImpl& GetNavigationController() override; 44 BlimpNavigationControllerImpl& GetNavigationController() override;
44 void AddObserver(BlimpContentsObserver* observer) override; 45 void AddObserver(BlimpContentsObserver* observer) override;
45 void RemoveObserver(BlimpContentsObserver* observer) override; 46 void RemoveObserver(BlimpContentsObserver* observer) override;
47 gfx::NativeView GetNativeView() override;
46 48
47 // Check if some observer is in the observer list. 49 // Check if some observer is in the observer list.
48 bool HasObserver(BlimpContentsObserver* observer); 50 bool HasObserver(BlimpContentsObserver* observer);
49 51
50 // BlimpNavigationControllerDelegate implementation. 52 // BlimpNavigationControllerDelegate implementation.
51 void OnNavigationStateChanged() override; 53 void OnNavigationStateChanged() override;
52 54
53 // Pushes the size and scale information to the engine, which will affect the 55 // Pushes the size and scale information to the engine, which will affect the
54 // web content display area for all tabs. 56 // web content display area for all tabs.
55 void SetSizeAndScale(const gfx::Size& size, float device_pixel_ratio); 57 void SetSizeAndScale(const gfx::Size& size, float device_pixel_ratio);
(...skipping 10 matching lines...) Expand all
66 // The id is assigned during contents creation. It is used by 68 // The id is assigned during contents creation. It is used by
67 // BlimpContentsManager to control the life time of the its observer. 69 // BlimpContentsManager to control the life time of the its observer.
68 int id_; 70 int id_;
69 71
70 // The tab control feature through which the BlimpContentsImpl is able to 72 // The tab control feature through which the BlimpContentsImpl is able to
71 // set size and scale. 73 // set size and scale.
72 // TODO(mlliu): in the long term, we want to put size and scale in a different 74 // TODO(mlliu): in the long term, we want to put size and scale in a different
73 // feature instead of tab control feature. crbug.com/639154. 75 // feature instead of tab control feature. crbug.com/639154.
74 TabControlFeature* tab_control_feature_ = nullptr; 76 TabControlFeature* tab_control_feature_ = nullptr;
75 77
78 std::unique_ptr<BlimpContentsView> blimp_contents_view_;
nyquist 2016/08/29 23:09:45 Could you add an explanation as to what this is fo
Khushal 2016/08/30 00:51:10 Done.
79
76 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl); 80 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl);
77 }; 81 };
78 82
79 } // namespace client 83 } // namespace client
80 } // namespace blimp 84 } // namespace blimp
81 85
82 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_ 86 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_CONTENTS_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698