OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ | 5 #ifndef CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ |
6 #define CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ | 6 #define CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
50 // Returns whether the underlying contents is stale (i.e. was loaded too long | 50 // Returns whether the underlying contents is stale (i.e. was loaded too long |
51 // ago). | 51 // ago). |
52 bool is_stale() const { return is_stale_; } | 52 bool is_stale() const { return is_stale_; } |
53 | 53 |
54 // Returns true if the mouse or a touch pointer is down due to activating the | 54 // Returns true if the mouse or a touch pointer is down due to activating the |
55 // preview contents. | 55 // preview contents. |
56 bool is_pointer_down_from_activate() const { | 56 bool is_pointer_down_from_activate() const { |
57 return is_pointer_down_from_activate_; | 57 return is_pointer_down_from_activate_; |
58 } | 58 } |
59 | 59 |
| 60 // Returns the initial navigation entry for the most recently loaded URL. |
| 61 const content::NavigationEntry* base_navigation_entry() { |
| 62 return loader_.base_navigation_entry(); |
| 63 } |
| 64 |
60 // Returns info about the last navigation by the Instant page. If the page | 65 // Returns info about the last navigation by the Instant page. If the page |
61 // hasn't navigated since the last Update(), the URL is empty. | 66 // hasn't navigated since the last Update(), the URL is empty. |
62 const history::HistoryAddPageArgs& last_navigation() const { | 67 const history::HistoryAddPageArgs& last_navigation() const { |
63 return last_navigation_; | 68 return last_navigation_; |
64 } | 69 } |
65 | 70 |
66 // Called by the history tab helper with information that it would have added | 71 // Called by the history tab helper with information that it would have added |
67 // to the history service had this WebContents not been used for Instant. | 72 // to the history service had this WebContents not been used for Instant. |
68 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); | 73 void DidNavigate(const history::HistoryAddPageArgs& add_page_args); |
69 | 74 |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 InstantLoader loader_; | 113 InstantLoader loader_; |
109 const std::string instant_url_; | 114 const std::string instant_url_; |
110 bool is_stale_; | 115 bool is_stale_; |
111 bool is_pointer_down_from_activate_; | 116 bool is_pointer_down_from_activate_; |
112 history::HistoryAddPageArgs last_navigation_; | 117 history::HistoryAddPageArgs last_navigation_; |
113 | 118 |
114 DISALLOW_COPY_AND_ASSIGN(InstantOverlay); | 119 DISALLOW_COPY_AND_ASSIGN(InstantOverlay); |
115 }; | 120 }; |
116 | 121 |
117 #endif // CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ | 122 #endif // CHROME_BROWSER_INSTANT_INSTANT_OVERLAY_H_ |
OLD | NEW |