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/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 const char script[] = "window.addEventListener('dragstart', function() { " | 442 const char script[] = "window.addEventListener('dragstart', function() { " |
443 " window.event.preventDefault(); " | 443 " window.event.preventDefault(); " |
444 "});"; | 444 "});"; |
445 render_view_host->GetMainFrame()->ExecuteJavaScript( | 445 render_view_host->GetMainFrame()->ExecuteJavaScript( |
446 base::ASCIIToUTF16(script)); | 446 base::ASCIIToUTF16(script)); |
447 } | 447 } |
448 } | 448 } |
449 | 449 |
450 void BrowserPluginGuest::RenderViewReady() { | 450 void BrowserPluginGuest::RenderViewReady() { |
451 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); | 451 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); |
452 // The guest RenderView should always live in a guest process. | |
453 CHECK(rvh->GetProcess()->IsGuest()); | |
454 // TODO(fsamuel): Investigate whether it's possible to update state earlier | 452 // TODO(fsamuel): Investigate whether it's possible to update state earlier |
455 // here (see http://crbug.com/158151). | 453 // here (see http://crbug.com/158151). |
456 Send(new InputMsg_SetFocus(routing_id(), focused_)); | 454 Send(new InputMsg_SetFocus(routing_id(), focused_)); |
457 UpdateVisibility(); | 455 UpdateVisibility(); |
458 if (auto_size_enabled_) | 456 if (auto_size_enabled_) |
459 rvh->EnableAutoResize(min_auto_size_, max_auto_size_); | 457 rvh->EnableAutoResize(min_auto_size_, max_auto_size_); |
460 else | 458 else |
461 rvh->DisableAutoResize(full_size_); | 459 rvh->DisableAutoResize(full_size_); |
462 | 460 |
463 OnSetContentsOpaque(instance_id_, guest_opaque_); | 461 OnSetContentsOpaque(instance_id_, guest_opaque_); |
(...skipping 505 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
969 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 967 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
970 const gfx::Range& range, | 968 const gfx::Range& range, |
971 const std::vector<gfx::Rect>& character_bounds) { | 969 const std::vector<gfx::Rect>& character_bounds) { |
972 static_cast<RenderWidgetHostViewBase*>( | 970 static_cast<RenderWidgetHostViewBase*>( |
973 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 971 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
974 range, character_bounds); | 972 range, character_bounds); |
975 } | 973 } |
976 #endif | 974 #endif |
977 | 975 |
978 } // namespace content | 976 } // namespace content |
OLD | NEW |