Roll src/third_party/WebKit eac3800:0237a66 (svn 202606:202607)
[chromium-blink-merge.git] / content / public / browser / navigation_handle.h
blobc60babaa9939a4f0861eb1c0f2b7d9d7597c755f
1 // Copyright 2015 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_
8 #include "content/common/content_export.h"
9 #include "net/base/net_errors.h"
11 class GURL;
13 namespace content {
15 // A NavigationHandle tracks information related to a single navigation.
16 class CONTENT_EXPORT NavigationHandle {
17 public:
18 virtual ~NavigationHandle() {}
20 // The URL the frame is navigating to. This may change during the navigation
21 // when encountering a server redirect.
22 virtual const GURL& GetURL() const = 0;
24 // The net error code if an error happened prior to commit. Otherwise it will
25 // be net::OK.
26 virtual net::Error GetNetErrorCode() const = 0;
28 // Whether the navigation is taking place in the main frame or in a subframe.
29 virtual bool IsInMainFrame() const = 0;
31 // Whether the navigation happened in the same page. This is only known
32 // after the navigation has committed. It is an error to call this method
33 // before the navigation has committed.
34 virtual bool IsSamePage() = 0;
36 // Whether the navigation has successfully committed a document.
37 virtual bool HasCommittedDocument() const = 0;
39 // Whether an error page has committed for the navigation.
40 virtual bool HasCommittedErrorPage() const = 0;
43 } // namespace content
45 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_HANDLE_H_