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

Unified Diff: chrome/browser/ui/views/bubble/bubble.cc

Issue 6881107: Rework the way Widget::Init works: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/bubble/bubble.cc
===================================================================
--- chrome/browser/ui/views/bubble/bubble.cc (revision 82649)
+++ chrome/browser/ui/views/bubble/bubble.cc (working copy)
@@ -69,8 +69,7 @@
views::View* contents,
BubbleDelegate* delegate,
bool show_while_screen_is_locked) {
- Bubble* bubble = new Bubble(views::WidgetGtk::TYPE_POPUP,
- show_while_screen_is_locked);
+ Bubble* bubble = new Bubble(show_while_screen_is_locked);
bubble->InitBubble(parent, position_relative_to, arrow_location,
contents, delegate);
return bubble;
@@ -122,7 +121,6 @@
Bubble::Bubble()
:
#if defined(OS_LINUX)
- WidgetGtk(TYPE_WINDOW),
border_contents_(NULL),
#elif defined(OS_WIN)
border_(NULL),
@@ -138,9 +136,8 @@
}
#if defined(OS_CHROMEOS)
-Bubble::Bubble(views::WidgetGtk::Type type, bool show_while_screen_is_locked)
- : WidgetGtk(type),
- border_contents_(NULL),
+Bubble::Bubble(bool show_while_screen_is_locked)
+ : border_contents_(NULL),
delegate_(NULL),
show_status_(kOpen),
fade_away_on_close_(false),
@@ -185,18 +182,21 @@
SetOpacity(0);
}
- border_->Init(CreateBorderContents(), parent->GetNativeView());
+ border_->InitBorderWidgetWin(CreateBorderContents(), parent->GetNativeView());
border_->border_contents()->SetBackgroundColor(kBackgroundColor);
// We make the BorderWidgetWin the owner of the Bubble HWND, so that the
// latter is displayed on top of the former.
- WidgetWin::Init(border_->GetNativeView(), gfx::Rect());
+ views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP);
+ params.parent = border_->GetNativeView();
+ GetWidget()->Init(params);
SetWindowText(GetNativeView(), delegate_->accessible_name().c_str());
#elif defined(OS_LINUX)
- MakeTransparent();
- make_transient_to_parent();
- WidgetGtk::InitWithWidget(parent, gfx::Rect());
+ views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW);
+ params.transparent = true;
+ params.parent_widget = parent;
+ GetWidget()->Init(params);
#if defined(OS_CHROMEOS)
{
vector<int> params;

Powered by Google App Engine
This is Rietveld 408576698