OLD | NEW |
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 409 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
420 ColorChooser* BrowserPluginGuest::OpenColorChooser( | 420 ColorChooser* BrowserPluginGuest::OpenColorChooser( |
421 WebContents* web_contents, | 421 WebContents* web_contents, |
422 SkColor color, | 422 SkColor color, |
423 const std::vector<ColorSuggestion>& suggestions) { | 423 const std::vector<ColorSuggestion>& suggestions) { |
424 if (!delegate_) | 424 if (!delegate_) |
425 return NULL; | 425 return NULL; |
426 return delegate_->OpenColorChooser(web_contents, color, suggestions); | 426 return delegate_->OpenColorChooser(web_contents, color, suggestions); |
427 } | 427 } |
428 | 428 |
429 bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) { | 429 bool BrowserPluginGuest::HandleContextMenu(const ContextMenuParams& params) { |
430 if (delegate_) { | 430 if (!delegate_) |
431 WebContentsViewGuest* view_guest = | 431 return false; |
432 static_cast<WebContentsViewGuest*>(GetWebContents()->GetView()); | |
433 ContextMenuParams context_menu_params = | |
434 view_guest->ConvertContextMenuParams(params); | |
435 | 432 |
436 return delegate_->HandleContextMenu(context_menu_params); | 433 return delegate_->HandleContextMenu(params); |
437 } | |
438 | |
439 // Will be handled by WebContentsViewGuest. | |
440 return false; | |
441 } | 434 } |
442 | 435 |
443 void BrowserPluginGuest::HandleKeyboardEvent( | 436 void BrowserPluginGuest::HandleKeyboardEvent( |
444 WebContents* source, | 437 WebContents* source, |
445 const NativeWebKeyboardEvent& event) { | 438 const NativeWebKeyboardEvent& event) { |
446 if (!delegate_) | 439 if (!delegate_) |
447 return; | 440 return; |
448 | 441 |
449 delegate_->HandleKeyboardEvent(event); | 442 delegate_->HandleKeyboardEvent(event); |
450 } | 443 } |
(...skipping 732 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1183 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 1176 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
1184 const gfx::Range& range, | 1177 const gfx::Range& range, |
1185 const std::vector<gfx::Rect>& character_bounds) { | 1178 const std::vector<gfx::Rect>& character_bounds) { |
1186 static_cast<RenderWidgetHostViewBase*>( | 1179 static_cast<RenderWidgetHostViewBase*>( |
1187 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 1180 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
1188 range, character_bounds); | 1181 range, character_bounds); |
1189 } | 1182 } |
1190 #endif | 1183 #endif |
1191 | 1184 |
1192 } // namespace content | 1185 } // namespace content |
OLD | NEW |