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/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
9 #include "content/browser/renderer_host/dip_util.h" | 9 #include "content/browser/renderer_host/dip_util.h" |
10 #include "content/browser/renderer_host/overscroll_controller.h" | 10 #include "content/browser/renderer_host/overscroll_controller.h" |
(...skipping 486 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
497 void WebContentsViewAura::CreateView(const gfx::Size& initial_size) { | 497 void WebContentsViewAura::CreateView(const gfx::Size& initial_size) { |
498 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as | 498 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as |
499 // if the bookmark bar is not shown and you create a new tab). The right | 499 // if the bookmark bar is not shown and you create a new tab). The right |
500 // value is set shortly after this, so its safe to ignore. | 500 // value is set shortly after this, so its safe to ignore. |
501 | 501 |
502 window_.reset(new aura::Window(this)); | 502 window_.reset(new aura::Window(this)); |
503 window_->set_owned_by_parent(false); | 503 window_->set_owned_by_parent(false); |
504 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); | 504 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); |
505 window_->SetTransparent(false); | 505 window_->SetTransparent(false); |
506 window_->Init(ui::LAYER_NOT_DRAWN); | 506 window_->Init(ui::LAYER_NOT_DRAWN); |
507 window_->SetParent(NULL); | 507 // TODO(erg): Do something else here later. |
| 508 window_->SetDefaultParentByRootWindow(NULL, gfx::Rect()); |
508 window_->layer()->SetMasksToBounds(true); | 509 window_->layer()->SetMasksToBounds(true); |
509 window_->SetName("WebContentsViewAura"); | 510 window_->SetName("WebContentsViewAura"); |
510 | 511 |
511 window_observer_.reset(new WindowObserver(this)); | 512 window_observer_.reset(new WindowObserver(this)); |
512 | 513 |
513 // delegate_->GetDragDestDelegate() creates a new delegate on every call. | 514 // delegate_->GetDragDestDelegate() creates a new delegate on every call. |
514 // Hence, we save a reference to it locally. Similar model is used on other | 515 // Hence, we save a reference to it locally. Similar model is used on other |
515 // platforms as well. | 516 // platforms as well. |
516 if (delegate_.get()) | 517 if (delegate_.get()) |
517 drag_dest_delegate_ = delegate_->GetDragDestDelegate(); | 518 drag_dest_delegate_ = delegate_->GetDragDestDelegate(); |
(...skipping 472 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
990 event.location(), | 991 event.location(), |
991 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), | 992 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), |
992 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); | 993 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); |
993 if (drag_dest_delegate_) | 994 if (drag_dest_delegate_) |
994 drag_dest_delegate_->OnDrop(); | 995 drag_dest_delegate_->OnDrop(); |
995 current_drop_data_.reset(); | 996 current_drop_data_.reset(); |
996 return current_drag_op_; | 997 return current_drag_op_; |
997 } | 998 } |
998 | 999 |
999 } // namespace content | 1000 } // namespace content |
OLD | NEW |