Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1493)

Unified Diff: blimp/client/core/contents/blimp_navigation_controller_impl.h

Issue 2058263002: Tied up BlimpNavigationController to NavigationFeature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@blimp_core
Patch Set: Removed BlimpContentsTest.java Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: blimp/client/core/contents/blimp_navigation_controller_impl.h
diff --git a/blimp/client/core/contents/blimp_navigation_controller_impl.h b/blimp/client/core/contents/blimp_navigation_controller_impl.h
index 6ae6fa036877b5371d2c5b36afd7bd74fbd63eb3..1193fbaf9da96a848fce26f6c4746cc4f75b3354 100644
--- a/blimp/client/core/contents/blimp_navigation_controller_impl.h
+++ b/blimp/client/core/contents/blimp_navigation_controller_impl.h
@@ -6,33 +6,50 @@
#define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_
#include "base/macros.h"
-#include "base/memory/weak_ptr.h"
+#include "blimp/client/core/contents/navigation_feature.h"
#include "blimp/client/public/contents/blimp_navigation_controller.h"
#include "url/gurl.h"
+class SkBitmap;
+
namespace blimp {
namespace client {
class BlimpContentsObserver;
class BlimpNavigationControllerDelegate;
-// BlimpContentsImpl is the implementation of the core class in
-// //blimp/client/core, the BlimpContents.
-// 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);
+ // The life time of |feature| must remain valid throughout |this|.
+ BlimpNavigationControllerImpl(BlimpNavigationControllerDelegate* delegate,
+ NavigationFeature* feature);
~BlimpNavigationControllerImpl() override;
+ // For testing only.
+ void SetNavigationFeatureForTesting(NavigationFeature* feature);
+
// 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;
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 +59,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);
};

Powered by Google App Engine
This is Rietveld 408576698