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

Side by Side Diff: chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc

Issue 7031053: Make Widget ownership a little clearer by expressing it in terms of an enum. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years, 7 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h" 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.h"
6 6
7 #include "chrome/browser/renderer_host/render_widget_host_view_win.h" 7 #include "chrome/browser/renderer_host/render_widget_host_view_win.h"
8 #include "chrome/browser/tab_contents/web_drop_target_win.h" 8 #include "chrome/browser/tab_contents/web_drop_target_win.h"
9 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h" 9 #include "chrome/browser/ui/views/tab_contents/tab_contents_drag_win.h"
10 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate .h" 10 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate .h"
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
68 delegate_->OnNativeTabContentsViewDraggingEnded(); 68 delegate_->OnNativeTabContentsViewDraggingEnded();
69 drag_handler_ = NULL; 69 drag_handler_ = NULL;
70 } 70 }
71 71
72 //////////////////////////////////////////////////////////////////////////////// 72 ////////////////////////////////////////////////////////////////////////////////
73 // NativeTabContentsViewWin, NativeTabContentsView implementation: 73 // NativeTabContentsViewWin, NativeTabContentsView implementation:
74 74
75 void NativeTabContentsViewWin::InitNativeTabContentsView() { 75 void NativeTabContentsViewWin::InitNativeTabContentsView() {
76 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 76 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
77 params.native_widget = this; 77 params.native_widget = this;
78 params.delete_on_destroy = false; 78 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
79 params.parent = GetHiddenTabHostWindow(); 79 params.parent = GetHiddenTabHostWindow();
80 GetWidget()->Init(params); 80 GetWidget()->Init(params);
81 81
82 // Remove the root view drop target so we can register our own. 82 // Remove the root view drop target so we can register our own.
83 RevokeDragDrop(GetNativeView()); 83 RevokeDragDrop(GetNativeView());
84 drop_target_ = new WebDropTarget(GetNativeView(), 84 drop_target_ = new WebDropTarget(GetNativeView(),
85 delegate_->GetTabContents()); 85 delegate_->GetTabContents());
86 } 86 }
87 87
88 void NativeTabContentsViewWin::Unparent() { 88 void NativeTabContentsViewWin::Unparent() {
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 } 312 }
313 313
314 //////////////////////////////////////////////////////////////////////////////// 314 ////////////////////////////////////////////////////////////////////////////////
315 // NativeTabContentsView, public: 315 // NativeTabContentsView, public:
316 316
317 // static 317 // static
318 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( 318 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView(
319 internal::NativeTabContentsViewDelegate* delegate) { 319 internal::NativeTabContentsViewDelegate* delegate) {
320 return new NativeTabContentsViewWin(delegate); 320 return new NativeTabContentsViewWin(delegate);
321 } 321 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/tab_contents/native_tab_contents_view_gtk.cc ('k') | chrome/browser/ui/views/tabs/dragged_tab_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698