1 // Copyright (c) 2012 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_DETAILS_H_
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_
9 #include "content/common/content_export.h"
10 #include "content/public/browser/navigation_type.h"
15 class NavigationEntry
;
17 // Provides the details for a NOTIFICATION_NAV_ENTRY_COMMITTED notification.
18 // TODO(brettw) this mostly duplicates ProvisionalLoadDetails, it would be
19 // nice to unify these somehow.
20 struct CONTENT_EXPORT LoadCommittedDetails
{
21 // By default, the entry will be filled according to a new main frame
23 LoadCommittedDetails();
25 // The committed entry. This will be the active entry in the controller.
26 NavigationEntry
* entry
;
28 // The type of navigation that just occurred. Note that not all types of
29 // navigations in the enum are valid here, since some of them don't actually
30 // cause a "commit" and won't generate this notification.
31 content::NavigationType type
;
33 // The index of the previously committed navigation entry. This will be -1
34 // if there are no previous entries.
35 int previous_entry_index
;
37 // The previous URL that the user was on. This may be empty if none.
40 // True if the committed entry has replaced the exisiting one.
41 // A non-user initiated redirect causes such replacement.
42 bool did_replace_entry
;
44 // True if the navigation was in-page. This means that the active entry's
45 // URL and the |previous_url| are the same except for reference fragments.
48 // True when the main frame was navigated. False means the navigation was a
52 // When the committed load is a web page from the renderer, this string
53 // specifies the security state if the page is secure.
54 // See FrameHostMsg_DidCommitProvisionalLoad_Params.security_info, where it
55 // comes from. Use SSLManager::DeserializeSecurityInfo to decode it.
56 std::string serialized_security_info
;
58 // Returns whether the main frame navigated to a different page (e.g., not
59 // scrolling to a fragment inside the current page). We often need this logic
60 // for showing or hiding something.
61 bool is_navigation_to_different_page() const {
62 return is_main_frame
&& !is_in_page
;
65 // The HTTP status code for this entry..
69 // Provides the details for a NOTIFICATION_NAV_ENTRY_CHANGED notification.
70 struct EntryChangedDetails
{
71 // The changed navigation entry after it has been updated.
72 const NavigationEntry
* changed_entry
;
74 // Indicates the current index in the back/forward list of the entry.
78 // Details sent for NOTIFY_NAV_LIST_PRUNED.
79 struct PrunedDetails
{
80 // If true, count items were removed from the front of the list, otherwise
81 // count items were removed from the back of the list.
84 // Number of items removed.
88 } // namespace content
90 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_