OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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 CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ |
6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include "content/common/content_export.h" | 9 #include "content/common/content_export.h" |
10 #include "content/public/browser/navigation_type.h" | 10 #include "content/public/browser/navigation_type.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 int previous_entry_index; | 36 int previous_entry_index; |
37 | 37 |
38 // The previous main frame URL that the user was on. This may be empty if | 38 // The previous main frame URL that the user was on. This may be empty if |
39 // there was no last committed entry. | 39 // there was no last committed entry. |
40 GURL previous_url; | 40 GURL previous_url; |
41 | 41 |
42 // True if the committed entry has replaced the exisiting one. | 42 // True if the committed entry has replaced the exisiting one. |
43 // A non-user initiated redirect causes such replacement. | 43 // A non-user initiated redirect causes such replacement. |
44 bool did_replace_entry; | 44 bool did_replace_entry; |
45 | 45 |
46 // True if the navigation was in-page. This means that the active entry's | 46 // Whether the navigation happened without changing document. Examples of |
47 // URL and the |previous_url| are the same except for reference fragments. | 47 // same document navigations are: |
48 bool is_in_page; | 48 // * reference fragment navigations |
| 49 // * pushState/replaceState |
| 50 // * same page history navigation |
| 51 bool is_same_document; |
49 | 52 |
50 // True when the main frame was navigated. False means the navigation was a | 53 // True when the main frame was navigated. False means the navigation was a |
51 // sub-frame. | 54 // sub-frame. |
52 bool is_main_frame; | 55 bool is_main_frame; |
53 | 56 |
54 // Returns whether the main frame navigated to a different page (e.g., not | 57 // Returns whether the main frame navigated to a different page (e.g., not |
55 // scrolling to a fragment inside the current page). We often need this logic | 58 // scrolling to a fragment inside the current page). We often need this logic |
56 // for showing or hiding something. | 59 // for showing or hiding something. |
57 bool is_navigation_to_different_page() const { | 60 bool is_navigation_to_different_page() const { |
58 return is_main_frame && !is_in_page; | 61 return is_main_frame && !is_same_document; |
59 } | 62 } |
60 | 63 |
61 // The HTTP status code for this entry.. | 64 // The HTTP status code for this entry.. |
62 int http_status_code; | 65 int http_status_code; |
63 }; | 66 }; |
64 | 67 |
65 // Provides the details for a NOTIFICATION_NAV_ENTRY_CHANGED notification. | 68 // Provides the details for a NOTIFICATION_NAV_ENTRY_CHANGED notification. |
66 struct EntryChangedDetails { | 69 struct EntryChangedDetails { |
67 // The changed navigation entry after it has been updated. | 70 // The changed navigation entry after it has been updated. |
68 const NavigationEntry* changed_entry; | 71 const NavigationEntry* changed_entry; |
69 | 72 |
70 // Indicates the current index in the back/forward list of the entry. | 73 // Indicates the current index in the back/forward list of the entry. |
71 int index; | 74 int index; |
72 }; | 75 }; |
73 | 76 |
74 // Details sent for NOTIFY_NAV_LIST_PRUNED. | 77 // Details sent for NOTIFY_NAV_LIST_PRUNED. |
75 struct PrunedDetails { | 78 struct PrunedDetails { |
76 // If true, count items were removed from the front of the list, otherwise | 79 // If true, count items were removed from the front of the list, otherwise |
77 // count items were removed from the back of the list. | 80 // count items were removed from the back of the list. |
78 bool from_front; | 81 bool from_front; |
79 | 82 |
80 // Number of items removed. | 83 // Number of items removed. |
81 int count; | 84 int count; |
82 }; | 85 }; |
83 | 86 |
84 } // namespace content | 87 } // namespace content |
85 | 88 |
86 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ | 89 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_DETAILS_H_ |
OLD | NEW |