| OLD | NEW |
| 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_aura.h" | 5 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_aura.h" |
| 6 | 6 |
| 7 #include "base/event_types.h" | 7 #include "base/event_types.h" |
| 8 #include "base/message_loop.h" | 8 #include "base/message_loop.h" |
| 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" | 9 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_view_delegate
.h" |
| 10 #include "content/browser/renderer_host/render_view_host.h" | 10 #include "content/browser/renderer_host/render_view_host.h" |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 } | 136 } |
| 137 | 137 |
| 138 TabContents* NativeTabContentsViewAura::GetTabContents() const { | 138 TabContents* NativeTabContentsViewAura::GetTabContents() const { |
| 139 return delegate_->GetTabContents(); | 139 return delegate_->GetTabContents(); |
| 140 } | 140 } |
| 141 | 141 |
| 142 //////////////////////////////////////////////////////////////////////////////// | 142 //////////////////////////////////////////////////////////////////////////////// |
| 143 // NativeTabContentsViewAura, NativeTabContentsView implementation: | 143 // NativeTabContentsViewAura, NativeTabContentsView implementation: |
| 144 | 144 |
| 145 void NativeTabContentsViewAura::InitNativeTabContentsView() { | 145 void NativeTabContentsViewAura::InitNativeTabContentsView() { |
| 146 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 146 views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); |
| 147 params.native_widget = this; | 147 params.native_widget = this; |
| 148 // We don't draw anything so we don't need a texture. | 148 // We don't draw anything so we don't need a texture. |
| 149 params.create_texture_for_layer = false; | 149 params.create_texture_for_layer = false; |
| 150 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; | 150 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; |
| 151 params.parent = NULL; | 151 params.parent = NULL; |
| 152 GetWidget()->Init(params); | 152 GetWidget()->Init(params); |
| 153 | 153 |
| 154 // Hide the widget to prevent it from showing up on the desktop. This is | 154 // Hide the widget to prevent it from showing up on the desktop. This is |
| 155 // needed for TabContentses that aren't immediately added to the tabstrip, | 155 // needed for TabContentses that aren't immediately added to the tabstrip, |
| 156 // e.g. the Instant preview contents. | 156 // e.g. the Instant preview contents. |
| (...skipping 161 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 318 } | 318 } |
| 319 | 319 |
| 320 //////////////////////////////////////////////////////////////////////////////// | 320 //////////////////////////////////////////////////////////////////////////////// |
| 321 // NativeTabContentsView, public: | 321 // NativeTabContentsView, public: |
| 322 | 322 |
| 323 // static | 323 // static |
| 324 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( | 324 NativeTabContentsView* NativeTabContentsView::CreateNativeTabContentsView( |
| 325 internal::NativeTabContentsViewDelegate* delegate) { | 325 internal::NativeTabContentsViewDelegate* delegate) { |
| 326 return new NativeTabContentsViewAura(delegate); | 326 return new NativeTabContentsViewAura(delegate); |
| 327 } | 327 } |
| OLD | NEW |