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

Side by Side Diff: content/public/browser/render_frame_host.h

Issue 1475433002: Expose RenderFrameHost::GetLastCommittedOrigin(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Charlie's fixes. Created 5 years 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
OLDNEW
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 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 5 #ifndef CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 6 #define CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/callback_forward.h" 10 #include "base/callback_forward.h"
11 #include "content/common/content_export.h" 11 #include "content/common/content_export.h"
12 #include "content/public/common/console_message_level.h" 12 #include "content/public/common/console_message_level.h"
13 #include "ipc/ipc_listener.h" 13 #include "ipc/ipc_listener.h"
14 #include "ipc/ipc_sender.h" 14 #include "ipc/ipc_sender.h"
15 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h" 15 #include "third_party/WebKit/public/platform/WebPageVisibilityState.h"
16 #include "ui/gfx/geometry/rect.h" 16 #include "ui/gfx/geometry/rect.h"
17 #include "ui/gfx/native_widget_types.h" 17 #include "ui/gfx/native_widget_types.h"
18 #include "url/gurl.h" 18 #include "url/gurl.h"
19 #include "url/origin.h"
19 20
20 namespace base { 21 namespace base {
21 class Value; 22 class Value;
22 } 23 }
23 24
24 namespace content { 25 namespace content {
25 class RenderProcessHost; 26 class RenderProcessHost;
26 class RenderViewHost; 27 class RenderViewHost;
27 class ServiceRegistry; 28 class ServiceRegistry;
28 class SiteInstance; 29 class SiteInstance;
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
69 // Returns the assigned name of the frame, the name of the iframe tag 70 // Returns the assigned name of the frame, the name of the iframe tag
70 // declaring it. For example, <iframe name="framename">[...]</iframe>. It is 71 // declaring it. For example, <iframe name="framename">[...]</iframe>. It is
71 // quite possible for a frame to have no name, in which case GetFrameName will 72 // quite possible for a frame to have no name, in which case GetFrameName will
72 // return an empty string. 73 // return an empty string.
73 virtual const std::string& GetFrameName() = 0; 74 virtual const std::string& GetFrameName() = 0;
74 75
75 // Returns true if the frame is out of process. 76 // Returns true if the frame is out of process.
76 virtual bool IsCrossProcessSubframe() = 0; 77 virtual bool IsCrossProcessSubframe() = 0;
77 78
78 // Returns the last committed URL of the frame. 79 // Returns the last committed URL of the frame.
80 //
81 // The URL is only accurate if this RenderFrameHost is current in the frame
82 // tree -- i.e., it would be visited by WebContents::ForEachFrame. In
83 // particular, this method may return a misleading value if called from
84 // WebContentsObserver::RenderFrameCreated, since non-current frames can be
85 // passed to that observer method.
79 virtual GURL GetLastCommittedURL() = 0; 86 virtual GURL GetLastCommittedURL() = 0;
80 87
88 // Returns the last committed origin of the frame.
89 //
90 // The origin is only available if this RenderFrameHost is current in the
91 // frame tree -- i.e., it would be visited by WebContents::ForEachFrame. In
92 // particular, this method may CHECK if called from
93 // WebContentsObserver::RenderFrameCreated, since non-current frames can be
94 // passed to that observer method.
95 virtual url::Origin GetLastCommittedOrigin() = 0;
96
81 // Returns the associated widget's native view. 97 // Returns the associated widget's native view.
82 virtual gfx::NativeView GetNativeView() = 0; 98 virtual gfx::NativeView GetNativeView() = 0;
83 99
84 // Adds |message| to the DevTools console. 100 // Adds |message| to the DevTools console.
85 virtual void AddMessageToConsole(ConsoleMessageLevel level, 101 virtual void AddMessageToConsole(ConsoleMessageLevel level,
86 const std::string& message) = 0; 102 const std::string& message) = 0;
87 103
88 // Runs some JavaScript in this frame's context. If a callback is provided, it 104 // Runs some JavaScript in this frame's context. If a callback is provided, it
89 // will be used to return the result, when the result is available. 105 // will be used to return the result, when the result is available.
90 // This API can only be called on chrome:// or chrome-devtools:// URLs. 106 // This API can only be called on chrome:// or chrome-devtools:// URLs.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
152 168
153 private: 169 private:
154 // This interface should only be implemented inside content. 170 // This interface should only be implemented inside content.
155 friend class RenderFrameHostImpl; 171 friend class RenderFrameHostImpl;
156 RenderFrameHost() {} 172 RenderFrameHost() {}
157 }; 173 };
158 174
159 } // namespace content 175 } // namespace content
160 176
161 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_ 177 #endif // CONTENT_PUBLIC_BROWSER_RENDER_FRAME_HOST_H_
OLDNEW
« no previous file with comments | « content/browser/frame_host/render_frame_host_impl.cc ('k') | content/test/data/frame_tree/top.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698