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

Unified Diff: chrome_frame/utils.h

Issue 3051018: Ensure that window.open requests issued by ChromeFrame carry the correct cook... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 5 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 | « chrome_frame/test/util_unittests.cc ('k') | chrome_frame/utils.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome_frame/utils.h
===================================================================
--- chrome_frame/utils.h (revision 53833)
+++ chrome_frame/utils.h (working copy)
@@ -30,6 +30,7 @@
extern const wchar_t kEnableGCFProtocol[];
extern const wchar_t kEnableBuggyBhoIntercept[];
extern const wchar_t kChromeMimeType[];
+extern const wchar_t kChromeFrameAttachTabPattern[];
typedef enum ProtocolPatchMethod {
PATCH_METHOD_IBROWSER = 0,
@@ -472,13 +473,58 @@
// Reads data from a stream into a string.
HRESULT ReadStream(IStream* stream, size_t size, std::string* data);
-// Parses the attach external tab url, which comes in from Chrome in the course
-// of a window.open operation. The format of this URL is as below:-
-// gcf:attach_external_tab&n1&n2&x&y&width&height
-// n1 -> cookie, n2 -> disposition, x, y, width, height -> dimensions of the
-// window.
-// Returns true on success.
-bool ParseAttachExternalTabUrl(const std::wstring& url, uint64* cookie,
- gfx::Rect* dimensions, int* disposition);
+// Parses urls targetted at ChromeFrame. This class maintains state like
+// whether a url is prefixed with the gcf: prefix, whether it is being
+// attached to an existing external tab, etc.
+class ChromeFrameUrl {
+ public:
+ ChromeFrameUrl();
+ // Parses the url passed in. Returns true on success.
+ bool Parse(const std::wstring& url);
+
+ bool is_chrome_protocol() const {
+ return is_chrome_protocol_;
+ }
+
+ bool attach_to_external_tab() const {
+ return attach_to_external_tab_;
+ }
+
+ uint64 cookie() const {
+ return cookie_;
+ }
+
+ int disposition() const {
+ return disposition_;
+ }
+
+ const gfx::Rect& dimensions() const {
+ return dimensions_;
+ }
+
+ const std::wstring& url() const {
+ return url_;
+ }
+
+ private:
+ // If we are attaching to an existing external tab, this function parses the
+ // suffix portion of the URL which contains the attach_external_tab prefix.
+ bool ParseAttachExternalTabUrl();
+
+ bool attach_to_external_tab_;
+ bool is_chrome_protocol_;
+ std::wstring url_;
+ uint64 cookie_;
+ gfx::Rect dimensions_;
+ int disposition_;
+};
+
+// Returns true if we can navigate to this URL.
+// This function checks if the url scheme is valid for navigation within
+// chrome and whether it is a restricted URL as per IE settings. In either of
+// these cases it returns false.
+bool CanNavigateInFullTabMode(const ChromeFrameUrl& cf_url,
+ IInternetSecurityManager* security_manager);
+
#endif // CHROME_FRAME_UTILS_H_
« no previous file with comments | « chrome_frame/test/util_unittests.cc ('k') | chrome_frame/utils.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698