Chromium Code Reviews| 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 597 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 608 const char script[] = "window.addEventListener('dragstart', function() { " | 608 const char script[] = "window.addEventListener('dragstart', function() { " |
| 609 " window.event.preventDefault(); " | 609 " window.event.preventDefault(); " |
| 610 "});"; | 610 "});"; |
| 611 render_view_host->GetMainFrame()->ExecuteJavaScript( | 611 render_view_host->GetMainFrame()->ExecuteJavaScript( |
| 612 base::ASCIIToUTF16(script)); | 612 base::ASCIIToUTF16(script)); |
| 613 } | 613 } |
| 614 } | 614 } |
| 615 | 615 |
| 616 void BrowserPluginGuest::RenderViewReady() { | 616 void BrowserPluginGuest::RenderViewReady() { |
| 617 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); | 617 RenderViewHost* rvh = GetWebContents()->GetRenderViewHost(); |
| 618 // The guest RenderView should always live in a guest process. | |
|
lazyboy
2014/05/27 19:22:22
I'd keep this until we start upstreaming appview c
Fady Samuel
2014/05/27 21:56:34
This seems more appropriately in WebViewGuest. I'v
| |
| 619 CHECK(rvh->GetProcess()->IsGuest()); | |
| 620 // TODO(fsamuel): Investigate whether it's possible to update state earlier | 618 // TODO(fsamuel): Investigate whether it's possible to update state earlier |
| 621 // here (see http://crbug.com/158151). | 619 // here (see http://crbug.com/158151). |
| 622 Send(new InputMsg_SetFocus(routing_id(), focused_)); | 620 Send(new InputMsg_SetFocus(routing_id(), focused_)); |
| 623 UpdateVisibility(); | 621 UpdateVisibility(); |
| 624 if (auto_size_enabled_) | 622 if (auto_size_enabled_) |
| 625 rvh->EnableAutoResize(min_auto_size_, max_auto_size_); | 623 rvh->EnableAutoResize(min_auto_size_, max_auto_size_); |
| 626 else | 624 else |
| 627 rvh->DisableAutoResize(full_size_); | 625 rvh->DisableAutoResize(full_size_); |
| 628 | 626 |
| 629 OnSetContentsOpaque(instance_id_, guest_opaque_); | 627 OnSetContentsOpaque(instance_id_, guest_opaque_); |
| (...skipping 529 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1159 void BrowserPluginGuest::OnImeCompositionRangeChanged( | 1157 void BrowserPluginGuest::OnImeCompositionRangeChanged( |
| 1160 const gfx::Range& range, | 1158 const gfx::Range& range, |
| 1161 const std::vector<gfx::Rect>& character_bounds) { | 1159 const std::vector<gfx::Rect>& character_bounds) { |
| 1162 static_cast<RenderWidgetHostViewBase*>( | 1160 static_cast<RenderWidgetHostViewBase*>( |
| 1163 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( | 1161 web_contents()->GetRenderWidgetHostView())->ImeCompositionRangeChanged( |
| 1164 range, character_bounds); | 1162 range, character_bounds); |
| 1165 } | 1163 } |
| 1166 #endif | 1164 #endif |
| 1167 | 1165 |
| 1168 } // namespace content | 1166 } // namespace content |
| OLD | NEW |