Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(197)

Side by Side Diff: content/browser/web_contents/web_contents_view_aura.cc

Issue 11829040: Fix the content_browsertests everywhere maybe. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase to ToT Created 7 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 723 matching lines...) Expand 10 before | Expand all | Expand 10 after
734 const gfx::Size& initial_size, gfx::NativeView context) { 734 const gfx::Size& initial_size, gfx::NativeView context) {
735 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as 735 // NOTE: we ignore |initial_size| since in some cases it's wrong (such as
736 // if the bookmark bar is not shown and you create a new tab). The right 736 // if the bookmark bar is not shown and you create a new tab). The right
737 // value is set shortly after this, so its safe to ignore. 737 // value is set shortly after this, so its safe to ignore.
738 738
739 window_.reset(new aura::Window(this)); 739 window_.reset(new aura::Window(this));
740 window_->set_owned_by_parent(false); 740 window_->set_owned_by_parent(false);
741 window_->SetType(aura::client::WINDOW_TYPE_CONTROL); 741 window_->SetType(aura::client::WINDOW_TYPE_CONTROL);
742 window_->SetTransparent(false); 742 window_->SetTransparent(false);
743 window_->Init(ui::LAYER_NOT_DRAWN); 743 window_->Init(ui::LAYER_NOT_DRAWN);
744 // TODO(mukai, erg): Should use a non-NULL value later when the DCHECK is 744 if (context) {
745 // turned on in SetDefaultParentByRootWindow(). 745 // There are places where there is no context currently because object
746 aura::RootWindow* target_root = context ? context->GetRootWindow() : NULL; 746 // hierarchies are built before they're attached to a Widget. (See
747 window_->SetDefaultParentByRootWindow(target_root, gfx::Rect()); 747 // views::WebView as an example; GetWidget() returns NULL at the point
748 // where we are created.)
749 //
750 // It should be OK to not set a default parent since such users will
751 // explicitly add this WebContentsViewAura to their tree after they create
752 // us.
753 window_->SetDefaultParentByRootWindow(context->GetRootWindow(),
754 gfx::Rect());
755 }
748 window_->layer()->SetMasksToBounds(true); 756 window_->layer()->SetMasksToBounds(true);
749 window_->SetName("WebContentsViewAura"); 757 window_->SetName("WebContentsViewAura");
750 758
751 window_observer_.reset(new WindowObserver(this)); 759 window_observer_.reset(new WindowObserver(this));
752 760
753 // delegate_->GetDragDestDelegate() creates a new delegate on every call. 761 // delegate_->GetDragDestDelegate() creates a new delegate on every call.
754 // Hence, we save a reference to it locally. Similar model is used on other 762 // Hence, we save a reference to it locally. Similar model is used on other
755 // platforms as well. 763 // platforms as well.
756 if (delegate_.get()) 764 if (delegate_.get())
757 drag_dest_delegate_ = delegate_->GetDragDestDelegate(); 765 drag_dest_delegate_ = delegate_->GetDragDestDelegate();
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
1229 event.location(), 1237 event.location(),
1230 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(), 1238 gfx::Screen::GetScreenFor(GetNativeView())->GetCursorScreenPoint(),
1231 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags())); 1239 ConvertAuraEventFlagsToWebInputEventModifiers(event.flags()));
1232 if (drag_dest_delegate_) 1240 if (drag_dest_delegate_)
1233 drag_dest_delegate_->OnDrop(); 1241 drag_dest_delegate_->OnDrop();
1234 current_drop_data_.reset(); 1242 current_drop_data_.reset();
1235 return current_drag_op_; 1243 return current_drag_op_;
1236 } 1244 }
1237 1245
1238 } // namespace content 1246 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_widget_host_view_aura.cc ('k') | content/content_shell.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698