| OLD | NEW | 
|    1 // Copyright 2014 The Chromium Authors. All rights reserved. |    1 // Copyright 2014 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/frame_host/render_widget_host_view_child_frame.h" |    5 #include "content/browser/frame_host/render_widget_host_view_child_frame.h" | 
|    6  |    6  | 
|    7 #include "base/command_line.h" |  | 
|    8 #include "cc/surfaces/surface.h" |    7 #include "cc/surfaces/surface.h" | 
|    9 #include "cc/surfaces/surface_factory.h" |    8 #include "cc/surfaces/surface_factory.h" | 
|   10 #include "cc/surfaces/surface_manager.h" |    9 #include "cc/surfaces/surface_manager.h" | 
|   11 #include "cc/surfaces/surface_sequence.h" |   10 #include "cc/surfaces/surface_sequence.h" | 
|   12 #include "content/browser/accessibility/browser_accessibility_manager.h" |   11 #include "content/browser/accessibility/browser_accessibility_manager.h" | 
|   13 #include "content/browser/browser_plugin/browser_plugin_guest.h" |   12 #include "content/browser/browser_plugin/browser_plugin_guest.h" | 
|   14 #include "content/browser/compositor/surface_utils.h" |   13 #include "content/browser/compositor/surface_utils.h" | 
|   15 #include "content/browser/frame_host/cross_process_frame_connector.h" |   14 #include "content/browser/frame_host/cross_process_frame_connector.h" | 
|   16 #include "content/browser/gpu/compositor_util.h" |   15 #include "content/browser/gpu/compositor_util.h" | 
|   17 #include "content/browser/renderer_host/render_view_host_impl.h" |   16 #include "content/browser/renderer_host/render_view_host_impl.h" | 
|   18 #include "content/browser/renderer_host/render_widget_host_impl.h" |   17 #include "content/browser/renderer_host/render_widget_host_impl.h" | 
|   19 #include "content/common/gpu/gpu_messages.h" |   18 #include "content/common/gpu/gpu_messages.h" | 
|   20 #include "content/common/view_messages.h" |   19 #include "content/common/view_messages.h" | 
|   21 #include "content/public/browser/render_process_host.h" |   20 #include "content/public/browser/render_process_host.h" | 
|   22 #include "content/public/common/content_switches.h" |   21 #include "content/public/common/browser_plugin_guest_mode.h" | 
|   23  |   22  | 
|   24 namespace content { |   23 namespace content { | 
|   25  |   24  | 
|   26 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( |   25 RenderWidgetHostViewChildFrame::RenderWidgetHostViewChildFrame( | 
|   27     RenderWidgetHost* widget_host) |   26     RenderWidgetHost* widget_host) | 
|   28     : host_(RenderWidgetHostImpl::From(widget_host)), |   27     : host_(RenderWidgetHostImpl::From(widget_host)), | 
|   29       use_surfaces_(UseSurfacesEnabled()), |   28       use_surfaces_(UseSurfacesEnabled()), | 
|   30       next_surface_sequence_(1u), |   29       next_surface_sequence_(1u), | 
|   31       last_output_surface_id_(0), |   30       last_output_surface_id_(0), | 
|   32       current_surface_scale_factor_(1.f), |   31       current_surface_scale_factor_(1.f), | 
| (...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  153  |  152  | 
|  154 void RenderWidgetHostViewChildFrame::UpdateCursor(const WebCursor& cursor) { |  153 void RenderWidgetHostViewChildFrame::UpdateCursor(const WebCursor& cursor) { | 
|  155 } |  154 } | 
|  156  |  155  | 
|  157 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { |  156 void RenderWidgetHostViewChildFrame::SetIsLoading(bool is_loading) { | 
|  158   // It is valid for an inner WebContents's SetIsLoading() to end up here. |  157   // It is valid for an inner WebContents's SetIsLoading() to end up here. | 
|  159   // This is because an inner WebContents's main frame's RenderWidgetHostView |  158   // This is because an inner WebContents's main frame's RenderWidgetHostView | 
|  160   // is a RenderWidgetHostViewChildFrame. In contrast, when there is no |  159   // is a RenderWidgetHostViewChildFrame. In contrast, when there is no | 
|  161   // inner/outer WebContents, only subframe's RenderWidgetHostView can be a |  160   // inner/outer WebContents, only subframe's RenderWidgetHostView can be a | 
|  162   // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. |  161   // RenderWidgetHostViewChildFrame which do not get a SetIsLoading() call. | 
|  163   if (base::CommandLine::ForCurrentProcess()->HasSwitch( |  162   if (BrowserPluginGuestMode::UseCrossProcessFramesForGuests() && | 
|  164           switches::kSitePerProcess) && |  | 
|  165       BrowserPluginGuest::IsGuest( |  163       BrowserPluginGuest::IsGuest( | 
|  166           static_cast<RenderViewHostImpl*>(RenderViewHost::From(host_)))) { |  164           static_cast<RenderViewHostImpl*>(RenderViewHost::From(host_)))) { | 
|  167     return; |  165     return; | 
|  168   } |  166   } | 
|  169  |  167  | 
|  170   NOTREACHED(); |  168   NOTREACHED(); | 
|  171 } |  169 } | 
|  172  |  170  | 
|  173 void RenderWidgetHostViewChildFrame::TextInputTypeChanged( |  171 void RenderWidgetHostViewChildFrame::TextInputTypeChanged( | 
|  174     ui::TextInputType type, |  172     ui::TextInputType type, | 
| (...skipping 257 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  432       BrowserAccessibilityManager::GetEmptyDocument(), delegate); |  430       BrowserAccessibilityManager::GetEmptyDocument(), delegate); | 
|  433 } |  431 } | 
|  434  |  432  | 
|  435 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { |  433 void RenderWidgetHostViewChildFrame::ClearCompositorSurfaceIfNecessary() { | 
|  436   if (surface_factory_ && !surface_id_.is_null()) |  434   if (surface_factory_ && !surface_id_.is_null()) | 
|  437     surface_factory_->Destroy(surface_id_); |  435     surface_factory_->Destroy(surface_id_); | 
|  438   surface_id_ = cc::SurfaceId(); |  436   surface_id_ = cc::SurfaceId(); | 
|  439 } |  437 } | 
|  440  |  438  | 
|  441 }  // namespace content |  439 }  // namespace content | 
| OLD | NEW |