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/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 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 1984 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1995 // response as RunJavaScriptMessage. | 1995 // response as RunJavaScriptMessage. |
| 1996 string16 ignored_result; | 1996 string16 ignored_result; |
| 1997 SendAndRunNestedMessageLoop(new ViewHostMsg_RunBeforeUnloadConfirm( | 1997 SendAndRunNestedMessageLoop(new ViewHostMsg_RunBeforeUnloadConfirm( |
| 1998 routing_id_, frame->document().url(), message, is_reload, | 1998 routing_id_, frame->document().url(), message, is_reload, |
| 1999 &success, &ignored_result)); | 1999 &success, &ignored_result)); |
| 2000 return success; | 2000 return success; |
| 2001 } | 2001 } |
| 2002 | 2002 |
| 2003 void RenderViewImpl::showContextMenu( | 2003 void RenderViewImpl::showContextMenu( |
| 2004 WebFrame* frame, const WebContextMenuData& data) { | 2004 WebFrame* frame, const WebContextMenuData& data) { |
| 2005 // TODO(fsamuel): In the future, we might want the embedder to be able to | |
| 2006 // decide whether the guest can show a context menu or not. | |
|
jam
2012/06/22 20:43:05
nit: put the bug number here
| |
| 2007 if (GetGuestToEmbedderChannel()) | |
| 2008 return; | |
|
Charlie Reis
2012/06/22 19:55:23
I'm not 100% sure that the renderer isn't expectin
Fady Samuel
2012/06/22 20:03:44
OK. This seems to work OK. A good fix with an API
| |
| 2009 | |
| 2005 content::ContextMenuParams params(data); | 2010 content::ContextMenuParams params(data); |
| 2006 | 2011 |
| 2007 // frame is NULL if invoked by BlockedPlugin. | 2012 // frame is NULL if invoked by BlockedPlugin. |
| 2008 if (frame) | 2013 if (frame) |
| 2009 params.frame_id = frame->identifier(); | 2014 params.frame_id = frame->identifier(); |
| 2010 | 2015 |
| 2011 // Serializing a GURL longer than content::kMaxURLChars will fail, so don't do | 2016 // Serializing a GURL longer than content::kMaxURLChars will fail, so don't do |
| 2012 // it. We replace it with an empty GURL so the appropriate items are disabled | 2017 // it. We replace it with an empty GURL so the appropriate items are disabled |
| 2013 // in the context menu. | 2018 // in the context menu. |
| 2014 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large | 2019 // TODO(jcivelli): http://crbug.com/45160 This prevents us from saving large |
| (...skipping 3662 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 5677 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { | 5682 bool RenderViewImpl::WebWidgetHandlesCompositorScheduling() const { |
| 5678 return !!RenderThreadImpl::current()->compositor_thread(); | 5683 return !!RenderThreadImpl::current()->compositor_thread(); |
| 5679 } | 5684 } |
| 5680 | 5685 |
| 5681 void RenderViewImpl::OnJavaBridgeInit() { | 5686 void RenderViewImpl::OnJavaBridgeInit() { |
| 5682 DCHECK(!java_bridge_dispatcher_); | 5687 DCHECK(!java_bridge_dispatcher_); |
| 5683 #if defined(ENABLE_JAVA_BRIDGE) | 5688 #if defined(ENABLE_JAVA_BRIDGE) |
| 5684 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); | 5689 java_bridge_dispatcher_ = new JavaBridgeDispatcher(this); |
| 5685 #endif | 5690 #endif |
| 5686 } | 5691 } |
| OLD | NEW |