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 #include "content/browser/frame_host/navigation_entry_impl.h" | 5 #include "content/browser/frame_host/navigation_entry_impl.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/strings/utf_string_conversions.h" | 9 #include "base/strings/utf_string_conversions.h" |
10 #include "content/public/common/content_constants.h" | 10 #include "content/public/common/content_constants.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 return static_cast<NavigationEntryImpl*>(entry); | 36 return static_cast<NavigationEntryImpl*>(entry); |
37 } | 37 } |
38 | 38 |
39 NavigationEntryImpl::NavigationEntryImpl() | 39 NavigationEntryImpl::NavigationEntryImpl() |
40 : unique_id_(GetUniqueIDInConstructor()), | 40 : unique_id_(GetUniqueIDInConstructor()), |
41 site_instance_(NULL), | 41 site_instance_(NULL), |
42 bindings_(kInvalidBindings), | 42 bindings_(kInvalidBindings), |
43 page_type_(PAGE_TYPE_NORMAL), | 43 page_type_(PAGE_TYPE_NORMAL), |
44 update_virtual_url_with_url_(false), | 44 update_virtual_url_with_url_(false), |
45 page_id_(-1), | 45 page_id_(-1), |
46 transition_type_(PAGE_TRANSITION_LINK), | 46 transition_type_(ui::PAGE_TRANSITION_LINK), |
47 has_post_data_(false), | 47 has_post_data_(false), |
48 post_id_(-1), | 48 post_id_(-1), |
49 restore_type_(RESTORE_NONE), | 49 restore_type_(RESTORE_NONE), |
50 is_overriding_user_agent_(false), | 50 is_overriding_user_agent_(false), |
51 http_status_code_(0), | 51 http_status_code_(0), |
52 is_renderer_initiated_(false), | 52 is_renderer_initiated_(false), |
53 should_replace_entry_(false), | 53 should_replace_entry_(false), |
54 should_clear_history_list_(false), | 54 should_clear_history_list_(false), |
55 can_load_local_resources_(false), | 55 can_load_local_resources_(false), |
56 frame_tree_node_id_(-1) { | 56 frame_tree_node_id_(-1) { |
57 } | 57 } |
58 | 58 |
59 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, | 59 NavigationEntryImpl::NavigationEntryImpl(SiteInstanceImpl* instance, |
60 int page_id, | 60 int page_id, |
61 const GURL& url, | 61 const GURL& url, |
62 const Referrer& referrer, | 62 const Referrer& referrer, |
63 const base::string16& title, | 63 const base::string16& title, |
64 PageTransition transition_type, | 64 ui::PageTransition transition_type, |
65 bool is_renderer_initiated) | 65 bool is_renderer_initiated) |
66 : unique_id_(GetUniqueIDInConstructor()), | 66 : unique_id_(GetUniqueIDInConstructor()), |
67 site_instance_(instance), | 67 site_instance_(instance), |
68 bindings_(kInvalidBindings), | 68 bindings_(kInvalidBindings), |
69 page_type_(PAGE_TYPE_NORMAL), | 69 page_type_(PAGE_TYPE_NORMAL), |
70 url_(url), | 70 url_(url), |
71 referrer_(referrer), | 71 referrer_(referrer), |
72 update_virtual_url_with_url_(false), | 72 update_virtual_url_with_url_(false), |
73 title_(title), | 73 title_(title), |
74 page_id_(page_id), | 74 page_id_(page_id), |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
195 | 195 |
196 gfx::ElideString(title, kMaxTitleChars, &cached_display_title_); | 196 gfx::ElideString(title, kMaxTitleChars, &cached_display_title_); |
197 return cached_display_title_; | 197 return cached_display_title_; |
198 } | 198 } |
199 | 199 |
200 bool NavigationEntryImpl::IsViewSourceMode() const { | 200 bool NavigationEntryImpl::IsViewSourceMode() const { |
201 return virtual_url_.SchemeIs(kViewSourceScheme); | 201 return virtual_url_.SchemeIs(kViewSourceScheme); |
202 } | 202 } |
203 | 203 |
204 void NavigationEntryImpl::SetTransitionType( | 204 void NavigationEntryImpl::SetTransitionType( |
205 PageTransition transition_type) { | 205 ui::PageTransition transition_type) { |
206 transition_type_ = transition_type; | 206 transition_type_ = transition_type; |
207 } | 207 } |
208 | 208 |
209 PageTransition NavigationEntryImpl::GetTransitionType() const { | 209 ui::PageTransition NavigationEntryImpl::GetTransitionType() const { |
210 return transition_type_; | 210 return transition_type_; |
211 } | 211 } |
212 | 212 |
213 const GURL& NavigationEntryImpl::GetUserTypedURL() const { | 213 const GURL& NavigationEntryImpl::GetUserTypedURL() const { |
214 return user_typed_url_; | 214 return user_typed_url_; |
215 } | 215 } |
216 | 216 |
217 void NavigationEntryImpl::SetHasPostData(bool has_post_data) { | 217 void NavigationEntryImpl::SetHasPostData(bool has_post_data) { |
218 has_post_data_ = has_post_data; | 218 has_post_data_ = has_post_data; |
219 } | 219 } |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
350 } | 350 } |
351 | 351 |
352 void NavigationEntryImpl::SetScreenshotPNGData( | 352 void NavigationEntryImpl::SetScreenshotPNGData( |
353 scoped_refptr<base::RefCountedBytes> png_data) { | 353 scoped_refptr<base::RefCountedBytes> png_data) { |
354 screenshot_ = png_data; | 354 screenshot_ = png_data; |
355 if (screenshot_.get()) | 355 if (screenshot_.get()) |
356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); | 356 UMA_HISTOGRAM_MEMORY_KB("Overscroll.ScreenshotSize", screenshot_->size()); |
357 } | 357 } |
358 | 358 |
359 } // namespace content | 359 } // namespace content |
OLD | NEW |