OLD | NEW |
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_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ | 5 #ifndef BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ |
6 #define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ | 6 #define BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ |
7 | 7 |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/supports_user_data.h" | 9 #include "base/supports_user_data.h" |
10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
11 #include "url/gurl.h" | |
12 | 11 |
13 #if defined(OS_ANDROID) | 12 #if defined(OS_ANDROID) |
14 #include "base/android/scoped_java_ref.h" | 13 #include "base/android/scoped_java_ref.h" |
15 #endif | 14 #endif |
16 | 15 |
| 16 namespace cc { |
| 17 class Layer; |
| 18 } // namespace cc |
| 19 |
17 namespace blimp { | 20 namespace blimp { |
18 namespace client { | 21 namespace client { |
19 | 22 |
20 class BlimpContentsObserver; | 23 class BlimpContentsObserver; |
| 24 class BlimpContentsView; |
21 class BlimpNavigationController; | 25 class BlimpNavigationController; |
22 | 26 |
23 // BlimpContents is the core class in blimp client which is responsible for | 27 // BlimpContents is the core class in blimp client which is responsible for |
24 // rendering web pages in a rectangular area. The interaction with between the | 28 // rendering web pages in a rectangular area. The interaction with between the |
25 // client and engine is encapsulated behind this interface through the use of | 29 // client and engine is encapsulated behind this interface through the use of |
26 // the navigation controller. Each BlimpContents has exactly one | 30 // the navigation controller. Each BlimpContents has exactly one |
27 // BlimpNavigationController which can be used to load URLs, navigate | 31 // BlimpNavigationController which can be used to load URLs, navigate |
28 // backwards/forward etc. See blimp_navigation_controller.h for more details. | 32 // backwards/forward etc. See blimp_navigation_controller.h for more details. |
29 class BlimpContents : public base::SupportsUserData { | 33 class BlimpContents : public base::SupportsUserData { |
30 public: | 34 public: |
31 // Retrives the navigation controller that controls all navigation related | 35 // Retrives the navigation controller that controls all navigation related |
32 // to this BlimpContents. | 36 // to this BlimpContents. |
33 virtual BlimpNavigationController& GetNavigationController() = 0; | 37 virtual BlimpNavigationController& GetNavigationController() = 0; |
34 | 38 |
35 // Enables adding and removing observers to this BlimpContents. | 39 // Enables adding and removing observers to this BlimpContents. |
36 virtual void AddObserver(BlimpContentsObserver* observer) = 0; | 40 virtual void AddObserver(BlimpContentsObserver* observer) = 0; |
37 virtual void RemoveObserver(BlimpContentsObserver* observer) = 0; | 41 virtual void RemoveObserver(BlimpContentsObserver* observer) = 0; |
38 | 42 |
39 // Returns the native view that holds the contents of this tab. | 43 // Returns the view that holds the contents of this tab. |
40 virtual gfx::NativeView GetNativeView() = 0; | 44 virtual BlimpContentsView* GetView() = 0; |
41 | 45 |
42 // Will cause this BlimpContents and the remote contents to show and start or | 46 // Will cause this BlimpContents and the remote contents to show and start or |
43 // stop rendering content respectively. | 47 // stop rendering content respectively. |
44 virtual void Show() = 0; | 48 virtual void Show() = 0; |
45 virtual void Hide() = 0; | 49 virtual void Hide() = 0; |
46 | 50 |
47 #if defined(OS_ANDROID) | 51 #if defined(OS_ANDROID) |
48 // Returns a Java object of the type BlimpContents for the given | 52 // Returns a Java object of the type BlimpContents for the given |
49 // BlimpContents. | 53 // BlimpContents. |
50 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; | 54 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
51 #endif | 55 #endif |
52 | 56 |
53 protected: | 57 protected: |
54 BlimpContents() {} | 58 BlimpContents() {} |
55 | 59 |
56 private: | 60 private: |
57 DISALLOW_COPY_AND_ASSIGN(BlimpContents); | 61 DISALLOW_COPY_AND_ASSIGN(BlimpContents); |
58 }; | 62 }; |
59 | 63 |
60 } // namespace client | 64 } // namespace client |
61 } // namespace blimp | 65 } // namespace blimp |
62 | 66 |
63 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ | 67 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ |
OLD | NEW |