OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/web_contents/navigation_entry_impl.h" | 5 #include "content/browser/web_contents/navigation_entry_impl.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/public/common/content_constants.h" | 9 #include "content/public/common/content_constants.h" |
10 #include "content/public/common/url_constants.h" | 10 #include "content/public/common/url_constants.h" |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
272 } | 272 } |
273 | 273 |
274 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { | 274 void NavigationEntryImpl::SetFrameToNavigate(const std::string& frame_name) { |
275 frame_to_navigate_ = frame_name; | 275 frame_to_navigate_ = frame_name; |
276 } | 276 } |
277 | 277 |
278 const std::string& NavigationEntryImpl::GetFrameToNavigate() const { | 278 const std::string& NavigationEntryImpl::GetFrameToNavigate() const { |
279 return frame_to_navigate_; | 279 return frame_to_navigate_; |
280 } | 280 } |
281 | 281 |
| 282 void NavigationEntryImpl::SetExtraData(const std::string& key, |
| 283 const string16& data) { |
| 284 extra_data_[key] = data; |
| 285 } |
| 286 |
| 287 bool NavigationEntryImpl::GetExtraData(const std::string& key, |
| 288 string16* data) const { |
| 289 std::map<std::string, string16>::const_iterator iter = extra_data_.find(key); |
| 290 if (iter == extra_data_.end()) |
| 291 return false; |
| 292 *data = iter->second; |
| 293 return true; |
| 294 } |
| 295 |
| 296 void NavigationEntryImpl::ClearExtraData(const std::string& key) { |
| 297 extra_data_.erase(key); |
| 298 } |
| 299 |
282 void NavigationEntryImpl::SetScreenshotPNGData( | 300 void NavigationEntryImpl::SetScreenshotPNGData( |
283 const std::vector<unsigned char>& png_data) { | 301 const std::vector<unsigned char>& png_data) { |
284 screenshot_ = png_data.empty() ? NULL : new base::RefCountedBytes(png_data); | 302 screenshot_ = png_data.empty() ? NULL : new base::RefCountedBytes(png_data); |
285 } | 303 } |
286 | 304 |
287 } // namespace content | 305 } // namespace content |
OLD | NEW |