| 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_CORE_BLIMP_CONTENTS_IMPL_H_ | 5 #ifndef BLIMP_CLIENT_CORE_BLIMP_CONTENTS_IMPL_H_ |
| 6 #define BLIMP_CLIENT_CORE_BLIMP_CONTENTS_IMPL_H_ | 6 #define BLIMP_CLIENT_CORE_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 "base/supports_user_data.h" |
| 10 #include "blimp/client/core/blimp_navigation_controller_delegate.h" | 11 #include "blimp/client/core/blimp_navigation_controller_delegate.h" |
| 11 #include "blimp/client/core/blimp_navigation_controller_impl.h" | 12 #include "blimp/client/core/blimp_navigation_controller_impl.h" |
| 12 #include "blimp/client/core/public/blimp_contents.h" | 13 #include "blimp/client/core/public/blimp_contents.h" |
| 13 #include "url/gurl.h" | 14 #include "url/gurl.h" |
| 14 | 15 |
| 16 #if defined(OS_ANDROID) |
| 17 #include "base/android/jni_android.h" |
| 18 #endif // defined(OS_ANDROID) |
| 19 |
| 15 namespace blimp { | 20 namespace blimp { |
| 16 namespace client { | 21 namespace client { |
| 17 | 22 |
| 23 #if defined(OS_ANDROID) |
| 24 class BlimpContentsImplAndroid; |
| 25 #endif // defined(OS_ANDROID) |
| 26 |
| 18 class BlimpContentsObserver; | 27 class BlimpContentsObserver; |
| 19 class BlimpNavigationController; | 28 class BlimpNavigationController; |
| 20 | 29 |
| 21 // BlimpContentsImpl is the implementation of the core class in | 30 // BlimpContentsImpl is the implementation of the core class in |
| 22 // //blimp/client/core, the BlimpContents. | 31 // //blimp/client/core, the BlimpContents. |
| 23 class BlimpContentsImpl : public BlimpContents, | 32 class BlimpContentsImpl : public BlimpContents, |
| 24 public BlimpNavigationControllerDelegate { | 33 public BlimpNavigationControllerDelegate, |
| 34 base::SupportsUserData { |
| 25 public: | 35 public: |
| 26 BlimpContentsImpl(); | 36 BlimpContentsImpl(); |
| 27 ~BlimpContentsImpl() override; | 37 ~BlimpContentsImpl() override; |
| 28 | 38 |
| 39 #if defined(OS_ANDROID) |
| 40 base::android::ScopedJavaLocalRef<jobject> GetJavaBlimpContentsImpl(); |
| 41 BlimpContentsImplAndroid* GetBlimpContentsImplAndroid(); |
| 42 #endif // defined(OS_ANDROID) |
| 43 |
| 29 // BlimpContents implementation. | 44 // BlimpContents implementation. |
| 30 BlimpNavigationControllerImpl& GetNavigationController() override; | 45 BlimpNavigationControllerImpl& GetNavigationController() override; |
| 31 void AddObserver(BlimpContentsObserver* observer) override; | 46 void AddObserver(BlimpContentsObserver* observer) override; |
| 32 void RemoveObserver(BlimpContentsObserver* observer) override; | 47 void RemoveObserver(BlimpContentsObserver* observer) override; |
| 33 | 48 |
| 34 // BlimpNavigationControllerDelegate implementation. | 49 // BlimpNavigationControllerDelegate implementation. |
| 35 void NotifyURLLoaded(const GURL& url) override; | 50 void NotifyURLLoaded(const GURL& url) override; |
| 36 | 51 |
| 37 private: | 52 private: |
| 38 // Handles the back/forward list and loading URLs. | 53 // Handles the back/forward list and loading URLs. |
| 39 BlimpNavigationControllerImpl navigation_controller_; | 54 BlimpNavigationControllerImpl navigation_controller_; |
| 40 | 55 |
| 41 // A list of all the observers of this BlimpContentsImpl. | 56 // A list of all the observers of this BlimpContentsImpl. |
| 42 base::ObserverList<BlimpContentsObserver> observers_; | 57 base::ObserverList<BlimpContentsObserver> observers_; |
| 43 | 58 |
| 44 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl); | 59 DISALLOW_COPY_AND_ASSIGN(BlimpContentsImpl); |
| 45 }; | 60 }; |
| 46 | 61 |
| 47 } // namespace client | 62 } // namespace client |
| 48 } // namespace blimp | 63 } // namespace blimp |
| 49 | 64 |
| 50 #endif // BLIMP_CLIENT_CORE_BLIMP_CONTENTS_IMPL_H_ | 65 #endif // BLIMP_CLIENT_CORE_BLIMP_CONTENTS_IMPL_H_ |
| OLD | NEW |