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

Unified Diff: content/public/browser/web_contents.h

Issue 2076063002: Clarify that WebContents::GetLastCommittedURL returns the virtual URL. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments Created 4 years, 6 months 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « content/public/browser/navigation_handle.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/public/browser/web_contents.h
diff --git a/content/public/browser/web_contents.h b/content/public/browser/web_contents.h
index 90b647efcbf43132033298205d9ce8a0837945d8..9ccb6fea4c4cedbcd874a50780f0e94df9807a8e 100644
--- a/content/public/browser/web_contents.h
+++ b/content/public/browser/web_contents.h
@@ -203,16 +203,20 @@ class WebContents : public PageNavigator,
// |GetLastCommittedURL| as appropriate.
virtual const GURL& GetURL() const = 0;
- // Gets the URL currently being displayed in the URL bar, if there is one.
- // This URL might be a pending navigation that hasn't committed yet, so it is
- // not guaranteed to match the current page in this WebContents. A typical
- // example of this is interstitials, which show the URL of the new/loading
- // page (active) but the security context is of the old page (last committed).
+ // Gets the virtual URL currently being displayed in the URL bar, if there is
+ // one. This URL might be a pending navigation that hasn't committed yet, so
+ // it is not guaranteed to match the current page in this WebContents. A
+ // typical example of this is interstitials, which show the URL of the
+ // new/loading page (active) but the security context is of the old page (last
+ // committed).
virtual const GURL& GetVisibleURL() const = 0;
- // Gets the last committed URL. It represents the current page that is
- // displayed in this WebContents. It represents the current security
- // context.
+ // Gets the virtual URL of the last committed page in this WebContents.
+ // Virtual URLs are meant to be displayed to the user (e.g., they include the
+ // "view-source:" prefix for view source URLs, unlike NavigationEntry::GetURL
+ // and NavigationHandle::GetURL). The last committed page is the current
+ // security context and the content that is actually displayed within the tab.
+ // See also GetVisibleURL above, which may differ from this URL.
virtual const GURL& GetLastCommittedURL() const = 0;
// Return the currently active RenderProcessHost and RenderViewHost. Each of
« no previous file with comments | « content/public/browser/navigation_handle.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698