| 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/env.h" |
| 43 #include "ui/aura/root_window.h" | 44 #include "ui/aura/root_window.h" |
| 44 #include "ui/aura/root_window_observer.h" | 45 #include "ui/aura/root_window_observer.h" |
| 45 #include "ui/aura/window.h" | 46 #include "ui/aura/window.h" |
| 46 #include "ui/aura/window_observer.h" | 47 #include "ui/aura/window_observer.h" |
| 47 #include "ui/base/clipboard/clipboard.h" | 48 #include "ui/base/clipboard/clipboard.h" |
| 48 #include "ui/base/clipboard/custom_data_helper.h" | 49 #include "ui/base/clipboard/custom_data_helper.h" |
| 49 #include "ui/base/dragdrop/drag_drop_types.h" | 50 #include "ui/base/dragdrop/drag_drop_types.h" |
| 50 #include "ui/base/dragdrop/drag_utils.h" | 51 #include "ui/base/dragdrop/drag_utils.h" |
| 51 #include "ui/base/dragdrop/os_exchange_data.h" | 52 #include "ui/base/dragdrop/os_exchange_data.h" |
| 52 #include "ui/base/hit_test.h" | 53 #include "ui/base/hit_test.h" |
| (...skipping 1081 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1134 | 1135 |
| 1135 //////////////////////////////////////////////////////////////////////////////// | 1136 //////////////////////////////////////////////////////////////////////////////// |
| 1136 // WebContentsViewAura, WebContentsViewPort implementation: | 1137 // WebContentsViewAura, WebContentsViewPort implementation: |
| 1137 | 1138 |
| 1138 void WebContentsViewAura::CreateView( | 1139 void WebContentsViewAura::CreateView( |
| 1139 const gfx::Size& initial_size, gfx::NativeView context) { | 1140 const gfx::Size& initial_size, gfx::NativeView context) { |
| 1140 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as | 1141 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as |
| 1141 // if the bookmark bar is not shown and you create a new tab). The right | 1142 // if the bookmark bar is not shown and you create a new tab). The right |
| 1142 // value is set shortly after this, so its safe to ignore. | 1143 // value is set shortly after this, so its safe to ignore. |
| 1143 | 1144 |
| 1145 aura::Env::CreateInstance(); |
| 1144 window_.reset(new aura::Window(this)); | 1146 window_.reset(new aura::Window(this)); |
| 1145 window_->set_owned_by_parent(false); | 1147 window_->set_owned_by_parent(false); |
| 1146 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); | 1148 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); |
| 1147 window_->SetTransparent(false); | 1149 window_->SetTransparent(false); |
| 1148 window_->Init(ui::LAYER_NOT_DRAWN); | 1150 window_->Init(ui::LAYER_NOT_DRAWN); |
| 1149 aura::RootWindow* root_window = context ? context->GetRootWindow() : NULL; | 1151 aura::RootWindow* root_window = context ? context->GetRootWindow() : NULL; |
| 1150 if (root_window) { | 1152 if (root_window) { |
| 1151 // There are places where there is no context currently because object | 1153 // There are places where there is no context currently because object |
| 1152 // hierarchies are built before they're attached to a Widget. (See | 1154 // hierarchies are built before they're attached to a Widget. (See |
| 1153 // views::WebView as an example; GetWidget() returns NULL at the point | 1155 // views::WebView as an example; GetWidget() returns NULL at the point |
| (...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1632 event.location(), | 1634 event.location(), |
| 1633 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 1635 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
| 1634 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 1636 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
| 1635 if (drag_dest_delegate_) | 1637 if (drag_dest_delegate_) |
| 1636 drag_dest_delegate_->OnDrop(); | 1638 drag_dest_delegate_->OnDrop(); |
| 1637 current_drop_data_.reset(); | 1639 current_drop_data_.reset(); |
| 1638 return current_drag_op_; | 1640 return current_drag_op_; |
| 1639 } | 1641 } |
| 1640 | 1642 |
| 1641 } // namespace content | 1643 } // namespace content |
| OLD | NEW |