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

Side by Side 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 unified diff | Download patch
OLDNEW
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_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_ 5 #ifndef BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_
6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_ 6 #define BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "blimp/client/core/contents/navigation_feature.h"
10 #include "blimp/client/public/contents/blimp_navigation_controller.h" 10 #include "blimp/client/public/contents/blimp_navigation_controller.h"
11 #include "url/gurl.h" 11 #include "url/gurl.h"
12 12
13 class SkBitmap;
14
13 namespace blimp { 15 namespace blimp {
14 namespace client { 16 namespace client {
15 17
16 class BlimpContentsObserver; 18 class BlimpContentsObserver;
17 class BlimpNavigationControllerDelegate; 19 class BlimpNavigationControllerDelegate;
18 20
19 // BlimpContentsImpl is the implementation of the core class in 21 class BlimpNavigationControllerImpl
20 // //blimp/client/core, the BlimpContents. 22 : public BlimpNavigationController,
21 // The BlimpNavigationControllerImpl is the implementation part of 23 public NavigationFeature::NavigationFeatureDelegate {
22 // BlimpNavigationController. It maintains the back-forward list for a
23 // BlimpContentsImpl and manages all navigation within that list.
24 class BlimpNavigationControllerImpl : public BlimpNavigationController {
25 public: 24 public:
26 explicit BlimpNavigationControllerImpl( 25 // The life time of |feature| must remain valid throughout |this|.
27 BlimpNavigationControllerDelegate* delegate); 26 BlimpNavigationControllerImpl(BlimpNavigationControllerDelegate* delegate,
27 NavigationFeature* feature);
28 ~BlimpNavigationControllerImpl() override; 28 ~BlimpNavigationControllerImpl() override;
29 29
30 // For testing only.
31 void SetNavigationFeatureForTesting(NavigationFeature* feature);
32
30 // BlimpNavigationController implementation. 33 // BlimpNavigationController implementation.
31 void LoadURL(const GURL& url) override; 34 void LoadURL(const GURL& url) override;
35 void Reload() override;
36 bool CanGoBack() const override;
37 bool CanGoForward() const override;
38 void GoBack() override;
39 void GoForward() override;
32 const GURL& GetURL() override; 40 const GURL& GetURL() override;
33 41
34 private: 42 private:
35 void NotifyDelegateURLLoaded(const GURL& url); 43 // NavigationFeatureDelegate implementation.
44 void OnUrlChanged(int tab_id, const GURL& url) override;
45 void OnFaviconChanged(int tab_id, const SkBitmap& favicon) override;
46 void OnTitleChanged(int tab_id, const std::string& title) override;
47 void OnLoadingChanged(int tab_id, bool loading) override;
48 void OnPageLoadStatusUpdate(int tab_id, bool completed) override;
49
50 // The |navigation_feature_| is responsible for sending and receiving the
51 // navigation state to the server over the proto channel.
52 NavigationFeature* navigation_feature_;
36 53
37 // The delegate contains functionality required for the navigation controller 54 // The delegate contains functionality required for the navigation controller
38 // to function correctly. It is also invoked on relevant state changes of the 55 // to function correctly. It is also invoked on relevant state changes of the
39 // navigation controller. 56 // navigation controller.
40 BlimpNavigationControllerDelegate* delegate_; 57 BlimpNavigationControllerDelegate* delegate_;
41 58
42 // The currently active URL. 59 // The currently active URL.
43 GURL current_url_; 60 GURL current_url_;
44 61
45 // TODO(shaktisahu): Remove this after integration with NavigationFeature.
46 base::WeakPtrFactory<BlimpNavigationControllerImpl> weak_ptr_factory_;
47
48 DISALLOW_COPY_AND_ASSIGN(BlimpNavigationControllerImpl); 62 DISALLOW_COPY_AND_ASSIGN(BlimpNavigationControllerImpl);
49 }; 63 };
50 64
51 } // namespace client 65 } // namespace client
52 } // namespace blimp 66 } // namespace blimp
53 67
54 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_ 68 #endif // BLIMP_CLIENT_CORE_CONTENTS_BLIMP_NAVIGATION_CONTROLLER_IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698