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