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

Side by Side Diff: extensions/browser/guest_view/web_view/web_view_guest.cc

Issue 531963002: Add support for file inputs for all guest views (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Implement RunFileChooser as GuestViewBase method Created 6 years, 3 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
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 #include "extensions/browser/guest_view/web_view/web_view_guest.h" 5 #include "extensions/browser/guest_view/web_view/web_view_guest.h"
6 6
7 #include "base/message_loop/message_loop.h" 7 #include "base/message_loop/message_loop.h"
8 #include "base/strings/stringprintf.h" 8 #include "base/strings/stringprintf.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "content/public/browser/browser_context.h" 10 #include "content/public/browser/browser_context.h"
(...skipping 819 matching lines...) Expand 10 before | Expand all | Expand 10 after
830 content::ColorChooser* WebViewGuest::OpenColorChooser( 830 content::ColorChooser* WebViewGuest::OpenColorChooser(
831 WebContents* web_contents, 831 WebContents* web_contents,
832 SkColor color, 832 SkColor color,
833 const std::vector<content::ColorSuggestion>& suggestions) { 833 const std::vector<content::ColorSuggestion>& suggestions) {
834 if (!attached() || !embedder_web_contents()->GetDelegate()) 834 if (!attached() || !embedder_web_contents()->GetDelegate())
835 return NULL; 835 return NULL;
836 return embedder_web_contents()->GetDelegate()->OpenColorChooser( 836 return embedder_web_contents()->GetDelegate()->OpenColorChooser(
837 web_contents, color, suggestions); 837 web_contents, color, suggestions);
838 } 838 }
839 839
840 void WebViewGuest::RunFileChooser(WebContents* web_contents,
841 const content::FileChooserParams& params) {
842 if (!attached() || !embedder_web_contents()->GetDelegate())
843 return;
844
845 embedder_web_contents()->GetDelegate()->RunFileChooser(web_contents, params);
846 }
847
848 void WebViewGuest::NavigateGuest(const std::string& src) { 840 void WebViewGuest::NavigateGuest(const std::string& src) {
849 GURL url = ResolveURL(src); 841 GURL url = ResolveURL(src);
850 842
851 // Do not allow navigating a guest to schemes other than known safe schemes. 843 // Do not allow navigating a guest to schemes other than known safe schemes.
852 // This will block the embedder trying to load unwanted schemes, e.g. 844 // This will block the embedder trying to load unwanted schemes, e.g.
853 // chrome://settings. 845 // chrome://settings.
854 bool scheme_is_blocked = 846 bool scheme_is_blocked =
855 (!content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme( 847 (!content::ChildProcessSecurityPolicy::GetInstance()->IsWebSafeScheme(
856 url.scheme()) && 848 url.scheme()) &&
857 !url.SchemeIs(url::kAboutScheme)) || 849 !url.SchemeIs(url::kAboutScheme)) ||
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
1105 WebViewGuest* guest = 1097 WebViewGuest* guest =
1106 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id); 1098 WebViewGuest::From(embedder_render_process_id(), new_window_instance_id);
1107 if (!guest) 1099 if (!guest)
1108 return; 1100 return;
1109 1101
1110 if (!allow) 1102 if (!allow)
1111 guest->Destroy(); 1103 guest->Destroy();
1112 } 1104 }
1113 1105
1114 } // namespace extensions 1106 } // namespace extensions
OLDNEW
« no previous file with comments | « extensions/browser/guest_view/web_view/web_view_guest.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698