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 22 matching lines...) Expand all Loading... |
33 #include "content/public/browser/web_contents_observer.h" | 33 #include "content/public/browser/web_contents_observer.h" |
34 #include "content/public/browser/web_contents_view_delegate.h" | 34 #include "content/public/browser/web_contents_view_delegate.h" |
35 #include "content/public/browser/web_drag_dest_delegate.h" | 35 #include "content/public/browser/web_drag_dest_delegate.h" |
36 #include "content/public/common/content_switches.h" | 36 #include "content/public/common/content_switches.h" |
37 #include "content/public/common/drop_data.h" | 37 #include "content/public/common/drop_data.h" |
38 #include "net/base/net_util.h" | 38 #include "net/base/net_util.h" |
39 #include "third_party/WebKit/public/web/WebInputEvent.h" | 39 #include "third_party/WebKit/public/web/WebInputEvent.h" |
40 #include "ui/aura/client/aura_constants.h" | 40 #include "ui/aura/client/aura_constants.h" |
41 #include "ui/aura/client/drag_drop_client.h" | 41 #include "ui/aura/client/drag_drop_client.h" |
42 #include "ui/aura/client/drag_drop_delegate.h" | 42 #include "ui/aura/client/drag_drop_delegate.h" |
| 43 #include "ui/aura/client/window_tree_client.h" |
43 #include "ui/aura/env.h" | 44 #include "ui/aura/env.h" |
44 #include "ui/aura/root_window.h" | 45 #include "ui/aura/root_window.h" |
45 #include "ui/aura/root_window_observer.h" | 46 #include "ui/aura/root_window_observer.h" |
46 #include "ui/aura/window.h" | 47 #include "ui/aura/window.h" |
47 #include "ui/aura/window_observer.h" | 48 #include "ui/aura/window_observer.h" |
48 #include "ui/base/clipboard/clipboard.h" | 49 #include "ui/base/clipboard/clipboard.h" |
49 #include "ui/base/clipboard/custom_data_helper.h" | 50 #include "ui/base/clipboard/custom_data_helper.h" |
50 #include "ui/base/dragdrop/drag_drop_types.h" | 51 #include "ui/base/dragdrop/drag_drop_types.h" |
51 #include "ui/base/dragdrop/drag_utils.h" | 52 #include "ui/base/dragdrop/drag_utils.h" |
52 #include "ui/base/dragdrop/drop_target_event.h" | 53 #include "ui/base/dragdrop/drop_target_event.h" |
(...skipping 1100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1153 if (root_window) { | 1154 if (root_window) { |
1154 // There are places where there is no context currently because object | 1155 // There are places where there is no context currently because object |
1155 // hierarchies are built before they're attached to a Widget. (See | 1156 // hierarchies are built before they're attached to a Widget. (See |
1156 // views::WebView as an example; GetWidget() returns NULL at the point | 1157 // views::WebView as an example; GetWidget() returns NULL at the point |
1157 // where we are created.) | 1158 // where we are created.) |
1158 // | 1159 // |
1159 // It should be OK to not set a default parent since such users will | 1160 // It should be OK to not set a default parent since such users will |
1160 // explicitly add this WebContentsViewAura to their tree after they create | 1161 // explicitly add this WebContentsViewAura to their tree after they create |
1161 // us. | 1162 // us. |
1162 if (root_window) { | 1163 if (root_window) { |
1163 window_->SetDefaultParentByRootWindow( | 1164 aura::client::ParentWindowWithContext( |
1164 root_window, root_window->GetBoundsInScreen()); | 1165 window_.get(), root_window, root_window->GetBoundsInScreen()); |
1165 } | 1166 } |
1166 } | 1167 } |
1167 window_->layer()->SetMasksToBounds(true); | 1168 window_->layer()->SetMasksToBounds(true); |
1168 window_->SetName("WebContentsViewAura"); | 1169 window_->SetName("WebContentsViewAura"); |
1169 | 1170 |
1170 window_observer_.reset(new WindowObserver(this)); | 1171 window_observer_.reset(new WindowObserver(this)); |
1171 #if defined(OS_WIN) | 1172 #if defined(OS_WIN) |
1172 child_window_observer_.reset(new ChildWindowObserver(this)); | 1173 child_window_observer_.reset(new ChildWindowObserver(this)); |
1173 #endif | 1174 #endif |
1174 | 1175 |
(...skipping 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 event.location(), | 1636 event.location(), |
1636 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1637 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
1637 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1638 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
1638 if (drag_dest_delegate_) | 1639 if (drag_dest_delegate_) |
1639 drag_dest_delegate_->OnDrop(); | 1640 drag_dest_delegate_->OnDrop(); |
1640 current_drop_data_.reset(); | 1641 current_drop_data_.reset(); |
1641 return current_drag_op_; | 1642 return current_drag_op_; |
1642 } | 1643 } |
1643 | 1644 |
1644 } // namespace content | 1645 } // namespace content |
OLD | NEW |