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