| OLD | NEW |
| (Empty) |
| 1 // Copyright (c) 2006-2008 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. | |
| 4 | |
| 5 #ifndef CHROME_COMMON_NAVIGATION_TYPES_H_ | |
| 6 #define CHROME_COMMON_NAVIGATION_TYPES_H_ | |
| 7 #pragma once | |
| 8 | |
| 9 #include "base/basictypes.h" | |
| 10 | |
| 11 // Indicates different types of navigations that can occur that we will handle | |
| 12 // separately. | |
| 13 class NavigationType { | |
| 14 public: | |
| 15 enum Type { | |
| 16 // Unknown type. | |
| 17 UNKNOWN, | |
| 18 | |
| 19 // A new page was navigated in the main frame. | |
| 20 NEW_PAGE, | |
| 21 | |
| 22 // Renavigating to an existing navigation entry. The entry is guaranteed to | |
| 23 // exist in the list, or else it would be a new page or IGNORE navigation. | |
| 24 EXISTING_PAGE, | |
| 25 | |
| 26 // The same page has been reloaded as a result of the user requesting | |
| 27 // navigation to that same page (like pressing Enter in the URL bar). This | |
| 28 // is not the same as an in-page navigation because we'll actually have a | |
| 29 // pending entry for the load, which is then meaningless. | |
| 30 SAME_PAGE, | |
| 31 | |
| 32 // In page navigations are when the reference fragment changes. This will | |
| 33 // be in the main frame only (we won't even get notified of in-page | |
| 34 // subframe navigations). It may be for any page, not necessarily the last | |
| 35 // committed one (for example, whey going back to a page with a ref). | |
| 36 IN_PAGE, | |
| 37 | |
| 38 // A new subframe was manually navigated by the user. We will create a new | |
| 39 // NavigationEntry so they can go back to the previous subframe content | |
| 40 // using the back button. | |
| 41 NEW_SUBFRAME, | |
| 42 | |
| 43 // A subframe in the page was automatically loaded or navigated to such that | |
| 44 // a new navigation entry should not be created. There are two cases: | |
| 45 // 1. Stuff like iframes containing ads that the page loads automatically. | |
| 46 // The user doesn't want to see these, so we just update the existing | |
| 47 // navigation entry. | |
| 48 // 2. Going back/forward to previous subframe navigations. We don't create | |
| 49 // a new entry here either, just update the last committed entry. | |
| 50 // These two cases are actually pretty different, they just happen to | |
| 51 // require almost the same code to handle. | |
| 52 AUTO_SUBFRAME, | |
| 53 | |
| 54 // Nothing happened. This happens when we get information about a page we | |
| 55 // don't know anything about. It can also happen when an iframe in a popup | |
| 56 // navigated to about:blank is navigated. Nothing needs to be done. | |
| 57 NAV_IGNORE, | |
| 58 }; | |
| 59 | |
| 60 private: | |
| 61 // This class is for scoping only, so you shouldn't create an instance of it. | |
| 62 NavigationType() {} | |
| 63 | |
| 64 DISALLOW_COPY_AND_ASSIGN(NavigationType); | |
| 65 }; | |
| 66 | |
| 67 #endif // CHROME_COMMON_NAVIGATION_TYPES_H_ | |
| OLD | NEW |