summaryrefslogtreecommitdiffstats
path: root/views
diff options
context:
space:
mode:
authorsky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 15:53:16 +0000
committersky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-10-26 15:53:16 +0000
commite9ddb1563eeadd3f9eb4951e1260ada1a5c8ff9b (patch)
treee33da5b840a5a0750b764b00ca45976056bedf34 /views
parent1d8335300f99ee0d0ba5450e706d9307699a1c7b (diff)
downloadchromium_src-e9ddb1563eeadd3f9eb4951e1260ada1a5c8ff9b.zip
chromium_src-e9ddb1563eeadd3f9eb4951e1260ada1a5c8ff9b.tar.gz
chromium_src-e9ddb1563eeadd3f9eb4951e1260ada1a5c8ff9b.tar.bz2
Changes Window::Init to take whether the layer has a texture. And
wired it up to Widget by way of new field in Widget::InitParam. BUG=none TEST=none R=ben@chromium.org Review URL: http://codereview.chromium.org/8392005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@107354 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r--views/aura_desktop/aura_desktop_main.cc6
-rw-r--r--views/widget/native_widget_aura.cc3
-rw-r--r--views/widget/widget.cc6
-rw-r--r--views/widget/widget.h3
4 files changed, 12 insertions, 6 deletions
diff --git a/views/aura_desktop/aura_desktop_main.cc b/views/aura_desktop/aura_desktop_main.cc
index 664d0db..d2a37b7 100644
--- a/views/aura_desktop/aura_desktop_main.cc
+++ b/views/aura_desktop/aura_desktop_main.cc
@@ -149,7 +149,7 @@ int main(int argc, char** argv) {
DemoWindowDelegate window_delegate1(SK_ColorBLUE);
aura::Window* window1 = new aura::Window(&window_delegate1);
window1->set_id(1);
- window1->Init();
+ window1->Init(ui::Layer::LAYER_HAS_TEXTURE);
window1->SetBounds(gfx::Rect(100, 100, 400, 400));
window1->Show();
window1->SetParent(NULL);
@@ -157,7 +157,7 @@ int main(int argc, char** argv) {
DemoWindowDelegate window_delegate2(SK_ColorRED);
aura::Window* window2 = new aura::Window(&window_delegate2);
window2->set_id(2);
- window2->Init();
+ window2->Init(ui::Layer::LAYER_HAS_TEXTURE);
window2->SetBounds(gfx::Rect(200, 200, 350, 350));
window2->Show();
window2->SetParent(NULL);
@@ -165,7 +165,7 @@ int main(int argc, char** argv) {
DemoWindowDelegate window_delegate3(SK_ColorGREEN);
aura::Window* window3 = new aura::Window(&window_delegate3);
window3->set_id(3);
- window3->Init();
+ window3->Init(ui::Layer::LAYER_HAS_TEXTURE);
window3->SetBounds(gfx::Rect(10, 10, 50, 50));
window3->Show();
window3->SetParent(window2);
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index 4d0da79..b1a1c41 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -78,7 +78,8 @@ void NativeWidgetAura::InitNativeWidget(const Widget::InitParams& params) {
SetNativeWindowProperty(kWindowTypeKey, reinterpret_cast<void*>(window_type));
window_->SetType(window_type == Widget::InitParams::TYPE_CONTROL ?
aura::kWindowType_Control : aura::kWindowType_None);
- window_->Init();
+ window_->Init(params.create_texture_for_layer ?
+ ui::Layer::LAYER_HAS_TEXTURE : ui::Layer::LAYER_HAS_NO_TEXTURE);
// TODO(beng): respect |params| authoritah wrt transparency.
window_->layer()->SetFillsBoundsOpaquely(false);
delegate_->OnNativeWidgetCreated();
diff --git a/views/widget/widget.cc b/views/widget/widget.cc
index 4060abb..891bafd 100644
--- a/views/widget/widget.cc
+++ b/views/widget/widget.cc
@@ -120,7 +120,8 @@ Widget::InitParams::InitParams()
parent(NULL),
parent_widget(NULL),
native_widget(NULL),
- top_level(false) {
+ top_level(false),
+ create_texture_for_layer(true) {
}
Widget::InitParams::InitParams(Type type)
@@ -140,7 +141,8 @@ Widget::InitParams::InitParams(Type type)
parent(NULL),
parent_widget(NULL),
native_widget(NULL),
- top_level(false) {
+ top_level(false),
+ create_texture_for_layer(true) {
}
gfx::NativeView Widget::InitParams::GetParent() const {
diff --git a/views/widget/widget.h b/views/widget/widget.h
index 82865da..d4b4f37 100644
--- a/views/widget/widget.h
+++ b/views/widget/widget.h
@@ -163,6 +163,9 @@ class VIEWS_EXPORT Widget : public internal::NativeWidgetDelegate,
// The Widget will not construct a default one. Default is NULL.
NativeWidget* native_widget;
bool top_level;
+ // Only used by NativeWidgetAura. Specifies whether the Layer created by
+ // aura::Window has a texture. The default is true.
+ bool create_texture_for_layer;
};
Widget();