Chromium Code Reviews| Index: blimp/client/core/blimp_navigation_controller_impl.h |
| diff --git a/blimp/client/core/blimp_navigation_controller_impl.h b/blimp/client/core/blimp_navigation_controller_impl.h |
| index b62ed25a1f47a4d05957f2e271298234ebad4789..d503d76d0cf2f76be8afbce42c42667930bbf98b 100644 |
| --- a/blimp/client/core/blimp_navigation_controller_impl.h |
| +++ b/blimp/client/core/blimp_navigation_controller_impl.h |
| @@ -8,8 +8,11 @@ |
| #include "base/macros.h" |
| #include "base/memory/weak_ptr.h" |
| #include "blimp/client/core/public/blimp_navigation_controller.h" |
| +#include "blimp/client/feature/navigation_feature.h" |
| #include "url/gurl.h" |
| +class SkBitmap; |
| + |
| namespace blimp { |
| namespace client { |
| @@ -21,7 +24,9 @@ class BlimpNavigationControllerDelegate; |
| // The BlimpNavigationControllerImpl is the implementation part of |
| // BlimpNavigationController. It maintains the back-forward list for a |
| // BlimpContentsImpl and manages all navigation within that list. |
| -class BlimpNavigationControllerImpl : public BlimpNavigationController { |
| +class BlimpNavigationControllerImpl |
| + : public BlimpNavigationController, |
| + public NavigationFeature::NavigationFeatureDelegate { |
| public: |
| explicit BlimpNavigationControllerImpl( |
| BlimpNavigationControllerDelegate* delegate); |
| @@ -29,10 +34,29 @@ class BlimpNavigationControllerImpl : public BlimpNavigationController { |
| // BlimpNavigationController implementation. |
| void LoadURL(const GURL& url) override; |
| + void Reload() override; |
| + bool CanGoBack() const override; |
| + bool CanGoForward() const override; |
| + void GoBack() override; |
| + void GoForward() override; |
| + |
| const GURL& GetURL() override; |
| + // For testing only. |
| + // TODO(shaktisahu): Remove this. |
|
David Trainor- moved to gerrit
2016/06/29 17:27:15
How will this be set during the normal flow? In t
shaktisahu
2016/07/19 21:45:29
Yes. This should be set from the constructor. I ad
|
| + void SetNavigationFeatureForTesting(NavigationFeature* feature); |
| + |
| private: |
| - void NotifyDelegateURLLoaded(const GURL& url); |
| + // NavigationFeatureDelegate implementation. |
| + void OnUrlChanged(int tab_id, const GURL& url) override; |
| + void OnFaviconChanged(int tab_id, const SkBitmap& favicon) override; |
| + void OnTitleChanged(int tab_id, const std::string& title) override; |
| + void OnLoadingChanged(int tab_id, bool loading) override; |
| + void OnPageLoadStatusUpdate(int tab_id, bool completed) override; |
| + |
| + // The |navigation_feature_| is responsible for sending and receiving the |
| + // navigation state to the server over the proto channel. |
| + NavigationFeature* navigation_feature_; |
| // The delegate contains functionality required for the navigation controller |
| // to function correctly. It is also invoked on relevant state changes of the |
| @@ -42,9 +66,6 @@ class BlimpNavigationControllerImpl : public BlimpNavigationController { |
| // The currently active URL. |
| GURL current_url_; |
| - // TODO(shaktisahu): Remove this after integration with NavigationFeature. |
| - base::WeakPtrFactory<BlimpNavigationControllerImpl> weak_ptr_factory_; |
| - |
| DISALLOW_COPY_AND_ASSIGN(BlimpNavigationControllerImpl); |
| }; |