OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 5 #ifndef CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 6 #define CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 }; | 179 }; |
180 | 180 |
181 // --------------------------------------------------------------------------- | 181 // --------------------------------------------------------------------------- |
182 | 182 |
183 NavigationEntry(); | 183 NavigationEntry(); |
184 NavigationEntry(SiteInstance* instance, | 184 NavigationEntry(SiteInstance* instance, |
185 int page_id, | 185 int page_id, |
186 const GURL& url, | 186 const GURL& url, |
187 const GURL& referrer, | 187 const GURL& referrer, |
188 const string16& title, | 188 const string16& title, |
189 content::PageTransition transition_type); | 189 content::PageTransition transition_type, |
| 190 bool is_renderer_initiated); |
190 ~NavigationEntry(); | 191 ~NavigationEntry(); |
191 | 192 |
192 // Page-related stuff -------------------------------------------------------- | 193 // Page-related stuff -------------------------------------------------------- |
193 | 194 |
194 // A unique ID is preserved across commits and redirects, which means that | 195 // A unique ID is preserved across commits and redirects, which means that |
195 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when | 196 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when |
196 // creating a committed entry to correspond to a to-be-deleted pending entry, | 197 // creating a committed entry to correspond to a to-be-deleted pending entry, |
197 // the pending entry's ID must be copied). | 198 // the pending entry's ID must be copied). |
198 void set_unique_id(int unique_id) { | 199 void set_unique_id(int unique_id) { |
199 unique_id_ = unique_id; | 200 unique_id_ = unique_id; |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
344 | 345 |
345 // The transition type indicates what the user did to move to this page from | 346 // The transition type indicates what the user did to move to this page from |
346 // the previous page. | 347 // the previous page. |
347 void set_transition_type(content::PageTransition transition_type) { | 348 void set_transition_type(content::PageTransition transition_type) { |
348 transition_type_ = transition_type; | 349 transition_type_ = transition_type; |
349 } | 350 } |
350 content::PageTransition transition_type() const { | 351 content::PageTransition transition_type() const { |
351 return transition_type_; | 352 return transition_type_; |
352 } | 353 } |
353 | 354 |
| 355 // Whether this (pending) navigation is renderer-initiated. Resets to false |
| 356 // for all types of navigations after commit. |
| 357 void set_is_renderer_initiated(bool is_renderer_initiated) { |
| 358 is_renderer_initiated_ = is_renderer_initiated; |
| 359 } |
| 360 bool is_renderer_initiated() const { |
| 361 return is_renderer_initiated_; |
| 362 } |
| 363 |
354 // The user typed URL was the URL that the user initiated the navigation | 364 // The user typed URL was the URL that the user initiated the navigation |
355 // with, regardless of any redirects. This is used to generate keywords, for | 365 // with, regardless of any redirects. This is used to generate keywords, for |
356 // example, based on "what the user thinks the site is called" rather than | 366 // example, based on "what the user thinks the site is called" rather than |
357 // what it's actually called. For example, if the user types "foo.com", that | 367 // what it's actually called. For example, if the user types "foo.com", that |
358 // may redirect somewhere arbitrary like "bar.com/foo", and we want to use | 368 // may redirect somewhere arbitrary like "bar.com/foo", and we want to use |
359 // the name that the user things of the site as having. | 369 // the name that the user things of the site as having. |
360 // | 370 // |
361 // This URL will be is_empty() if the URL was navigated to some other way. | 371 // This URL will be is_empty() if the URL was navigated to some other way. |
362 // Callers should fall back on using the regular or display URL in this case. | 372 // Callers should fall back on using the regular or display URL in this case. |
363 void set_user_typed_url(const GURL& user_typed_url) { | 373 void set_user_typed_url(const GURL& user_typed_url) { |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
423 int32 page_id_; | 433 int32 page_id_; |
424 SSLStatus ssl_; | 434 SSLStatus ssl_; |
425 content::PageTransition transition_type_; | 435 content::PageTransition transition_type_; |
426 GURL user_typed_url_; | 436 GURL user_typed_url_; |
427 bool has_post_data_; | 437 bool has_post_data_; |
428 RestoreType restore_type_; | 438 RestoreType restore_type_; |
429 | 439 |
430 // This member is not persisted with sesssion restore. | 440 // This member is not persisted with sesssion restore. |
431 std::string extra_headers_; | 441 std::string extra_headers_; |
432 | 442 |
| 443 // Whether the entry, while loading, was created for a renderer-initiated |
| 444 // navigation. This dictates whether the URL should be displayed before the |
| 445 // navigation commits. It is cleared on commit and not persisted. |
| 446 bool is_renderer_initiated_; |
| 447 |
433 // This is a cached version of the result of GetTitleForDisplay. It prevents | 448 // This is a cached version of the result of GetTitleForDisplay. It prevents |
434 // us from having to do URL formatting on the URL every time the title is | 449 // us from having to do URL formatting on the URL every time the title is |
435 // displayed. When the URL, virtual URL, or title is set, this should be | 450 // displayed. When the URL, virtual URL, or title is set, this should be |
436 // cleared to force a refresh. | 451 // cleared to force a refresh. |
437 mutable string16 cached_display_title_; | 452 mutable string16 cached_display_title_; |
438 | 453 |
439 // Copy and assignment is explicitly allowed for this class. | 454 // Copy and assignment is explicitly allowed for this class. |
440 }; | 455 }; |
441 | 456 |
442 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ | 457 #endif // CONTENT_BROWSER_TAB_CONTENTS_NAVIGATION_ENTRY_H_ |
OLD | NEW |