| 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 #include "content/browser/tab_contents/navigation_entry.h" | 5 #include "content/browser/tab_contents/navigation_entry.h" |
| 6 | 6 |
| 7 #include "base/string_util.h" | 7 #include "base/string_util.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "content/browser/content_browser_client.h" | 9 #include "content/browser/content_browser_client.h" |
| 10 #include "content/browser/site_instance.h" | 10 #include "content/browser/site_instance.h" |
| (...skipping 24 matching lines...) Expand all Loading... |
| 35 | 35 |
| 36 | 36 |
| 37 NavigationEntry::NavigationEntry() | 37 NavigationEntry::NavigationEntry() |
| 38 : unique_id_(GetUniqueID()), | 38 : unique_id_(GetUniqueID()), |
| 39 site_instance_(NULL), | 39 site_instance_(NULL), |
| 40 page_type_(NORMAL_PAGE), | 40 page_type_(NORMAL_PAGE), |
| 41 update_virtual_url_with_url_(false), | 41 update_virtual_url_with_url_(false), |
| 42 page_id_(-1), | 42 page_id_(-1), |
| 43 transition_type_(content::PAGE_TRANSITION_LINK), | 43 transition_type_(content::PAGE_TRANSITION_LINK), |
| 44 has_post_data_(false), | 44 has_post_data_(false), |
| 45 restore_type_(RESTORE_NONE) { | 45 restore_type_(RESTORE_NONE), |
| 46 is_renderer_initiated_(false) { |
| 46 } | 47 } |
| 47 | 48 |
| 48 NavigationEntry::NavigationEntry(SiteInstance* instance, | 49 NavigationEntry::NavigationEntry(SiteInstance* instance, |
| 49 int page_id, | 50 int page_id, |
| 50 const GURL& url, | 51 const GURL& url, |
| 51 const GURL& referrer, | 52 const GURL& referrer, |
| 52 const string16& title, | 53 const string16& title, |
| 53 content::PageTransition transition_type) | 54 content::PageTransition transition_type, |
| 55 bool is_renderer_initiated) |
| 54 : unique_id_(GetUniqueID()), | 56 : unique_id_(GetUniqueID()), |
| 55 site_instance_(instance), | 57 site_instance_(instance), |
| 56 page_type_(NORMAL_PAGE), | 58 page_type_(NORMAL_PAGE), |
| 57 url_(url), | 59 url_(url), |
| 58 referrer_(referrer), | 60 referrer_(referrer), |
| 59 update_virtual_url_with_url_(false), | 61 update_virtual_url_with_url_(false), |
| 60 title_(title), | 62 title_(title), |
| 61 page_id_(page_id), | 63 page_id_(page_id), |
| 62 transition_type_(transition_type), | 64 transition_type_(transition_type), |
| 63 has_post_data_(false), | 65 has_post_data_(false), |
| 64 restore_type_(RESTORE_NONE) { | 66 restore_type_(RESTORE_NONE), |
| 67 is_renderer_initiated_(is_renderer_initiated) { |
| 65 } | 68 } |
| 66 | 69 |
| 67 NavigationEntry::~NavigationEntry() { | 70 NavigationEntry::~NavigationEntry() { |
| 68 } | 71 } |
| 69 | 72 |
| 70 void NavigationEntry::set_site_instance(SiteInstance* site_instance) { | 73 void NavigationEntry::set_site_instance(SiteInstance* site_instance) { |
| 71 site_instance_ = site_instance; | 74 site_instance_ = site_instance; |
| 72 } | 75 } |
| 73 | 76 |
| 74 const string16& NavigationEntry::GetTitleForDisplay( | 77 const string16& NavigationEntry::GetTitleForDisplay( |
| (...skipping 23 matching lines...) Expand all Loading... |
| 98 title = title.substr(slashpos + 1); | 101 title = title.substr(slashpos + 1); |
| 99 } | 102 } |
| 100 | 103 |
| 101 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_); | 104 ui::ElideString(title, content::kMaxTitleChars, &cached_display_title_); |
| 102 return cached_display_title_; | 105 return cached_display_title_; |
| 103 } | 106 } |
| 104 | 107 |
| 105 bool NavigationEntry::IsViewSourceMode() const { | 108 bool NavigationEntry::IsViewSourceMode() const { |
| 106 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); | 109 return virtual_url_.SchemeIs(chrome::kViewSourceScheme); |
| 107 } | 110 } |
| OLD | NEW |