Add ICU message format support
[chromium-blink-merge.git] / ios / web / public / navigation_manager.h
blob27c1c40fbb847177ea9f04a6ad614d94a1c6d806
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
3 // found in the LICENSE file.
5 #ifndef IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_
6 #define IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_
8 #include "ios/web/public/browser_url_rewriter.h"
10 namespace web {
12 class BrowserState;
13 class NavigationItem;
14 class WebState;
16 // A NavigationManager maintains the back-forward list for a WebState and
17 // manages all navigation within that list.
19 // Each NavigationManager belongs to one WebState; each WebState has
20 // exactly one NavigationManager.
21 class NavigationManager {
22 public:
23 virtual ~NavigationManager() {}
25 // Gets the BrowserState associated with this NavigationManager. Can never
26 // return null.
27 virtual BrowserState* GetBrowserState() const = 0;
29 // Gets the WebState associated with this NavigationManager.
30 virtual WebState* GetWebState() const = 0;
32 // Returns the NavigationItem that should be used when displaying info about
33 // the current entry to the user. It ignores certain pending entries, to
34 // prevent spoofing attacks using slow-loading navigations.
35 virtual NavigationItem* GetVisibleItem() const = 0;
37 // Returns the last committed NavigationItem, which may be null if there
38 // are no committed entries.
39 virtual NavigationItem* GetLastCommittedItem() const = 0;
41 // Returns the pending entry corresponding to the navigation that is
42 // currently in progress, or null if there is none.
43 virtual NavigationItem* GetPendingItem() const = 0;
45 // Adds |rewriter| to a transient list of URL rewriters. Transient URL
46 // rewriters will be executed before the rewriters already added to the
47 // BrowserURLRewriter singleton, and the list will be cleared after the next
48 // attempted page load. |rewriter| must not be null.
49 virtual void AddTransientURLRewriter(
50 BrowserURLRewriter::URLRewriter rewriter) = 0;
53 } // namespace web
55 #endif // IOS_WEB_PUBLIC_NAVIGATION_MANAGER_H_