Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(98)

Side by Side Diff: chrome/browser/navigation_entry.h

Issue 8186: Plumb the referrer throughout the OpenURL APIs.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 12 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/navigation_controller_unittest.cc ('k') | chrome/browser/navigation_entry.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_NAVIGATION_ENTRY_H_ 5 #ifndef CHROME_BROWSER_NAVIGATION_ENTRY_H_
6 #define CHROME_BROWSER_NAVIGATION_ENTRY_H_ 6 #define CHROME_BROWSER_NAVIGATION_ENTRY_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/scoped_ptr.h" 9 #include "base/scoped_ptr.h"
10 #include "chrome/app/theme/theme_resources.h" 10 #include "chrome/app/theme/theme_resources.h"
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after
160 // Copy and assignment is explicitly allowed for this class. 160 // Copy and assignment is explicitly allowed for this class.
161 }; 161 };
162 162
163 // --------------------------------------------------------------------------- 163 // ---------------------------------------------------------------------------
164 164
165 explicit NavigationEntry(TabContentsType type); 165 explicit NavigationEntry(TabContentsType type);
166 NavigationEntry(TabContentsType type, 166 NavigationEntry(TabContentsType type,
167 SiteInstance* instance, 167 SiteInstance* instance,
168 int page_id, 168 int page_id,
169 const GURL& url, 169 const GURL& url,
170 const GURL& referrer,
170 const std::wstring& title, 171 const std::wstring& title,
171 PageTransition::Type transition_type); 172 PageTransition::Type transition_type);
172 ~NavigationEntry() { 173 ~NavigationEntry() {
173 } 174 }
174 175
175 // Page-related stuff -------------------------------------------------------- 176 // Page-related stuff --------------------------------------------------------
176 177
177 // A unique ID is preserved across commits and redirects, which means that 178 // A unique ID is preserved across commits and redirects, which means that
178 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when 179 // sometimes a NavigationEntry's unique ID needs to be set (e.g. when
179 // creating a committed entry to correspond to a to-be-deleted pending entry, 180 // creating a committed entry to correspond to a to-be-deleted pending entry,
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
218 // data: URL or something like that. Use display_url() below for showing to 219 // data: URL or something like that. Use display_url() below for showing to
219 // the user. 220 // the user.
220 void set_url(const GURL& url) { 221 void set_url(const GURL& url) {
221 url_ = url; 222 url_ = url;
222 url_as_string_ = UTF8ToWide(url_.spec()); 223 url_as_string_ = UTF8ToWide(url_.spec());
223 } 224 }
224 const GURL& url() const { 225 const GURL& url() const {
225 return url_; 226 return url_;
226 } 227 }
227 228
229 // The referring URL. Can be empty.
230 void set_referrer(const GURL& referrer) {
231 referrer_ = referrer;
232 }
233 const GURL& referrer() const {
234 return referrer_;
235 }
236
228 // The display URL, when nonempty, will override the actual URL of the page 237 // The display URL, when nonempty, will override the actual URL of the page
229 // when we display it to the user. This allows us to have nice and friendly 238 // when we display it to the user. This allows us to have nice and friendly
230 // URLs that the user sees for things like about: URLs, but actually feed 239 // URLs that the user sees for things like about: URLs, but actually feed
231 // the renderer a data URL that results in the content loading. 240 // the renderer a data URL that results in the content loading.
232 // 241 //
233 // display_url() will return the URL to display to the user in all cases, so 242 // display_url() will return the URL to display to the user in all cases, so
234 // if there is no overridden display URL, it will return the actual one. 243 // if there is no overridden display URL, it will return the actual one.
235 void set_display_url(const GURL& url) { 244 void set_display_url(const GURL& url) {
236 display_url_ = (url == url_) ? GURL() : url; 245 display_url_ = (url == url_) ? GURL() : url;
237 } 246 }
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
355 // later. If you add a new field that needs to be persisted you'll have to 364 // later. If you add a new field that needs to be persisted you'll have to
356 // update SessionService/TabRestoreService appropriately. 365 // update SessionService/TabRestoreService appropriately.
357 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING 366 // WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
358 367
359 // See the accessors above for descriptions. 368 // See the accessors above for descriptions.
360 int unique_id_; 369 int unique_id_;
361 TabContentsType tab_type_; 370 TabContentsType tab_type_;
362 scoped_refptr<SiteInstance> site_instance_; 371 scoped_refptr<SiteInstance> site_instance_;
363 PageType page_type_; 372 PageType page_type_;
364 GURL url_; 373 GURL url_;
374
375 // TODO(eroman): Add referrer to session restore.
376 // http://code.google.com/p/chromium/issues/detail?id=3774
377 GURL referrer_;
378
365 std::wstring url_as_string_; 379 std::wstring url_as_string_;
366 GURL display_url_; 380 GURL display_url_;
367 std::wstring title_; 381 std::wstring title_;
368 FaviconStatus favicon_; 382 FaviconStatus favicon_;
369 std::string content_state_; 383 std::string content_state_;
370 int32 page_id_; 384 int32 page_id_;
371 SSLStatus ssl_; 385 SSLStatus ssl_;
372 PageTransition::Type transition_type_; 386 PageTransition::Type transition_type_;
373 GURL user_typed_url_; 387 GURL user_typed_url_;
374 bool has_post_data_; 388 bool has_post_data_;
375 bool restored_; 389 bool restored_;
376 390
377 // Copy and assignment is explicitly allowed for this class. 391 // Copy and assignment is explicitly allowed for this class.
378 }; 392 };
379 393
380 #endif // CHROME_BROWSER_NAVIGATION_ENTRY_H_ 394 #endif // CHROME_BROWSER_NAVIGATION_ENTRY_H_
OLDNEW
« no previous file with comments | « chrome/browser/navigation_controller_unittest.cc ('k') | chrome/browser/navigation_entry.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698