| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ | 5 #ifndef IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ |
| 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ | 6 #define IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 66 // TODO(stuartmorgan): Make these private once the logic triggering them moves | 66 // TODO(stuartmorgan): Make these private once the logic triggering them moves |
| 67 // into this layer. | 67 // into this layer. |
| 68 void OnNavigationItemChanged(); | 68 void OnNavigationItemChanged(); |
| 69 void OnNavigationItemCommitted(); | 69 void OnNavigationItemCommitted(); |
| 70 | 70 |
| 71 // Returns the transient item if any. This is an item which is removed and | 71 // Returns the transient item if any. This is an item which is removed and |
| 72 // discarded if any navigation occurs. Note that the returned item is owned | 72 // discarded if any navigation occurs. Note that the returned item is owned |
| 73 // by the navigation manager and may be deleted at any time. | 73 // by the navigation manager and may be deleted at any time. |
| 74 NavigationItem* GetTransientItem() const; | 74 NavigationItem* GetTransientItem() const; |
| 75 | 75 |
| 76 // Returns the committed NavigationItem at |index|. | |
| 77 NavigationItem* GetItemAtIndex(size_t index) const; | |
| 78 | |
| 79 // Temporary accessors and content/ class pass-throughs. | 76 // Temporary accessors and content/ class pass-throughs. |
| 80 // TODO(stuartmorgan): Re-evaluate this list once the refactorings have | 77 // TODO(stuartmorgan): Re-evaluate this list once the refactorings have |
| 81 // settled down. | 78 // settled down. |
| 82 CRWSessionController* GetSessionController(); | 79 CRWSessionController* GetSessionController(); |
| 83 int GetCurrentEntryIndex() const; | |
| 84 int GetLastCommittedEntryIndex() const; | 80 int GetLastCommittedEntryIndex() const; |
| 85 int GetEntryCount() const; | |
| 86 bool RemoveEntryAtIndex(int index); | 81 bool RemoveEntryAtIndex(int index); |
| 87 int GetPendingEntryIndex() const; | 82 int GetPendingEntryIndex() const; |
| 88 void LoadURL(const GURL& url, | 83 void LoadURL(const GURL& url, |
| 89 const Referrer& referrer, | 84 const Referrer& referrer, |
| 90 ui::PageTransition type); | 85 ui::PageTransition type); |
| 91 bool CanGoBack() const; | 86 bool CanGoBack() const; |
| 92 bool CanGoForward() const; | 87 bool CanGoForward() const; |
| 93 void GoBack(); | 88 void GoBack(); |
| 94 void GoForward(); | 89 void GoForward(); |
| 95 | 90 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 108 | 103 |
| 109 // NavigationManager: | 104 // NavigationManager: |
| 110 BrowserState* GetBrowserState() const override; | 105 BrowserState* GetBrowserState() const override; |
| 111 WebState* GetWebState() const override; | 106 WebState* GetWebState() const override; |
| 112 NavigationItem* GetVisibleItem() const override; | 107 NavigationItem* GetVisibleItem() const override; |
| 113 NavigationItem* GetLastCommittedItem() const override; | 108 NavigationItem* GetLastCommittedItem() const override; |
| 114 NavigationItem* GetPendingItem() const override; | 109 NavigationItem* GetPendingItem() const override; |
| 115 void DiscardNonCommittedItems() override; | 110 void DiscardNonCommittedItems() override; |
| 116 void AddTransientURLRewriter( | 111 void AddTransientURLRewriter( |
| 117 BrowserURLRewriter::URLRewriter rewriter) override; | 112 BrowserURLRewriter::URLRewriter rewriter) override; |
| 113 int GetEntryCount() const override; |
| 114 NavigationItem* GetItemAtIndex(size_t index) const override; |
| 115 int GetCurrentEntryIndex() const override; |
| 118 | 116 |
| 119 // Returns the current list of transient url rewriters, passing ownership to | 117 // Returns the current list of transient url rewriters, passing ownership to |
| 120 // the caller. | 118 // the caller. |
| 121 // TODO(kkhorimoto): remove once NavigationItem creation occurs in this class. | 119 // TODO(kkhorimoto): remove once NavigationItem creation occurs in this class. |
| 122 scoped_ptr<std::vector<BrowserURLRewriter::URLRewriter>> | 120 scoped_ptr<std::vector<BrowserURLRewriter::URLRewriter>> |
| 123 GetTransientURLRewriters(); | 121 GetTransientURLRewriters(); |
| 124 | 122 |
| 125 // Called to reset the transient url rewriter list. | 123 // Called to reset the transient url rewriter list. |
| 126 void RemoveTransientURLRewriters(); | 124 void RemoveTransientURLRewriters(); |
| 127 | 125 |
| (...skipping 19 matching lines...) Expand all Loading... |
| 147 // List of transient url rewriters added by |AddTransientURLRewriter()|. | 145 // List of transient url rewriters added by |AddTransientURLRewriter()|. |
| 148 scoped_ptr<std::vector<BrowserURLRewriter::URLRewriter>> | 146 scoped_ptr<std::vector<BrowserURLRewriter::URLRewriter>> |
| 149 transient_url_rewriters_; | 147 transient_url_rewriters_; |
| 150 | 148 |
| 151 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl); | 149 DISALLOW_COPY_AND_ASSIGN(NavigationManagerImpl); |
| 152 }; | 150 }; |
| 153 | 151 |
| 154 } // namespace web | 152 } // namespace web |
| 155 | 153 |
| 156 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ | 154 #endif // IOS_WEB_NAVIGATION_NAVIGATION_MANAGER_IMPL_H_ |
| OLD | NEW |