Index: content/public/browser/navigation_types.h |
diff --git a/content/public/browser/navigation_type.h b/content/public/browser/navigation_types.h |
similarity index 60% |
rename from content/public/browser/navigation_type.h |
rename to content/public/browser/navigation_types.h |
index 242101b1fa1b50c957846f60eae73d7cb6af556d..74f40b311d4c84e57cb3940967bb1e73ea998664 100644 |
--- a/content/public/browser/navigation_type.h |
+++ b/content/public/browser/navigation_types.h |
@@ -1,39 +1,39 @@ |
-// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Copyright 2016 The Chromium Authors. All rights reserved. |
// Use of this source code is governed by a BSD-style license that can be |
// found in the LICENSE file. |
-#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPE_H_ |
-#define CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPE_H_ |
+#ifndef CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPES_H_ |
+#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.
|
namespace content { |
// Indicates different types of navigations that can occur that we will handle |
// separately. |
-enum NavigationType { |
+enum class NavigationType { |
// Unknown type. |
- NAVIGATION_TYPE_UNKNOWN, |
+ UNKNOWN, |
// A new page was navigated to in the main frame. This covers all cases where |
// the main frame navigated and a new navigation entry was created. This means |
// cases like navigations to a hash on the same page are NEW_PAGE, not |
// IN_PAGE. (Navigation entries created by subframe navigations are |
// NEW_SUBFRAME.) |
- NAVIGATION_TYPE_NEW_PAGE, |
+ NEW_PAGE, |
// Renavigating to an existing navigation entry. This is the case for history |
// navigation, reloads, and location.replace(). |
- NAVIGATION_TYPE_EXISTING_PAGE, |
+ EXISTING_PAGE, |
// The same page has been reloaded as a result of the user requesting |
// navigation to that same page (like pressing Enter in the URL bar). This |
// is not the same as an in-page navigation because we'll actually have a |
// pending entry for the load, which is then meaningless. |
- NAVIGATION_TYPE_SAME_PAGE, |
+ SAME_PAGE, |
// A new subframe was manually navigated by the user. We will create a new |
// NavigationEntry so they can go back to the previous subframe content |
// using the back button. |
- NAVIGATION_TYPE_NEW_SUBFRAME, |
+ NEW_SUBFRAME, |
// A subframe in the page was automatically loaded or navigated to such that |
// a new navigation entry should not be created. There are two cases: |
@@ -44,14 +44,40 @@ enum NavigationType { |
// a new entry here either, just update the last committed entry. |
// These two cases are actually pretty different, they just happen to |
// require almost the same code to handle. |
- NAVIGATION_TYPE_AUTO_SUBFRAME, |
+ AUTO_SUBFRAME, |
// Nothing happened. This happens when we get information about a page we |
// don't know anything about. It can also happen when an iframe in a popup |
// navigated to about:blank is navigated. Nothing needs to be done. |
- NAVIGATION_TYPE_NAV_IGNORE, |
+ NAV_IGNORE, |
+}; |
+ |
+// Enumerations of the possible restore types. |
+enum class RestoreType { |
+ // Restore from the previous session. |
+ LAST_SESSION_EXITED_CLEANLY, |
+ LAST_SESSION_CRASHED, |
+ |
+ // The entry has been restored from the current session. This is used when |
+ // the user issues 'reopen closed tab'. |
+ CURRENT_SESSION, |
+ |
+ // The entry was not restored. |
+ NONE |
+}; |
+ |
+// Note: NO_RELOAD is used in general, but behaviors depend on context. |
+// If it is used for tab restore, or history navigation, it loads preferring |
+// cache (which may be stale). |
+enum class ReloadType { |
+ NONE, // Normal load, restore, or history navigation. |
+ NORMAL, // Normal (cache-validating) reload. |
+ MAIN_RESOURCE, // Reload validating only the main resource. |
+ BYPASSING_CACHE, // Reload bypassing the cache (shift-reload). |
+ ORIGINAL_REQUEST_URL, // Reload using the original request URL. |
+ DISABLE_LOFI_MODE // Reload with Lo-Fi mode disabled. |
}; |
} // namespace content |
-#endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPE_H_ |
+#endif // CONTENT_PUBLIC_BROWSER_NAVIGATION_TYPES_H_ |