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 "url/gurl.h" | 10 #include "url/gurl.h" |
11 | 11 |
| 12 #if defined(OS_ANDROID) |
| 13 #include "base/android/scoped_java_ref.h" |
| 14 #endif |
| 15 |
12 namespace blimp { | 16 namespace blimp { |
13 namespace client { | 17 namespace client { |
14 | 18 |
15 class BlimpContentsObserver; | 19 class BlimpContentsObserver; |
16 class BlimpNavigationController; | 20 class BlimpNavigationController; |
17 | 21 |
18 // BlimpContents is the core class in blimp client which is responsible for | 22 // BlimpContents is the core class in blimp client which is responsible for |
19 // rendering web pages in a rectangular area. The interaction with between the | 23 // rendering web pages in a rectangular area. The interaction with between the |
20 // client and engine is encapsulated behind this interface through the use of | 24 // client and engine is encapsulated behind this interface through the use of |
21 // the navigation controller. Each BlimpContents has exactly one | 25 // the navigation controller. Each BlimpContents has exactly one |
22 // BlimpNavigationController which can be used to load URLs, navigate | 26 // BlimpNavigationController which can be used to load URLs, navigate |
23 // backwards/forward etc. See blimp_navigation_controller.h for more details. | 27 // backwards/forward etc. See blimp_navigation_controller.h for more details. |
24 class BlimpContents : public base::SupportsUserData { | 28 class BlimpContents : public base::SupportsUserData { |
25 public: | 29 public: |
26 // Retrives the navigation controller that controls all navigation related | 30 // Retrives the navigation controller that controls all navigation related |
27 // to this BlimpContents. | 31 // to this BlimpContents. |
28 virtual BlimpNavigationController& GetNavigationController() = 0; | 32 virtual BlimpNavigationController& GetNavigationController() = 0; |
29 | 33 |
30 // Enables adding and removing observers to this BlimpContents. | 34 // Enables adding and removing observers to this BlimpContents. |
31 virtual void AddObserver(BlimpContentsObserver* observer) = 0; | 35 virtual void AddObserver(BlimpContentsObserver* observer) = 0; |
32 virtual void RemoveObserver(BlimpContentsObserver* observer) = 0; | 36 virtual void RemoveObserver(BlimpContentsObserver* observer) = 0; |
33 | 37 |
| 38 #if defined(OS_ANDROID) |
| 39 // Returns a Java object of the type BlimpContents for the given |
| 40 // BlimpContents. |
| 41 virtual base::android::ScopedJavaLocalRef<jobject> GetJavaObject() = 0; |
| 42 #endif |
| 43 |
34 protected: | 44 protected: |
35 BlimpContents() {} | 45 BlimpContents() {} |
36 | 46 |
37 private: | 47 private: |
38 DISALLOW_COPY_AND_ASSIGN(BlimpContents); | 48 DISALLOW_COPY_AND_ASSIGN(BlimpContents); |
39 }; | 49 }; |
40 | 50 |
41 } // namespace client | 51 } // namespace client |
42 } // namespace blimp | 52 } // namespace blimp |
43 | 53 |
44 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ | 54 #endif // BLIMP_CLIENT_PUBLIC_CONTENTS_BLIMP_CONTENTS_H_ |
OLD | NEW |