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

Side by Side Diff: content/renderer/render_view_impl.cc

Issue 801173002: Fix message routing for BrowserPlugin in iframe (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Simplified test Created 6 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 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/renderer/render_view_impl.h" 5 #include "content/renderer/render_view_impl.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 635 matching lines...) Expand 10 before | Expand all | Expand 10 after
646 history_list_offset_(-1), 646 history_list_offset_(-1),
647 history_list_length_(0), 647 history_list_length_(0),
648 frames_in_progress_(0), 648 frames_in_progress_(0),
649 target_url_status_(TARGET_NONE), 649 target_url_status_(TARGET_NONE),
650 uses_temporary_zoom_level_(false), 650 uses_temporary_zoom_level_(false),
651 #if defined(OS_ANDROID) 651 #if defined(OS_ANDROID)
652 top_controls_constraints_(cc::BOTH), 652 top_controls_constraints_(cc::BOTH),
653 #endif 653 #endif
654 has_scrolled_focused_editable_node_into_rect_(false), 654 has_scrolled_focused_editable_node_into_rect_(false),
655 speech_recognition_dispatcher_(NULL), 655 speech_recognition_dispatcher_(NULL),
656 browser_plugin_manager_(NULL),
657 devtools_agent_(NULL), 656 devtools_agent_(NULL),
658 mouse_lock_dispatcher_(NULL), 657 mouse_lock_dispatcher_(NULL),
659 #if defined(OS_ANDROID) 658 #if defined(OS_ANDROID)
660 expected_content_intent_id_(0), 659 expected_content_intent_id_(0),
661 #endif 660 #endif
662 #if defined(OS_WIN) 661 #if defined(OS_WIN)
663 focused_plugin_id_(-1), 662 focused_plugin_id_(-1),
664 #endif 663 #endif
665 #if defined(ENABLE_PLUGINS) 664 #if defined(ENABLE_PLUGINS)
666 plugin_find_handler_(NULL), 665 plugin_find_handler_(NULL),
(...skipping 1700 matching lines...) Expand 10 before | Expand all | Expand 10 after
2367 2366
2368 gfx::Size size = webview()->contentsPreferredMinimumSize(); 2367 gfx::Size size = webview()->contentsPreferredMinimumSize();
2369 if (size == preferred_size_) 2368 if (size == preferred_size_)
2370 return; 2369 return;
2371 2370
2372 preferred_size_ = size; 2371 preferred_size_ = size;
2373 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_, 2372 Send(new ViewHostMsg_DidContentsPreferredSizeChange(routing_id_,
2374 preferred_size_)); 2373 preferred_size_));
2375 } 2374 }
2376 2375
2377 BrowserPluginManager* RenderViewImpl::GetBrowserPluginManager() {
2378 if (!browser_plugin_manager_.get())
2379 browser_plugin_manager_ = BrowserPluginManager::Create(this);
2380 return browser_plugin_manager_.get();
2381 }
2382
2383 void RenderViewImpl::didChangeScrollOffset(WebLocalFrame* frame) { 2376 void RenderViewImpl::didChangeScrollOffset(WebLocalFrame* frame) {
2384 StartNavStateSyncTimerIfNecessary(); 2377 StartNavStateSyncTimerIfNecessary();
2385 } 2378 }
2386 2379
2387 void RenderViewImpl::SendFindReply(int request_id, 2380 void RenderViewImpl::SendFindReply(int request_id,
2388 int match_count, 2381 int match_count,
2389 int ordinal, 2382 int ordinal,
2390 const WebRect& selection_rect, 2383 const WebRect& selection_rect,
2391 bool final_status_update) { 2384 bool final_status_update) {
2392 Send(new ViewHostMsg_Find_Reply(routing_id_, 2385 Send(new ViewHostMsg_Find_Reply(routing_id_,
(...skipping 1091 matching lines...) Expand 10 before | Expand all | Expand 10 after
3484 #endif 3477 #endif
3485 (*plugin_it)->SetContentAreaFocus(enable); 3478 (*plugin_it)->SetContentAreaFocus(enable);
3486 } 3479 }
3487 } 3480 }
3488 // Notify all Pepper plugins. 3481 // Notify all Pepper plugins.
3489 for (PepperPluginSet::iterator i = active_pepper_instances_.begin(); 3482 for (PepperPluginSet::iterator i = active_pepper_instances_.begin();
3490 i != active_pepper_instances_.end(); ++i) 3483 i != active_pepper_instances_.end(); ++i)
3491 (*i)->SetContentAreaFocus(enable); 3484 (*i)->SetContentAreaFocus(enable);
3492 #endif 3485 #endif
3493 // Notify all BrowserPlugins of the RenderView's focus state. 3486 // Notify all BrowserPlugins of the RenderView's focus state.
3494 if (browser_plugin_manager_.get()) 3487 BrowserPluginManager::Get()->UpdateFocusState();
3495 browser_plugin_manager_->UpdateFocusState();
3496 } 3488 }
3497 3489
3498 void RenderViewImpl::OnImeSetComposition( 3490 void RenderViewImpl::OnImeSetComposition(
3499 const base::string16& text, 3491 const base::string16& text,
3500 const std::vector<blink::WebCompositionUnderline>& underlines, 3492 const std::vector<blink::WebCompositionUnderline>& underlines,
3501 int selection_start, 3493 int selection_start,
3502 int selection_end) { 3494 int selection_end) {
3503 #if defined(ENABLE_PLUGINS) 3495 #if defined(ENABLE_PLUGINS)
3504 if (focused_pepper_plugin_) { 3496 if (focused_pepper_plugin_) {
3505 focused_pepper_plugin_->render_frame()->OnImeSetComposition( 3497 focused_pepper_plugin_->render_frame()->OnImeSetComposition(
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
3582 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) { 3574 void RenderViewImpl::SetDeviceScaleFactor(float device_scale_factor) {
3583 RenderWidget::SetDeviceScaleFactor(device_scale_factor); 3575 RenderWidget::SetDeviceScaleFactor(device_scale_factor);
3584 if (webview()) { 3576 if (webview()) {
3585 webview()->setDeviceScaleFactor(device_scale_factor); 3577 webview()->setDeviceScaleFactor(device_scale_factor);
3586 webview()->settings()->setPreferCompositingToLCDTextEnabled( 3578 webview()->settings()->setPreferCompositingToLCDTextEnabled(
3587 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_)); 3579 PreferCompositingToLCDText(compositor_deps_, device_scale_factor_));
3588 } 3580 }
3589 if (auto_resize_mode_) 3581 if (auto_resize_mode_)
3590 AutoResizeCompositor(); 3582 AutoResizeCompositor();
3591 3583
3592 if (browser_plugin_manager_.get()) 3584 BrowserPluginManager::Get()->UpdateDeviceScaleFactor();
3593 browser_plugin_manager_->UpdateDeviceScaleFactor();
3594 } 3585 }
3595 3586
3596 bool RenderViewImpl::SetDeviceColorProfile( 3587 bool RenderViewImpl::SetDeviceColorProfile(
3597 const std::vector<char>& profile) { 3588 const std::vector<char>& profile) {
3598 bool changed = RenderWidget::SetDeviceColorProfile(profile); 3589 bool changed = RenderWidget::SetDeviceColorProfile(profile);
3599 if (changed && webview()) { 3590 if (changed && webview()) {
3600 WebVector<char> colorProfile = profile; 3591 WebVector<char> colorProfile = profile;
3601 webview()->setDeviceColorProfile(colorProfile); 3592 webview()->setDeviceColorProfile(colorProfile);
3602 } 3593 }
3603 return changed; 3594 return changed;
(...skipping 463 matching lines...) Expand 10 before | Expand all | Expand 10 after
4067 void RenderViewImpl::OnReleaseDisambiguationPopupBitmap( 4058 void RenderViewImpl::OnReleaseDisambiguationPopupBitmap(
4068 const cc::SharedBitmapId& id) { 4059 const cc::SharedBitmapId& id) {
4069 BitmapMap::iterator it = disambiguation_bitmaps_.find(id); 4060 BitmapMap::iterator it = disambiguation_bitmaps_.find(id);
4070 DCHECK(it != disambiguation_bitmaps_.end()); 4061 DCHECK(it != disambiguation_bitmaps_.end());
4071 delete it->second; 4062 delete it->second;
4072 disambiguation_bitmaps_.erase(it); 4063 disambiguation_bitmaps_.erase(it);
4073 } 4064 }
4074 4065
4075 void RenderViewImpl::DidCommitCompositorFrame() { 4066 void RenderViewImpl::DidCommitCompositorFrame() {
4076 RenderWidget::DidCommitCompositorFrame(); 4067 RenderWidget::DidCommitCompositorFrame();
4068 BrowserPluginManager::Get()->DidCommitCompositorFrame(GetRoutingID());
4077 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame()); 4069 FOR_EACH_OBSERVER(RenderViewObserver, observers_, DidCommitCompositorFrame());
4078 } 4070 }
4079 4071
4080 void RenderViewImpl::SendUpdateFaviconURL(const std::vector<FaviconURL>& urls) { 4072 void RenderViewImpl::SendUpdateFaviconURL(const std::vector<FaviconURL>& urls) {
4081 if (!urls.empty()) 4073 if (!urls.empty())
4082 Send(new ViewHostMsg_UpdateFaviconURL(routing_id_, urls)); 4074 Send(new ViewHostMsg_UpdateFaviconURL(routing_id_, urls));
4083 } 4075 }
4084 4076
4085 void RenderViewImpl::DidStopLoadingIcons() { 4077 void RenderViewImpl::DidStopLoadingIcons() {
4086 int icon_types = WebIconURL::TypeFavicon; 4078 int icon_types = WebIconURL::TypeFavicon;
(...skipping 14 matching lines...) Expand all
4101 std::vector<gfx::Size> sizes; 4093 std::vector<gfx::Size> sizes;
4102 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes); 4094 ConvertToFaviconSizes(icon_urls[i].sizes(), &sizes);
4103 if (!url.isEmpty()) 4095 if (!url.isEmpty())
4104 urls.push_back( 4096 urls.push_back(
4105 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes)); 4097 FaviconURL(url, ToFaviconType(icon_urls[i].iconType()), sizes));
4106 } 4098 }
4107 SendUpdateFaviconURL(urls); 4099 SendUpdateFaviconURL(urls);
4108 } 4100 }
4109 4101
4110 } // namespace content 4102 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698