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

Unified Diff: chrome_frame/chrome_frame_delegate.cc

Issue 5698005: Add support for gcf:about:plugins in chrome frame full tab mode. The URL vali... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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 side-by-side diff with in-line comments
Download patch
Index: chrome_frame/chrome_frame_delegate.cc
===================================================================
--- chrome_frame/chrome_frame_delegate.cc (revision 68604)
+++ chrome_frame/chrome_frame_delegate.cc (working copy)
@@ -4,6 +4,10 @@
#include "chrome_frame/chrome_frame_delegate.h"
+#include "base/utf_string_conversions.h"
+#include "chrome/common/url_constants.h"
+#include "chrome_frame/utils.h"
+
bool ChromeFrameDelegateImpl::IsTabMessage(const IPC::Message& message,
int* tab_handle) {
bool is_tab_message = true;
@@ -75,3 +79,44 @@
IPC_MESSAGE_HANDLER(AutomationMsg_CloseExternalTab, OnCloseTab)
IPC_END_MESSAGE_MAP()
}
+
+
+// NavigationConstraintsImpl method definitions.
+bool NavigationConstraintsImpl::AllowUnsafeUrls() {
+ // No sanity checks if unsafe URLs are allowed
+ return GetConfigBool(false, kAllowUnsafeURLs);
+}
+
+bool NavigationConstraintsImpl::IsSchemeAllowed(const GURL& url) {
+ if (url.is_empty())
+ return false;
+
+ if (!url.is_valid())
+ return false;
+
+ if (url.SchemeIs(chrome::kHttpScheme) ||
+ url.SchemeIs(chrome::kHttpsScheme))
+ return true;
+
+ // Additional checking for view-source. Allow only http and https
+ // URLs in view source.
+ if (url.SchemeIs(chrome::kViewSourceScheme)) {
+ GURL sub_url(url.path());
+ if (sub_url.SchemeIs(chrome::kHttpScheme) ||
+ sub_url.SchemeIs(chrome::kHttpsScheme))
+ return true;
+ }
+
+ // Allow only about:blank or about:version
+ if (url.SchemeIs(chrome::kAboutScheme)) {
+ if (LowerCaseEqualsASCII(url.spec(), chrome::kAboutBlankURL) ||
+ LowerCaseEqualsASCII(url.spec(), chrome::kAboutVersionURL)) {
+ return true;
+ }
+ }
+ return false;
+}
+
+bool NavigationConstraintsImpl::IsZoneAllowed(const GURL& url) {
+ return true;
+}

Powered by Google App Engine
This is Rietveld 408576698