diff options
author | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 13:54:15 +0000 |
---|---|---|
committer | sky@chromium.org <sky@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-20 13:54:15 +0000 |
commit | 210568aa1b19093b31cdd23a817e935a7546b85e (patch) | |
tree | bcb9a84cdaa7377abb4530957b0e841fedc8c13b | |
parent | 4ca9bf65c4137fd59a7b1ca0bb0501fc6b3c8949 (diff) | |
download | chromium_src-210568aa1b19093b31cdd23a817e935a7546b85e.zip chromium_src-210568aa1b19093b31cdd23a817e935a7546b85e.tar.gz chromium_src-210568aa1b19093b31cdd23a817e935a7546b85e.tar.bz2 |
Changes the overview classes not to subclass WidgetGtk.
BUG=none
TEST=none
R=gspencer@chromium.org,ben@chromium.org
Review URL: http://codereview.chromium.org/6878056
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@82287 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r-- | chrome/browser/chromeos/wm_overview_controller.cc | 82 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_favicon.cc | 35 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_favicon.h | 13 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_snapshot.cc | 28 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_snapshot.h | 32 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_title.cc | 32 | ||||
-rw-r--r-- | chrome/browser/chromeos/wm_overview_title.h | 18 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 2 |
8 files changed, 140 insertions, 102 deletions
diff --git a/chrome/browser/chromeos/wm_overview_controller.cc b/chrome/browser/chromeos/wm_overview_controller.cc index fed086a..f372222 100644 --- a/chrome/browser/chromeos/wm_overview_controller.cc +++ b/chrome/browser/chromeos/wm_overview_controller.cc @@ -8,6 +8,7 @@ #include <vector> #include "base/memory/linked_ptr.h" +#include "base/stl_util-inl.h" #include "chrome/browser/browser_process.h" #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/chromeos/wm_overview_favicon.h" @@ -158,16 +159,18 @@ class BrowserListener : public TabStripModelObserver { // Which renderer host we are working on. RenderWidgetHost* current_renderer_host_; // Not owned - // Widgets containing snapshot images for this browser. Note that - // these are all subclasses of WidgetGtk, and they are all added to - // parents, so they will be deleted by the parents when they are - // closed. + // Widgets containing snapshot images for this browser. struct SnapshotNode { - WmOverviewSnapshot* snapshot; // Not owned - WmOverviewTitle* title; // Not owned - WmOverviewFavicon* favicon; // Not owned + SnapshotNode() {} + + WmOverviewSnapshot snapshot; + WmOverviewTitle title; + WmOverviewFavicon favicon; + + private: + DISALLOW_COPY_AND_ASSIGN(SnapshotNode); }; - typedef std::vector<SnapshotNode> SnapshotVector; + typedef std::vector<SnapshotNode*> SnapshotVector; SnapshotVector snapshots_; // Non-zero if we are currently setting the tab from within SelectTab. @@ -223,7 +226,7 @@ void BrowserListener::TabMoved(TabContentsWrapper* contents, // Need to reorder tab in the snapshots list, and reset the window // type atom on the affected snapshots (the one moved, and all the // ones after it), so that their indices are correct. - SnapshotNode node = snapshots_[from_index]; + SnapshotNode* node = snapshots_[from_index]; snapshots_.erase(snapshots_.begin() + from_index); snapshots_.insert(snapshots_.begin() + to_index, node); @@ -236,9 +239,9 @@ void BrowserListener::TabChangedAt( int index, TabStripModelObserver::TabChangeType change_type) { if (change_type != TabStripModelObserver::LOADING_ONLY) { - snapshots_[index].title->SetTitle(contents->tab_contents()->GetTitle()); - snapshots_[index].title->SetUrl(contents->tab_contents()->GetURL()); - snapshots_[index].favicon->SetFavicon( + snapshots_[index]->title.SetTitle(contents->tab_contents()->GetTitle()); + snapshots_[index]->title.SetUrl(contents->tab_contents()->GetURL()); + snapshots_[index]->favicon.SetFavicon( contents->tab_contents()->GetFavicon()); if (change_type != TabStripModelObserver::TITLE_NOT_LOADING) MarkSnapshotAsDirty(index); @@ -246,7 +249,7 @@ void BrowserListener::TabChangedAt( } void BrowserListener::TabStripEmpty() { - snapshots_.clear(); + STLDeleteElements(&snapshots_); } void BrowserListener::TabSelectedAt(TabContentsWrapper* old_contents, @@ -260,12 +263,12 @@ void BrowserListener::TabSelectedAt(TabContentsWrapper* old_contents, } void BrowserListener::MarkSnapshotAsDirty(int index) { - snapshots_[index].snapshot->reload_snapshot(); + snapshots_[index]->snapshot.reload_snapshot(); controller_->UpdateSnapshots(); } void BrowserListener::RecreateSnapshots() { - snapshots_.clear(); + STLDeleteElements(&snapshots_); for (int i = 0; i < count(); ++i) InsertSnapshot(i); @@ -293,9 +296,9 @@ void BrowserListener::UpdateSelectedIndex(int index) { int BrowserListener::ConfigureNextUnconfiguredSnapshot(int start_from) { for (SnapshotVector::size_type i = start_from + 1; i < snapshots_.size(); ++i) { - WmOverviewSnapshot* cell = snapshots_[i].snapshot; - if (!cell->configured_snapshot()) { - ConfigureCell(cell, i); + WmOverviewSnapshot& cell = snapshots_[i]->snapshot; + if (!cell.configured_snapshot()) { + ConfigureCell(&cell, i); return i; } } @@ -311,13 +314,13 @@ void BrowserListener::RestoreOriginalSelectedTab() { void BrowserListener::ShowSnapshots() { for (SnapshotVector::size_type i = 0; i < snapshots_.size(); ++i) { - const SnapshotNode& node = snapshots_[i]; - if (!node.snapshot->IsVisible()) - node.snapshot->Show(); - if (!snapshots_[i].title->IsVisible()) - node.title->Show(); - if (!snapshots_[i].favicon->IsVisible()) - node.favicon->Show(); + SnapshotNode* node = snapshots_[i]; + if (!node->snapshot.widget()->IsVisible()) + node->snapshot.widget()->Show(); + if (!node->title.widget()->IsVisible()) + node->title.widget()->Show(); + if (!node->favicon.widget()->IsVisible()) + node->favicon.widget()->Show(); } } @@ -369,7 +372,7 @@ void BrowserListener::OnSnapshotReady(const SkBitmap& sk_bitmap) { RenderWidgetHostView* view = GetTabContentsAt(i)->GetRenderWidgetHostView(); if (view && view->GetRenderWidgetHost() == current_renderer_host_) { - snapshots_[i].snapshot->SetImage(sk_bitmap); + snapshots_[i]->snapshot.SetImage(sk_bitmap); current_renderer_host_ = NULL; // Start timer for next round of snapshot updating. @@ -417,39 +420,34 @@ void BrowserListener::ConfigureCell(WmOverviewSnapshot* cell, } void BrowserListener::InsertSnapshot(int index) { - SnapshotNode node; - node.snapshot = new WmOverviewSnapshot; + SnapshotNode* node = new SnapshotNode; gfx::Size cell_size = CalculateCellSize(); - node.snapshot->Init(cell_size, browser_, index); + node->snapshot.Init(cell_size, browser_, index); - node.favicon = new WmOverviewFavicon; - node.favicon->Init(node.snapshot); - node.favicon->SetFavicon(browser_->GetTabContentsAt(index)->GetFavicon()); + node->favicon.Init(&(node->snapshot)); + node->favicon.SetFavicon(browser_->GetTabContentsAt(index)->GetFavicon()); - node.title = new WmOverviewTitle; - node.title->Init(gfx::Size(std::max(0, cell_size.width() - + node->title.Init(gfx::Size(std::max(0, cell_size.width() - WmOverviewFavicon::kIconSize - kFaviconPadding), - kTitleHeight), node.snapshot); - node.title->SetTitle(browser_->GetTabContentsAt(index)->GetTitle()); + kTitleHeight), &(node->snapshot)); + node->title.SetTitle(browser_->GetTabContentsAt(index)->GetTitle()); snapshots_.insert(snapshots_.begin() + index, node); - node.snapshot->reload_snapshot(); + node->snapshot.reload_snapshot(); controller_->UpdateSnapshots(); } // Removes the snapshot at index. void BrowserListener::ClearSnapshot(int index) { - snapshots_[index].snapshot->CloseNow(); - snapshots_[index].title->CloseNow(); - snapshots_[index].favicon->CloseNow(); + scoped_ptr<SnapshotNode> node(snapshots_[index]); snapshots_.erase(snapshots_.begin() + index); } void BrowserListener::RenumberSnapshots(int start_index) { for (SnapshotVector::size_type i = start_index; i < snapshots_.size(); ++i) { - if (snapshots_[i].snapshot->index() != static_cast<int>(i)) - snapshots_[i].snapshot->UpdateIndex(browser_, i); + if (snapshots_[i]->snapshot.index() != static_cast<int>(i)) + snapshots_[i]->snapshot.UpdateIndex(browser_, i); } } diff --git a/chrome/browser/chromeos/wm_overview_favicon.cc b/chrome/browser/chromeos/wm_overview_favicon.cc index 0b1cd22..8e0d1b7 100644 --- a/chrome/browser/chromeos/wm_overview_favicon.cc +++ b/chrome/browser/chromeos/wm_overview_favicon.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -13,10 +13,10 @@ #include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/x/x11_util.h" #include "views/controls/image_view.h" -#include "views/controls/label.h" -#include "views/layout/grid_layout.h" +#include "views/widget/widget.h" using std::vector; +using views::Widget; #if !defined(OS_CHROMEOS) #error This file is only meant to be compiled for ChromeOS @@ -27,27 +27,30 @@ namespace chromeos { const int WmOverviewFavicon::kIconSize = 32; WmOverviewFavicon::WmOverviewFavicon() - : WidgetGtk(TYPE_WINDOW), - favicon_view_(NULL) { + : favicon_view_(NULL), + widget_(NULL) { +} + +WmOverviewFavicon::~WmOverviewFavicon() { + widget_->CloseNow(); } void WmOverviewFavicon::Init(WmOverviewSnapshot* snapshot) { - MakeTransparent(); + Widget::CreateParams create_params(Widget::CreateParams::TYPE_WINDOW); + create_params.transparent = true; + widget_ = Widget::CreateWidget(create_params); + widget_->Init(NULL, gfx::Rect(0, 0, 0, 0)); favicon_view_ = new views::ImageView(); - - WidgetGtk::Init(NULL, gfx::Rect(0, 0, 0, 0)); - - SetContentsView(favicon_view_); + widget_->SetContentsView(favicon_view_); // Set the window type vector<int> params; params.push_back(ui::GetX11WindowFromGtkWidget( - GTK_WIDGET(snapshot->GetNativeView()))); - WmIpc::instance()->SetWindowType( - GetNativeView(), - WM_IPC_WINDOW_CHROME_TAB_FAV_ICON, - ¶ms); + GTK_WIDGET(snapshot->widget()->GetNativeView()))); + WmIpc::instance()->SetWindowType(widget_->GetNativeView(), + WM_IPC_WINDOW_CHROME_TAB_FAV_ICON, + ¶ms); } @@ -73,7 +76,7 @@ void WmOverviewFavicon::SetFavicon(const SkBitmap& image) { favicon_view_->SetImage(icon); // Reset the bounds to the size of the image. - SetBounds(gfx::Rect(icon.width(), icon.height())); + widget_->SetBounds(gfx::Rect(icon.width(), icon.height())); } } // namespace chromeos diff --git a/chrome/browser/chromeos/wm_overview_favicon.h b/chrome/browser/chromeos/wm_overview_favicon.h index 1822800..0155d8c 100644 --- a/chrome/browser/chromeos/wm_overview_favicon.h +++ b/chrome/browser/chromeos/wm_overview_favicon.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,12 +6,13 @@ #define CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_FAVICON_H_ #pragma once -#include "views/widget/widget_gtk.h" +#include "base/basictypes.h" class SkBitmap; namespace views { class ImageView; +class Widget; } namespace chromeos { @@ -19,11 +20,12 @@ namespace chromeos { class WmOverviewSnapshot; // A single favicon displayed by WmOverviewController. -class WmOverviewFavicon : public views::WidgetGtk { +class WmOverviewFavicon { public: static const int kIconSize; WmOverviewFavicon(); + ~WmOverviewFavicon(); // Initializes the favicon to 0x0 size. void Init(WmOverviewSnapshot* snapshot); @@ -32,10 +34,15 @@ class WmOverviewFavicon : public views::WidgetGtk { // image. void SetFavicon(const SkBitmap& image); + views::Widget* widget() { return widget_; } + private: // This control is the contents view for this widget. views::ImageView* favicon_view_; + // Not owned, deletes itself when the underlying widget is destroyed. + views::Widget* widget_; + DISALLOW_COPY_AND_ASSIGN(WmOverviewFavicon); }; diff --git a/chrome/browser/chromeos/wm_overview_snapshot.cc b/chrome/browser/chromeos/wm_overview_snapshot.cc index 3618da1..c8a96dc 100644 --- a/chrome/browser/chromeos/wm_overview_snapshot.cc +++ b/chrome/browser/chromeos/wm_overview_snapshot.cc @@ -9,12 +9,13 @@ #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/ui/browser.h" #include "chrome/browser/ui/browser_window.h" +#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/x/x11_util.h" #include "views/controls/image_view.h" -#include "views/controls/label.h" -#include "views/layout/grid_layout.h" +#include "views/widget/widget.h" using std::vector; +using views::Widget; #if !defined(OS_CHROMEOS) #error This file is only meant to be compiled for ChromeOS @@ -23,20 +24,25 @@ using std::vector; namespace chromeos { WmOverviewSnapshot::WmOverviewSnapshot() - : WidgetGtk(TYPE_WINDOW), - snapshot_view_(NULL), + : snapshot_view_(NULL), index_(-1), - configured_snapshot_(false) { + configured_snapshot_(false), + widget_(NULL) { +} + +WmOverviewSnapshot::~WmOverviewSnapshot() { + widget_->CloseNow(); } void WmOverviewSnapshot::Init(const gfx::Size& size, Browser* browser, int index) { - snapshot_view_ = new views::ImageView(); + Widget::CreateParams create_params(Widget::CreateParams::TYPE_WINDOW); + widget_ = Widget::CreateWidget(create_params); + widget_->Init(NULL, gfx::Rect(size)); - WidgetGtk::Init(NULL, gfx::Rect(size)); - - SetContentsView(snapshot_view_); + snapshot_view_ = new views::ImageView(); + widget_->SetContentsView(snapshot_view_); UpdateIndex(browser, index); } @@ -48,7 +54,7 @@ void WmOverviewSnapshot::UpdateIndex(Browser* browser, int index) { GTK_WIDGET(browser->window()->GetNativeHandle()))); params.push_back(index); WmIpc::instance()->SetWindowType( - GetNativeView(), + widget_->GetNativeView(), WM_IPC_WINDOW_CHROME_TAB_SNAPSHOT, ¶ms); index_ = index; @@ -59,7 +65,7 @@ void WmOverviewSnapshot::SetImage(const SkBitmap& image) { snapshot_view_->SetImage(image); // Reset the bounds to the size of the image. - SetBounds(gfx::Rect(image.width(), image.height())); + widget_->SetBounds(gfx::Rect(image.width(), image.height())); configured_snapshot_ = true; } diff --git a/chrome/browser/chromeos/wm_overview_snapshot.h b/chrome/browser/chromeos/wm_overview_snapshot.h index b516467..1662876 100644 --- a/chrome/browser/chromeos/wm_overview_snapshot.h +++ b/chrome/browser/chromeos/wm_overview_snapshot.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,20 +6,29 @@ #define CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_SNAPSHOT_H_ #pragma once -#include "third_party/skia/include/core/SkBitmap.h" -#include "views/controls/image_view.h" -#include "views/view.h" -#include "views/widget/widget_gtk.h" +#include "base/basictypes.h" class Browser; +class SkBitmap; + +namespace gfx { +class Size; +} + +namespace views { +class ImageView; +class Widget; +} namespace chromeos { // WmOverviewSnapshot contains a snapshot image of the tab at the // given index. -class WmOverviewSnapshot : public views::WidgetGtk { +class WmOverviewSnapshot { public: WmOverviewSnapshot(); + ~WmOverviewSnapshot(); + void Init(const gfx::Size& size, Browser* browser, int index); void SetImage(const SkBitmap& image); @@ -27,12 +36,6 @@ class WmOverviewSnapshot : public views::WidgetGtk { void UpdateIndex(Browser* browser, int index); int index() const { return index_; } - // Returns the size of the snapshot widget. - gfx::Size size() const { - // TODO(beng): this should not be written as an accessor... - return GetClientAreaScreenBounds().size(); - } - // Has the snapshot been configured? This is true after SetSnapshot // is invoked. bool configured_snapshot() const { return configured_snapshot_; } @@ -41,6 +44,8 @@ class WmOverviewSnapshot : public views::WidgetGtk { // get reloaded the next time we check. void reload_snapshot() { configured_snapshot_ = false; } + views::Widget* widget() { return widget_; } + private: // This control is the contents view for this widget. views::ImageView* snapshot_view_; @@ -51,6 +56,9 @@ class WmOverviewSnapshot : public views::WidgetGtk { // This indicates whether or not the snapshot has been configured. bool configured_snapshot_; + // Not owned, deletes itself when the underlying widget is destroyed. + views::Widget* widget_; + DISALLOW_COPY_AND_ASSIGN(WmOverviewSnapshot); }; diff --git a/chrome/browser/chromeos/wm_overview_title.cc b/chrome/browser/chromeos/wm_overview_title.cc index b236338..954784a 100644 --- a/chrome/browser/chromeos/wm_overview_title.cc +++ b/chrome/browser/chromeos/wm_overview_title.cc @@ -6,24 +6,23 @@ #include <vector> -#include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/chromeos/drop_shadow_label.h" #include "chrome/browser/chromeos/wm_ipc.h" #include "chrome/browser/chromeos/wm_overview_snapshot.h" -#include "chrome/browser/ui/browser_window.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" -#include "third_party/skia/include/core/SkBitmap.h" #include "ui/base/x/x11_util.h" #include "views/border.h" #include "views/layout/grid_layout.h" #include "views/view.h" +#include "views/widget/widget.h" +using gfx::Font; using std::vector; using views::ColumnSet; using views::GridLayout; using views::View; -using gfx::Font; +using views::Widget; #if !defined(OS_CHROMEOS) #error This file is only meant to be compiled for ChromeOS @@ -53,15 +52,17 @@ Font FindFontThisHigh(int pixels, Font base) { } // Anonymous namespace WmOverviewTitle::WmOverviewTitle() - : WidgetGtk(TYPE_WINDOW), - title_label_(NULL), - url_label_(NULL) { + : title_label_(NULL), + url_label_(NULL), + widget_(NULL) { +} + +WmOverviewTitle::~WmOverviewTitle() { + widget_->CloseNow(); } void WmOverviewTitle::Init(const gfx::Size& size, WmOverviewSnapshot* snapshot) { - MakeTransparent(); - title_label_ = new DropShadowLabel(); title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_label_->SetColor(SkColorSetARGB(0xFF, 0xFF, 0xFF, 0xFF)); @@ -89,18 +90,21 @@ void WmOverviewTitle::Init(const gfx::Size& size, layout->StartRowWithPadding(1, title_cs_id, 0, kVerticalPadding); layout->AddView(url_label_); - // Realize the widget. - WidgetGtk::Init(NULL, gfx::Rect(size)); + // Create and realize the widget. + Widget::CreateParams create_params(Widget::CreateParams::TYPE_WINDOW); + create_params.transparent = true; + widget_ = Widget::CreateWidget(create_params); + widget_->Init(NULL, gfx::Rect(size)); // Make the view the contents view for this widget. - SetContentsView(view); + widget_->SetContentsView(view); // Set the window type vector<int> params; params.push_back(ui::GetX11WindowFromGtkWidget( - GTK_WIDGET(snapshot->GetNativeView()))); + GTK_WIDGET(snapshot->widget()->GetNativeView()))); WmIpc::instance()->SetWindowType( - GetNativeView(), + widget_->GetNativeView(), WM_IPC_WINDOW_CHROME_TAB_TITLE, ¶ms); } diff --git a/chrome/browser/chromeos/wm_overview_title.h b/chrome/browser/chromeos/wm_overview_title.h index b145432..7ea414f 100644 --- a/chrome/browser/chromeos/wm_overview_title.h +++ b/chrome/browser/chromeos/wm_overview_title.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -6,16 +6,19 @@ #define CHROME_BROWSER_CHROMEOS_WM_OVERVIEW_TITLE_H_ #pragma once +#include "base/basictypes.h" #include "base/string16.h" -#include "views/widget/widget_gtk.h" -class Browser; class GURL; namespace gfx { class Size; } +namespace views { +class Widget; +} + namespace chromeos { class DropShadowLabel; @@ -23,14 +26,18 @@ class WmOverviewSnapshot; // WmOverviewTitle contains the title and URL of an associated tab // snapshot. -class WmOverviewTitle : public views::WidgetGtk { +class WmOverviewTitle { public: WmOverviewTitle(); + ~WmOverviewTitle(); + void Init(const gfx::Size& size, WmOverviewSnapshot* snapshot); void SetTitle(const string16& title); void SetUrl(const GURL& url); + views::Widget* widget() { return widget_; } + private: // This contains the title of the tab contents. DropShadowLabel* title_label_; @@ -38,6 +45,9 @@ class WmOverviewTitle : public views::WidgetGtk { // This contains the url of the tab contents. DropShadowLabel* url_label_; + // Not owned, deletes itself when the underlying widget is destroyed. + views::Widget* widget_; + DISALLOW_COPY_AND_ASSIGN(WmOverviewTitle); }; diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index 396a62d..78c2547 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -55,9 +55,11 @@ class WidgetGtk : public Widget, TYPE_POPUP, // A top level window with no title or control buttons. + // NOTE: On ChromeOS TYPE_WINDOW and TYPE_DECORATED_WINDOW behave the same. TYPE_WINDOW, // A top level, decorated window. + // NOTE: On ChromeOS TYPE_WINDOW and TYPE_DECORATED_WINDOW behave the same. TYPE_DECORATED_WINDOW, // A child widget. |