Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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_TYPE_H_ | 5 #ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPES_H_ |
| 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPE_H_ | 6 #define CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPES_H_ |
|
Charlie Reis
2016/08/11 23:58:43
We shouldn't combine these into the same file. Fr
Takashi Toyoshima
2016/09/07 12:07:44
Acknowledged.
RestoreType is already used in publ
Charlie Reis
2016/09/09 05:41:05
Thanks, that counts.
| |
| 7 | 7 |
| 8 namespace content { | 8 namespace content { |
| 9 | 9 |
| 10 // Indicates different types of navigations that can occur that we will handle | 10 // Indicates different types of navigations that can occur that we will handle |
| 11 // separately. | 11 // separately. |
| 12 enum NavigationType { | 12 enum class NavigationType { |
| 13 // Unknown type. | 13 // Unknown type. |
| 14 NAVIGATION_TYPE_UNKNOWN, | 14 UNKNOWN, |
| 15 | 15 |
| 16 // A new page was navigated to in the main frame. This covers all cases where | 16 // A new page was navigated to in the main frame. This covers all cases where |
| 17 // the main frame navigated and a new navigation entry was created. This means | 17 // the main frame navigated and a new navigation entry was created. This means |
| 18 // cases like navigations to a hash on the same page are NEW_PAGE, not | 18 // cases like navigations to a hash on the same page are NEW_PAGE, not |
| 19 // IN_PAGE. (Navigation entries created by subframe navigations are | 19 // IN_PAGE. (Navigation entries created by subframe navigations are |
| 20 // NEW_SUBFRAME.) | 20 // NEW_SUBFRAME.) |
| 21 NAVIGATION_TYPE_NEW_PAGE, | 21 NEW_PAGE, |
| 22 | 22 |
| 23 // Renavigating to an existing navigation entry. This is the case for history | 23 // Renavigating to an existing navigation entry. This is the case for history |
| 24 // navigation, reloads, and location.replace(). | 24 // navigation, reloads, and location.replace(). |
| 25 NAVIGATION_TYPE_EXISTING_PAGE, | 25 EXISTING_PAGE, |
| 26 | 26 |
| 27 // The same page has been reloaded as a result of the user requesting | 27 // The same page has been reloaded as a result of the user requesting |
| 28 // navigation to that same page (like pressing Enter in the URL bar). This | 28 // navigation to that same page (like pressing Enter in the URL bar). This |
| 29 // is not the same as an in-page navigation because we'll actually have a | 29 // is not the same as an in-page navigation because we'll actually have a |
| 30 // pending entry for the load, which is then meaningless. | 30 // pending entry for the load, which is then meaningless. |
| 31 NAVIGATION_TYPE_SAME_PAGE, | 31 SAME_PAGE, |
| 32 | 32 |
| 33 // A new subframe was manually navigated by the user. We will create a new | 33 // A new subframe was manually navigated by the user. We will create a new |
| 34 // NavigationEntry so they can go back to the previous subframe content | 34 // NavigationEntry so they can go back to the previous subframe content |
| 35 // using the back button. | 35 // using the back button. |
| 36 NAVIGATION_TYPE_NEW_SUBFRAME, | 36 NEW_SUBFRAME, |
| 37 | 37 |
| 38 // A subframe in the page was automatically loaded or navigated to such that | 38 // A subframe in the page was automatically loaded or navigated to such that |
| 39 // a new navigation entry should not be created. There are two cases: | 39 // a new navigation entry should not be created. There are two cases: |
| 40 // 1. Stuff like iframes containing ads that the page loads automatically. | 40 // 1. Stuff like iframes containing ads that the page loads automatically. |
| 41 // The user doesn't want to see these, so we just update the existing | 41 // The user doesn't want to see these, so we just update the existing |
| 42 // navigation entry. | 42 // navigation entry. |
| 43 // 2. Going back/forward to previous subframe navigations. We don't create | 43 // 2. Going back/forward to previous subframe navigations. We don't create |
| 44 // a new entry here either, just update the last committed entry. | 44 // a new entry here either, just update the last committed entry. |
| 45 // These two cases are actually pretty different, they just happen to | 45 // These two cases are actually pretty different, they just happen to |
| 46 // require almost the same code to handle. | 46 // require almost the same code to handle. |
| 47 NAVIGATION_TYPE_AUTO_SUBFRAME, | 47 AUTO_SUBFRAME, |
| 48 | 48 |
| 49 // Nothing happened. This happens when we get information about a page we | 49 // Nothing happened. This happens when we get information about a page we |
| 50 // don't know anything about. It can also happen when an iframe in a popup | 50 // don't know anything about. It can also happen when an iframe in a popup |
| 51 // navigated to about:blank is navigated. Nothing needs to be done. | 51 // navigated to about:blank is navigated. Nothing needs to be done. |
| 52 NAVIGATION_TYPE_NAV_IGNORE, | 52 NAV_IGNORE, |
| 53 }; | |
| 54 | |
| 55 // Enumerations of the possible restore types. | |
| 56 enum class RestoreType { | |
| 57 // Restore from the previous session. | |
| 58 LAST_SESSION_EXITED_CLEANLY, | |
| 59 LAST_SESSION_CRASHED, | |
| 60 | |
| 61 // The entry has been restored from the current session. This is used when | |
| 62 // the user issues 'reopen closed tab'. | |
| 63 CURRENT_SESSION, | |
| 64 | |
| 65 // The entry was not restored. | |
| 66 NONE | |
| 67 }; | |
| 68 | |
| 69 // Note: NO_RELOAD is used in general, but behaviors depend on context. | |
| 70 // If it is used for tab restore, or history navigation, it loads preferring | |
| 71 // cache (which may be stale). | |
| 72 enum class ReloadType { | |
| 73 NONE, // Normal load, restore, or history navigation. | |
| 74 NORMAL, // Normal (cache-validating) reload. | |
| 75 MAIN_RESOURCE, // Reload validating only the main resource. | |
| 76 BYPASSING_CACHE, // Reload bypassing the cache (shift-reload). | |
| 77 ORIGINAL_REQUEST_URL, // Reload using the original request URL. | |
| 78 DISABLE_LOFI_MODE // Reload with Lo-Fi mode disabled. | |
| 53 }; | 79 }; |
| 54 | 80 |
| 55 } // namespace content | 81 } // namespace content |
| 56 | 82 |
| 57 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPE_H_ | 83 #endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPES_H_ |
| OLD | NEW |