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

Side by Side Diff: content/browser/browser_plugin/browser_plugin_guest.cc

Issue 280833003: <webview>: Move Color Chooser and File Chooser to Chrome (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@move_downloads_to_chorme
Patch Set: Created 6 years, 7 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "content/browser/browser_plugin/browser_plugin_guest.h" 5 #include "content/browser/browser_plugin/browser_plugin_guest.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/message_loop/message_loop.h" 9 #include "base/message_loop/message_loop.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 615 matching lines...) Expand 10 before | Expand all | Expand 10 after
626 JavaScriptDialogManager* BrowserPluginGuest::GetJavaScriptDialogManager() { 626 JavaScriptDialogManager* BrowserPluginGuest::GetJavaScriptDialogManager() {
627 if (!delegate_) 627 if (!delegate_)
628 return NULL; 628 return NULL;
629 return delegate_->GetJavaScriptDialogManager(); 629 return delegate_->GetJavaScriptDialogManager();
630 } 630 }
631 631
632 ColorChooser* BrowserPluginGuest::OpenColorChooser( 632 ColorChooser* BrowserPluginGuest::OpenColorChooser(
633 WebContents* web_contents, 633 WebContents* web_contents,
634 SkColor color, 634 SkColor color,
635 const std::vector<ColorSuggestion>& suggestions) { 635 const std::vector<ColorSuggestion>& suggestions) {
636 if (!embedder_web_contents_ || !embedder_web_contents_->GetDelegate()) 636 if (!delegate_)
637 return NULL; 637 return NULL;
638 return embedder_web_contents_->GetDelegate()->OpenColorChooser( 638 return delegate_->OpenColorChooser(web_contents, color, suggestions);
639 web_contents, color, suggestions);
640 } 639 }
641 640
642 bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) { 641 bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) {
643 if (delegate_) { 642 if (delegate_) {
644 WebContentsViewGuest* view_guest = 643 WebContentsViewGuest* view_guest =
645 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); 644 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView());
646 ContextMenuParams context_menu_params = 645 ContextMenuParams context_menu_params =
647 view_guest->ConvertContextMenuParams(params); 646 view_guest->ConvertContextMenuParams(params);
648 647
649 return delegate_->HandleContextMenu(context_menu_params); 648 return delegate_->HandleContextMenu(context_menu_params);
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
758 757
759 void BrowserPluginGuest::RendererResponsive(WebContents* source) { 758 void BrowserPluginGuest::RendererResponsive(WebContents* source) {
760 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Responsive")); 759 RecordAction(base::UserMetricsAction("BrowserPlugin.Guest.Responsive"));
761 if (!delegate_) 760 if (!delegate_)
762 return; 761 return;
763 delegate_->RendererResponsive(); 762 delegate_->RendererResponsive();
764 } 763 }
765 764
766 void BrowserPluginGuest::RunFileChooser(WebContents* web_contents, 765 void BrowserPluginGuest::RunFileChooser(WebContents* web_contents,
767 const FileChooserParams& params) { 766 const FileChooserParams& params) {
768 if (!attached()) 767 if (!delegate_)
769 return; 768 return;
770 769 delegate_->RunFileChooser(web_contents, params);
771 if (!embedder_web_contents_->GetDelegate())
772 return;
773
774 embedder_web_contents_->GetDelegate()->RunFileChooser(web_contents, params);
775 } 770 }
776 771
777 bool BrowserPluginGuest::ShouldFocusPageAfterCrash() { 772 bool BrowserPluginGuest::ShouldFocusPageAfterCrash() {
778 // Rather than managing focus in WebContentsImpl::RenderViewReady, we will 773 // Rather than managing focus in WebContentsImpl::RenderViewReady, we will
779 // manage the focus ourselves. 774 // manage the focus ourselves.
780 return false; 775 return false;
781 } 776 }
782 777
783 WebContentsImpl* BrowserPluginGuest::GetWebContents() const { 778 WebContentsImpl* BrowserPluginGuest::GetWebContents() const {
784 return static_cast<WebContentsImpl*>(web_contents()); 779 return static_cast<WebContentsImpl*>(web_contents());
(...skipping 737 matching lines...) Expand 10 before | Expand all | Expand 10 after
1522 void BrowserPluginGuest::OnImeCompositionRangeChanged( 1517 void BrowserPluginGuest::OnImeCompositionRangeChanged(
1523 const gfx::Range& range, 1518 const gfx::Range& range,
1524 const std::vector<gfx::Rect>& character_bounds) { 1519 const std::vector<gfx::Rect>& character_bounds) {
1525 static_cast<RenderWidgetHostViewBase*>( 1520 static_cast<RenderWidgetHostViewBase*>(
1526 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( 1521 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged(
1527 range, character_bounds); 1522 range, character_bounds);
1528 } 1523 }
1529 #endif 1524 #endif
1530 1525
1531 } // namespace content 1526 } // namespace content
OLDNEW
« no previous file with comments | « chrome/browser/guest_view/web_view/web_view_guest.cc ('k') | content/public/browser/browser_plugin_guest_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698