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

Side by Side 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, 4 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome_frame/test/util_unittests.cc ('k') | chrome_frame/utils.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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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_FRAME_UTILS_H_ 5 #ifndef CHROME_FRAME_UTILS_H_
6 #define CHROME_FRAME_UTILS_H_ 6 #define CHROME_FRAME_UTILS_H_
7 7
8 #include <shdeprecated.h> 8 #include <shdeprecated.h>
9 #include <urlmon.h> 9 #include <urlmon.h>
10 #include <wininet.h> 10 #include <wininet.h>
(...skipping 12 matching lines...) Expand all
23 23
24 // utils.h : Various utility functions and classes 24 // utils.h : Various utility functions and classes
25 25
26 extern const wchar_t kChromeContentPrefix[]; 26 extern const wchar_t kChromeContentPrefix[];
27 extern const wchar_t kChromeProtocolPrefix[]; 27 extern const wchar_t kChromeProtocolPrefix[];
28 extern const wchar_t kChromeFrameHeadlessMode[]; 28 extern const wchar_t kChromeFrameHeadlessMode[];
29 extern const wchar_t kChromeFrameUnpinnedMode[]; 29 extern const wchar_t kChromeFrameUnpinnedMode[];
30 extern const wchar_t kEnableGCFProtocol[]; 30 extern const wchar_t kEnableGCFProtocol[];
31 extern const wchar_t kEnableBuggyBhoIntercept[]; 31 extern const wchar_t kEnableBuggyBhoIntercept[];
32 extern const wchar_t kChromeMimeType[]; 32 extern const wchar_t kChromeMimeType[];
33 extern const wchar_t kChromeFrameAttachTabPattern[];
33 34
34 typedef enum ProtocolPatchMethod { 35 typedef enum ProtocolPatchMethod {
35 PATCH_METHOD_IBROWSER = 0, 36 PATCH_METHOD_IBROWSER = 0,
36 PATCH_METHOD_INET_PROTOCOL, // 1 37 PATCH_METHOD_INET_PROTOCOL, // 1
37 PATCH_METHOD_MONIKER, // 2 38 PATCH_METHOD_MONIKER, // 2
38 }; 39 };
39 40
40 // A REG_DWORD config value that maps to the ProtocolPatchMethod enum. 41 // A REG_DWORD config value that maps to the ProtocolPatchMethod enum.
41 // To get the config value, call: 42 // To get the config value, call:
42 // ProtocolPatchMethod patch_method = 43 // ProtocolPatchMethod patch_method =
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after
465 } 466 }
466 467
467 // Convert various protocol flags to text representation. Used for logging. 468 // Convert various protocol flags to text representation. Used for logging.
468 std::string BindStatus2Str(ULONG bind_status); 469 std::string BindStatus2Str(ULONG bind_status);
469 std::string PiFlags2Str(DWORD flags); 470 std::string PiFlags2Str(DWORD flags);
470 std::string Bscf2Str(DWORD flags); 471 std::string Bscf2Str(DWORD flags);
471 472
472 // Reads data from a stream into a string. 473 // Reads data from a stream into a string.
473 HRESULT ReadStream(IStream* stream, size_t size, std::string* data); 474 HRESULT ReadStream(IStream* stream, size_t size, std::string* data);
474 475
475 // Parses the attach external tab url, which comes in from Chrome in the course 476 // Parses urls targetted at ChromeFrame. This class maintains state like
476 // of a window.open operation. The format of this URL is as below:- 477 // whether a url is prefixed with the gcf: prefix, whether it is being
477 // gcf:attach_external_tab&n1&n2&x&y&width&height 478 // attached to an existing external tab, etc.
478 // n1 -> cookie, n2 -> disposition, x, y, width, height -> dimensions of the 479 class ChromeFrameUrl {
479 // window. 480 public:
480 // Returns true on success. 481 ChromeFrameUrl();
481 bool ParseAttachExternalTabUrl(const std::wstring& url, uint64* cookie, 482
482 gfx::Rect* dimensions, int* disposition); 483 // Parses the url passed in. Returns true on success.
484 bool Parse(const std::wstring& url);
485
486 bool is_chrome_protocol() const {
487 return is_chrome_protocol_;
488 }
489
490 bool attach_to_external_tab() const {
491 return attach_to_external_tab_;
492 }
493
494 uint64 cookie() const {
495 return cookie_;
496 }
497
498 int disposition() const {
499 return disposition_;
500 }
501
502 const gfx::Rect& dimensions() const {
503 return dimensions_;
504 }
505
506 const std::wstring& url() const {
507 return url_;
508 }
509
510 private:
511 // If we are attaching to an existing external tab, this function parses the
512 // suffix portion of the URL which contains the attach_external_tab prefix.
513 bool ParseAttachExternalTabUrl();
514
515 bool attach_to_external_tab_;
516 bool is_chrome_protocol_;
517 std::wstring url_;
518 uint64 cookie_;
519 gfx::Rect dimensions_;
520 int disposition_;
521 };
522
523 // Returns true if we can navigate to this URL.
524 // This function checks if the url scheme is valid for navigation within
525 // chrome and whether it is a restricted URL as per IE settings. In either of
526 // these cases it returns false.
527 bool CanNavigateInFullTabMode(const ChromeFrameUrl& cf_url,
528 IInternetSecurityManager* security_manager);
483 529
484 #endif // CHROME_FRAME_UTILS_H_ 530 #endif // CHROME_FRAME_UTILS_H_
OLDNEW
« 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