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/web_contents/web_contents_view_aura.h" | 5 #include "content/browser/web_contents/web_contents_view_aura.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 1201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1212 // explicitly add this WebContentsViewAura to their tree after they create | 1212 // explicitly add this WebContentsViewAura to their tree after they create |
1213 // us. | 1213 // us. |
1214 if (root_window) { | 1214 if (root_window) { |
1215 aura::client::ParentWindowWithContext( | 1215 aura::client::ParentWindowWithContext( |
1216 window_.get(), root_window, root_window->GetBoundsInScreen()); | 1216 window_.get(), root_window, root_window->GetBoundsInScreen()); |
1217 } | 1217 } |
1218 } | 1218 } |
1219 window_->layer()->SetMasksToBounds(true); | 1219 window_->layer()->SetMasksToBounds(true); |
1220 window_->SetName("WebContentsViewAura"); | 1220 window_->SetName("WebContentsViewAura"); |
1221 | 1221 |
1222 window_observer_.reset(new WindowObserver(this)); | 1222 // WindowObserver is not interesting and is problematic for Browser Plugin |
| 1223 // guests. |
| 1224 // The use cases for WindowObserver do not apply to Browser Plugins: |
| 1225 // 1) guests do not support NPAPI plugins. |
| 1226 // 2) guests' window bounds are supposed to come from its embedder. |
| 1227 if (!web_contents_->GetRenderProcessHost()->IsGuest()) |
| 1228 window_observer_.reset(new WindowObserver(this)); |
1223 | 1229 |
1224 // delegate_->GetDragDestDelegate() creates a new delegate on every call. | 1230 // delegate_->GetDragDestDelegate() creates a new delegate on every call. |
1225 // Hence, we save a reference to it locally. Similar model is used on other | 1231 // Hence, we save a reference to it locally. Similar model is used on other |
1226 // platforms as well. | 1232 // platforms as well. |
1227 if (delegate_) | 1233 if (delegate_) |
1228 drag_dest_delegate_ = delegate_->GetDragDestDelegate(); | 1234 drag_dest_delegate_ = delegate_->GetDragDestDelegate(); |
1229 } | 1235 } |
1230 | 1236 |
1231 RenderWidgetHostView* WebContentsViewAura::CreateViewForWidget( | 1237 RenderWidgetHostView* WebContentsViewAura::CreateViewForWidget( |
1232 RenderWidgetHost* render_widget_host) { | 1238 RenderWidgetHost* render_widget_host) { |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1698 event.location(), | 1704 event.location(), |
1699 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1705 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1700 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1706 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1701 if (drag_dest_delegate_) | 1707 if (drag_dest_delegate_) |
1702 drag_dest_delegate_->OnDrop(); | 1708 drag_dest_delegate_->OnDrop(); |
1703 current_drop_data_.reset(); | 1709 current_drop_data_.reset(); |
1704 return current_drag_op_; | 1710 return current_drag_op_; |
1705 } | 1711 } |
1706 | 1712 |
1707 } // namespace content | 1713 } // namespace content |
OLD | NEW |