diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 19:31:24 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-04-26 19:31:24 +0000 |
commit | 243d16c23f758d3a9bbc8dcb01521baa770af536 (patch) | |
tree | 6c61e4049cd93d72a26a88a3bc9cfb93f0c1dd0c /views | |
parent | ed84c4b34838742cd99ad8c43d817da4de0b19c6 (diff) | |
download | chromium_src-243d16c23f758d3a9bbc8dcb01521baa770af536.zip chromium_src-243d16c23f758d3a9bbc8dcb01521baa770af536.tar.gz chromium_src-243d16c23f758d3a9bbc8dcb01521baa770af536.tar.bz2 |
Rename CreateParams to InitParams.
http://crbug.com/72040
TEST=none
TBR=sky
Review URL: http://codereview.chromium.org/6901034
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@83057 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/menu/menu_host.cc | 4 | ||||
-rw-r--r-- | views/controls/menu/menu_host_gtk.cc | 2 | ||||
-rw-r--r-- | views/controls/menu/menu_host_gtk.h | 2 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_gtk.cc | 2 | ||||
-rw-r--r-- | views/controls/tabbed_pane/native_tabbed_pane_win.cc | 2 | ||||
-rw-r--r-- | views/controls/textfield/native_textfield_views_unittest.cc | 2 | ||||
-rw-r--r-- | views/examples/widget_example.cc | 4 | ||||
-rw-r--r-- | views/focus/focus_manager_unittest.cc | 4 | ||||
-rw-r--r-- | views/view_unittest.cc | 22 | ||||
-rw-r--r-- | views/widget/native_widget.h | 2 | ||||
-rw-r--r-- | views/widget/native_widget_test_utils_gtk.cc | 4 | ||||
-rw-r--r-- | views/widget/native_widget_test_utils_win.cc | 4 | ||||
-rw-r--r-- | views/widget/widget.cc | 12 | ||||
-rw-r--r-- | views/widget/widget.h | 11 | ||||
-rw-r--r-- | views/widget/widget_gtk.cc | 16 | ||||
-rw-r--r-- | views/widget/widget_gtk.h | 8 | ||||
-rw-r--r-- | views/widget/widget_win.cc | 16 | ||||
-rw-r--r-- | views/widget/widget_win.h | 4 | ||||
-rw-r--r-- | views/widget/widget_win_unittest.cc | 2 | ||||
-rw-r--r-- | views/window/window_gtk.cc | 2 | ||||
-rw-r--r-- | views/window/window_win.cc | 4 | ||||
-rw-r--r-- | views/window/window_win.h | 2 |
22 files changed, 65 insertions, 66 deletions
diff --git a/views/controls/menu/menu_host.cc b/views/controls/menu/menu_host.cc index b8ad997..dd4db60 100644 --- a/views/controls/menu/menu_host.cc +++ b/views/controls/menu/menu_host.cc @@ -31,8 +31,8 @@ void MenuHost::InitMenuHost(gfx::NativeWindow parent, const gfx::Rect& bounds, View* contents_view, bool do_capture) { - Widget::CreateParams params; - params.type = Widget::CreateParams::TYPE_MENU; + Widget::InitParams params; + params.type = Widget::InitParams::TYPE_MENU; params.has_dropshadow = true; #if defined(OS_WIN) params.parent = parent; diff --git a/views/controls/menu/menu_host_gtk.cc b/views/controls/menu/menu_host_gtk.cc index 914b135..201d17f 100644 --- a/views/controls/menu/menu_host_gtk.cc +++ b/views/controls/menu/menu_host_gtk.cc @@ -81,7 +81,7 @@ NativeWidget* MenuHostGtk::AsNativeWidget() { //////////////////////////////////////////////////////////////////////////////// // MenuHostGtk, WidgetGtk overrides: -void MenuHostGtk::InitNativeWidget(const Widget::CreateParams& params) { +void MenuHostGtk::InitNativeWidget(const Widget::InitParams& params) { make_transient_to_parent(); WidgetGtk::InitNativeWidget(params); // Make sure we get destroyed when the parent is destroyed. diff --git a/views/controls/menu/menu_host_gtk.h b/views/controls/menu/menu_host_gtk.h index 6ba471f..d0378c3 100644 --- a/views/controls/menu/menu_host_gtk.h +++ b/views/controls/menu/menu_host_gtk.h @@ -28,7 +28,7 @@ class MenuHostGtk : public WidgetGtk, virtual NativeWidget* AsNativeWidget() OVERRIDE; // Overridden from WidgetGtk: - virtual void InitNativeWidget(const Widget::CreateParams& params) OVERRIDE; + virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; virtual RootView* CreateRootView() OVERRIDE; virtual bool ShouldReleaseCaptureOnMouseReleased() const OVERRIDE; virtual void ReleaseMouseCapture() OVERRIDE; diff --git a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc index d2286b3..123ece2 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_gtk.cc @@ -156,7 +156,7 @@ void NativeTabbedPaneGtk::DoAddTabAtIndex(int index, Widget* page_container = Widget::CreateWidget(); page_container->Init( - Widget::CreateParams(Widget::CreateParams::TYPE_CONTROL)); + Widget::InitParams(Widget::InitParams::TYPE_CONTROL)); page_container->SetContentsView(contents); page_container->SetFocusTraversableParent(GetWidget()->GetFocusTraversable()); page_container->SetFocusTraversableParentView(this); diff --git a/views/controls/tabbed_pane/native_tabbed_pane_win.cc b/views/controls/tabbed_pane/native_tabbed_pane_win.cc index 3d897f6..313716f 100644 --- a/views/controls/tabbed_pane/native_tabbed_pane_win.cc +++ b/views/controls/tabbed_pane/native_tabbed_pane_win.cc @@ -292,7 +292,7 @@ void NativeTabbedPaneWin::CreateNativeControl() { // Create the view container which is a child of the TabControl. content_window_ = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); params.parent = tab_control; content_window_->Init(params); diff --git a/views/controls/textfield/native_textfield_views_unittest.cc b/views/controls/textfield/native_textfield_views_unittest.cc index e6d385b..5c9db0f 100644 --- a/views/controls/textfield/native_textfield_views_unittest.cc +++ b/views/controls/textfield/native_textfield_views_unittest.cc @@ -155,7 +155,7 @@ class NativeTextfieldViewsTest : public ViewsTestBase, textfield_ = new TestTextfield(style); textfield_->SetController(this); widget_ = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + Widget::InitParams params(Widget::InitParams::TYPE_POPUP); params.bounds = gfx::Rect(100, 100, 100, 100); widget_->Init(params); View* container = new View(); diff --git a/views/examples/widget_example.cc b/views/examples/widget_example.cc index 537c028f..4ec3cbf 100644 --- a/views/examples/widget_example.cc +++ b/views/examples/widget_example.cc @@ -117,7 +117,7 @@ void WidgetExample::CreateChild(views::View* parent, bool transparent) { bounds.SetRect((bounds.width() - 200) / 2, (bounds.height() - 200) / 2, 200, 200); // Initialize the child widget with the computed bounds. - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); params.transparent = transparent; params.parent_widget = parent_widget; widget->Init(params); @@ -137,7 +137,7 @@ void WidgetExample::CreatePopup(views::View* parent, bool transparent) { point.Offset(0, parent->size().height()); // Initialize the popup widget with the computed bounds. - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = transparent; params.parent_widget = parent->GetWidget(); params.bounds = gfx::Rect(point.x(), point.y(), 200, 300); diff --git a/views/focus/focus_manager_unittest.cc b/views/focus/focus_manager_unittest.cc index f34e20d..53cc26c 100644 --- a/views/focus/focus_manager_unittest.cc +++ b/views/focus/focus_manager_unittest.cc @@ -291,7 +291,7 @@ class BorderView : public NativeViewHost { if (child == this && is_add) { if (!widget_) { widget_ = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); #if defined(OS_WIN) params.parent = parent->GetRootView()->GetWidget()->GetNativeView(); #elif defined(TOOLKIT_USES_GTK) @@ -1603,7 +1603,7 @@ TEST_F(FocusManagerTest, CreationForNativeRoot) { // Create a view window parented to native dialog. scoped_ptr<Widget> widget1(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.parent = hwnd; params.bounds = gfx::Rect(0, 0, 100, 100); diff --git a/views/view_unittest.cc b/views/view_unittest.cc index 2a046c2..772477a 100644 --- a/views/view_unittest.cc +++ b/views/view_unittest.cc @@ -362,7 +362,7 @@ TEST_F(ViewTest, MouseEvent) { v2->SetBounds(100, 100, 100, 100); scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(50, 50, 650, 650); widget->Init(params); @@ -471,7 +471,7 @@ TEST_F(ViewTest, TouchEvent) { v3->SetBounds(0, 0, 100, 100); scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(50, 50, 650, 650); widget->Init(params); @@ -833,7 +833,7 @@ TEST_F(ViewTest, Textfield) { ui::Clipboard clipboard; Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(0, 0, 100, 100); widget->Init(params); RootView* root_view = widget->GetRootView(); @@ -871,7 +871,7 @@ TEST_F(ViewTest, TextfieldCutCopyPaste) { ui::Clipboard clipboard; Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(0, 0, 100, 100); widget->Init(params); RootView* root_view = widget->GetRootView(); @@ -995,7 +995,7 @@ TEST_F(ViewTest, ActivateAccelerator) { // Create a window and add the view as its child. scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(0, 0, 100, 100); widget->Init(params); @@ -1061,7 +1061,7 @@ TEST_F(ViewTest, HiddenViewWithAccelerator) { EXPECT_EQ(view->accelerator_count_map_[return_accelerator], 0); scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(0, 0, 100, 100); widget->Init(params); @@ -1554,13 +1554,13 @@ class TestChangeNativeViewHierarchy { view_test_ = view_test; native_host_ = new views::NativeViewHost(); host_ = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(0, 0, 500, 300); host_->Init(params); host_->GetRootView()->AddChildView(native_host_); for (size_t i = 0; i < TestNativeViewHierarchy::kTotalViews; ++i) { windows_[i] = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.parent = host_->GetNativeView(); params.bounds = gfx::Rect(0, 0, 500, 300); windows_[i]->Init(params); @@ -1685,7 +1685,7 @@ TEST_F(ViewTest, TransformPaint) { v2->SetBounds(100, 100, 200, 100); Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(50, 50, 650, 650); widget->Init(params); widget->Show(); @@ -1722,7 +1722,7 @@ TEST_F(ViewTest, TransformEvent) { v2->SetBounds(100, 100, 200, 100); Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(50, 50, 650, 650); widget->Init(params); RootView* root = widget->GetRootView(); @@ -1872,7 +1872,7 @@ TEST_F(ViewTest, OnVisibleBoundsChanged) { gfx::Rect viewport_bounds(0, 0, 100, 100); scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = viewport_bounds; widget->Init(params); diff --git a/views/widget/native_widget.h b/views/widget/native_widget.h index 1dba231..451a0e9 100644 --- a/views/widget/native_widget.h +++ b/views/widget/native_widget.h @@ -59,7 +59,7 @@ class NativeWidget { gfx::NativeView new_parent); // Initializes the NativeWidget. - virtual void InitNativeWidget(const Widget::CreateParams& params) = 0; + virtual void InitNativeWidget(const Widget::InitParams& params) = 0; // Returns the Widget associated with this NativeWidget. This function is // guaranteed to return non-NULL for the lifetime of the NativeWidget. diff --git a/views/widget/native_widget_test_utils_gtk.cc b/views/widget/native_widget_test_utils_gtk.cc index be6e129..6c478f2 100644 --- a/views/widget/native_widget_test_utils_gtk.cc +++ b/views/widget/native_widget_test_utils_gtk.cc @@ -17,7 +17,7 @@ NativeWidget* CreateNativeWidget() { NativeWidget* CreateNativeWidgetWithContents(View* contents_view) { Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(10, 10, 200, 200); widget->Init(params); @@ -26,7 +26,7 @@ NativeWidget* CreateNativeWidgetWithContents(View* contents_view) { NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) { Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.parent = parent ? parent->GetWidget()->GetNativeView() : NULL; params.bounds = gfx::Rect(10, 10, 200, 200); diff --git a/views/widget/native_widget_test_utils_win.cc b/views/widget/native_widget_test_utils_win.cc index 37b7d27..59e1d8d 100644 --- a/views/widget/native_widget_test_utils_win.cc +++ b/views/widget/native_widget_test_utils_win.cc @@ -16,7 +16,7 @@ NativeWidget* CreateNativeWidget() { NativeWidget* CreateNativeWidgetWithContents(View* contents_view) { Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(10, 10, 200, 200); widget->Init(params); @@ -25,7 +25,7 @@ NativeWidget* CreateNativeWidgetWithContents(View* contents_view) { NativeWidget* CreateNativeWidgetWithParent(NativeWidget* parent) { Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_CONTROL); + Widget::InitParams params(Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.child = false; // Implicitly set to true by ctor with TYPE_CONTROL. params.parent = parent ? parent->GetWidget()->GetNativeView() : NULL; diff --git a/views/widget/widget.cc b/views/widget/widget.cc index dd40007..380aa29 100644 --- a/views/widget/widget.cc +++ b/views/widget/widget.cc @@ -16,9 +16,9 @@ namespace views { //////////////////////////////////////////////////////////////////////////////// -// Widget, CreateParams: +// Widget, InitParams: -Widget::CreateParams::CreateParams() +Widget::InitParams::InitParams() : type(TYPE_WINDOW), child(false), transparent(false), @@ -33,7 +33,7 @@ Widget::CreateParams::CreateParams() native_widget(NULL) { } -Widget::CreateParams::CreateParams(Type type) +Widget::InitParams::InitParams(Type type) : type(type), child(type == TYPE_CONTROL), transparent(false), @@ -52,8 +52,8 @@ Widget::CreateParams::CreateParams(Type type) // Widget, public: // static -Widget::CreateParams Widget::WindowCreateParams() { - return CreateParams(CreateParams::TYPE_WINDOW); +Widget::InitParams Widget::WindowInitParams() { + return InitParams(InitParams::TYPE_WINDOW); } Widget::Widget() @@ -67,7 +67,7 @@ Widget::Widget() Widget::~Widget() { } -void Widget::Init(const CreateParams& params) { +void Widget::Init(const InitParams& params) { GetRootView(); default_theme_provider_.reset(new DefaultThemeProvider); native_widget_->InitNativeWidget(params); diff --git a/views/widget/widget.h b/views/widget/widget.h index ec33496..fa2f89d 100644 --- a/views/widget/widget.h +++ b/views/widget/widget.h @@ -62,8 +62,7 @@ class Window; class Widget : public internal::NativeWidgetDelegate, public FocusTraversable { public: - // TODO(beng): Rename to InitParams now this is required for Init(). - struct CreateParams { + struct InitParams { enum Type { TYPE_WINDOW, // A Window, like a frame window. TYPE_CONTROL, // A control, like a button. @@ -72,8 +71,8 @@ class Widget : public internal::NativeWidgetDelegate, // specialized to menus. }; - CreateParams(); - explicit CreateParams(Type type); + InitParams(); + explicit InitParams(Type type); Type type; bool child; @@ -89,7 +88,7 @@ class Widget : public internal::NativeWidgetDelegate, gfx::Rect bounds; NativeWidget* native_widget; }; - static CreateParams WindowCreateParams(); + static InitParams WindowInitParams(); Widget(); virtual ~Widget(); @@ -109,7 +108,7 @@ class Widget : public internal::NativeWidgetDelegate, const Widget* target, gfx::Rect* rect); - void Init(const CreateParams& params); + void Init(const InitParams& params); // Unconverted methods ------------------------------------------------------- diff --git a/views/widget/widget_gtk.cc b/views/widget/widget_gtk.cc index 827c97c..edc8cf6 100644 --- a/views/widget/widget_gtk.cc +++ b/views/widget/widget_gtk.cc @@ -618,10 +618,10 @@ void WidgetGtk::RegisterChildExposeHandler(GtkWidget* child) { //////////////////////////////////////////////////////////////////////////////// // WidgetGtk, NativeWidget implementation: -void WidgetGtk::InitNativeWidget(const CreateParams& params) { - SetCreateParams(params); +void WidgetGtk::InitNativeWidget(const InitParams& params) { + SetInitParams(params); - CreateParams modified_params = params; + InitParams modified_params = params; gfx::NativeView parent = params.parent; if (params.parent_widget) { WidgetGtk* parent_gtk = @@ -1377,7 +1377,7 @@ void WidgetGtk::DispatchKeyEventPostIME(const KeyEvent& key) { gtk_bindings_activate_event(GTK_OBJECT(widget_), event); } -void WidgetGtk::SetCreateParams(const CreateParams& params) { +void WidgetGtk::SetInitParams(const InitParams& params) { DCHECK(!GetNativeView()); delete_on_destroy_ = params.delete_on_destroy; @@ -1388,7 +1388,7 @@ void WidgetGtk::SetCreateParams(const CreateParams& params) { if (!params.accept_events && !child_) ignore_events_ = true; - if (params.type == CreateParams::TYPE_MENU) { + if (params.type == InitParams::TYPE_MENU) { GdkEvent* event = gtk_get_current_event(); if (event) { is_mouse_button_pressed_ = event->type == GDK_BUTTON_PRESS || @@ -1449,7 +1449,7 @@ Window* WidgetGtk::GetWindowImpl(GtkWidget* widget) { return NULL; } -void WidgetGtk::CreateGtkWidget(const CreateParams& params) { +void WidgetGtk::CreateGtkWidget(const InitParams& params) { // We turn off double buffering for two reasons: // 1. We draw to a canvas then composite to the screen, which means we're // doing our own double buffering already. @@ -1503,8 +1503,8 @@ void WidgetGtk::CreateGtkWidget(const CreateParams& params) { } else { // Use our own window class to override GtkWindow's move_focus method. widget_ = gtk_views_window_new( - params.type == CreateParams::TYPE_WINDOW ? GTK_WINDOW_TOPLEVEL - : GTK_WINDOW_POPUP); + params.type == InitParams::TYPE_WINDOW ? GTK_WINDOW_TOPLEVEL + : GTK_WINDOW_POPUP); gtk_widget_set_name(widget_, "views-gtkwidget-window"); if (transient_to_parent_) { gtk_window_set_transient_for(GTK_WINDOW(widget_), diff --git a/views/widget/widget_gtk.h b/views/widget/widget_gtk.h index 3839754..9022a35a 100644 --- a/views/widget/widget_gtk.h +++ b/views/widget/widget_gtk.h @@ -168,7 +168,7 @@ class WidgetGtk : public Widget, static void RegisterChildExposeHandler(GtkWidget* widget); // Overridden from NativeWidget: - virtual void InitNativeWidget(const CreateParams& params) OVERRIDE; + virtual void InitNativeWidget(const InitParams& params) OVERRIDE; virtual Widget* GetWidget() OVERRIDE; virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; virtual void* GetNativeWindowProperty(const char* name) OVERRIDE; @@ -276,7 +276,7 @@ class WidgetGtk : public Widget, // Overridden from internal::InputMethodDelegate virtual void DispatchKeyEventPostIME(const KeyEvent& key) OVERRIDE; - void SetCreateParams(const CreateParams& params); + void SetInitParams(const InitParams& params); // This is called only when the window is transparent. CHROMEGTK_CALLBACK_1(WidgetGtk, gboolean, OnWindowPaint, GdkEventExpose*); @@ -290,7 +290,7 @@ class WidgetGtk : public Widget, static Window* GetWindowImpl(GtkWidget* widget); // Creates the GtkWidget. - void CreateGtkWidget(const CreateParams& params); + void CreateGtkWidget(const InitParams& params); // Invoked from create widget to enable the various bits needed for a // transparent background. This is only invoked if MakeTransparent has been @@ -339,7 +339,7 @@ class WidgetGtk : public Widget, bool transparent_; // Makes the window pass all events through to any windows behind it. - // Set during SetCreateParams before the widget is created. The actual work of + // Set during SetInitParams before the widget is created. The actual work of // making the window ignore events is done by ConfigureWidgetForIgnoreEvents. bool ignore_events_; diff --git a/views/widget/widget_win.cc b/views/widget/widget_win.cc index 4748c43..5cacc9b 100644 --- a/views/widget/widget_win.cc +++ b/views/widget/widget_win.cc @@ -223,8 +223,8 @@ void WidgetWin::ViewHierarchyChanged(bool is_add, View* parent, //////////////////////////////////////////////////////////////////////////////// // WidgetWin, NativeWidget implementation: -void WidgetWin::InitNativeWidget(const Widget::CreateParams& params) { - SetCreateParams(params); +void WidgetWin::InitNativeWidget(const Widget::InitParams& params) { + SetInitParams(params); // Create the window. gfx::NativeView parent = params.parent_widget ? @@ -1002,7 +1002,7 @@ void WidgetWin::PostProcessActivateMessage(WidgetWin* widget, } } -void WidgetWin::SetCreateParams(const CreateParams& params) { +void WidgetWin::SetInitParams(const InitParams& params) { // Set non-style attributes. delete_on_destroy_ = params.delete_on_destroy; @@ -1030,14 +1030,14 @@ void WidgetWin::SetCreateParams(const CreateParams& params) { // Set type-dependent style attributes. switch (params.type) { - case CreateParams::TYPE_WINDOW: - case CreateParams::TYPE_CONTROL: + case InitParams::TYPE_WINDOW: + case InitParams::TYPE_CONTROL: break; - case CreateParams::TYPE_POPUP: + case InitParams::TYPE_POPUP: style |= WS_POPUP; ex_style |= WS_EX_TOOLWINDOW; break; - case CreateParams::TYPE_MENU: + case InitParams::TYPE_MENU: style |= WS_POPUP; is_mouse_button_pressed_ = ((GetKeyState(VK_LBUTTON) & 0x80) || @@ -1093,7 +1093,7 @@ void WidgetWin::RedrawLayeredWindowContents() { void WidgetWin::ClientAreaSizeChanged() { RECT r; - if (GetThemeProvider()->ShouldUseNativeFrame()) + if (GetThemeProvider()->ShouldUseNativeFrame() || IsZoomed()) GetClientRect(&r); else GetWindowRect(&r); diff --git a/views/widget/widget_win.h b/views/widget/widget_win.h index 5b25f2f..3d7b834 100644 --- a/views/widget/widget_win.h +++ b/views/widget/widget_win.h @@ -191,7 +191,7 @@ class WidgetWin : public ui::WindowImpl, } // Overridden from NativeWidget: - virtual void InitNativeWidget(const Widget::CreateParams& params) OVERRIDE; + virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; virtual Widget* GetWidget() OVERRIDE; virtual void SetNativeWindowProperty(const char* name, void* value) OVERRIDE; virtual void* GetNativeWindowProperty(const char* name) OVERRIDE; @@ -422,7 +422,7 @@ class WidgetWin : public ui::WindowImpl, static void PostProcessActivateMessage(WidgetWin* widget, int activation_state); - void SetCreateParams(const Widget::CreateParams& params); + void SetInitParams(const Widget::InitParams& params); // Synchronously paints the invalid contents of the Widget. void RedrawInvalidRect(); diff --git a/views/widget/widget_win_unittest.cc b/views/widget/widget_win_unittest.cc index 2014194..8abd577 100644 --- a/views/widget/widget_win_unittest.cc +++ b/views/widget/widget_win_unittest.cc @@ -44,7 +44,7 @@ class WidgetWinTest : public testing::Test { WidgetWin* WidgetWinTest::CreateWidgetWin() { scoped_ptr<Widget> widget(Widget::CreateWidget()); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.delete_on_destroy = false; params.bounds = gfx::Rect(50, 50, 650, 650); widget->Init(params); diff --git a/views/window/window_gtk.cc b/views/window/window_gtk.cc index a982ac6..d7c2187 100644 --- a/views/window/window_gtk.cc +++ b/views/window/window_gtk.cc @@ -419,7 +419,7 @@ WindowGtk::WindowGtk(WindowDelegate* window_delegate) void WindowGtk::InitWindow(GtkWindow* parent, const gfx::Rect& bounds) { if (parent) make_transient_to_parent(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.parent = GTK_WIDGET(parent); params.bounds = bounds; GetWidget()->Init(params); diff --git a/views/window/window_win.cc b/views/window/window_win.cc index 9b92e7e7..76b8617 100644 --- a/views/window/window_win.cc +++ b/views/window/window_win.cc @@ -244,7 +244,7 @@ Window* Window::CreateChromeWindow(gfx::NativeWindow parent, WindowDelegate* window_delegate) { Window* window = new WindowWin(window_delegate); window->non_client_view()->SetFrameView(window->CreateFrameViewForWindow()); - Widget::CreateParams params(Widget::WindowCreateParams()); + Widget::InitParams params(Widget::WindowInitParams()); params.parent = parent; params.bounds = bounds; window->AsWidget()->Init(params); @@ -357,7 +357,7 @@ int WindowWin::GetShowState() const { /////////////////////////////////////////////////////////////////////////////// // WindowWin, WidgetWin overrides: -void WindowWin::InitNativeWidget(const Widget::CreateParams& params) { +void WindowWin::InitNativeWidget(const Widget::InitParams& params) { if (window_style() == 0) set_window_style(CalculateWindowStyle()); if (window_ex_style() == 0) diff --git a/views/window/window_win.h b/views/window/window_win.h index 3bcf1d0..cf279f6 100644 --- a/views/window/window_win.h +++ b/views/window/window_win.h @@ -85,7 +85,7 @@ class WindowWin : public WidgetWin, virtual int GetShowState() const; // Overridden from WidgetWin: - virtual void InitNativeWidget(const Widget::CreateParams& params) OVERRIDE; + virtual void InitNativeWidget(const Widget::InitParams& params) OVERRIDE; virtual void OnActivateApp(BOOL active, DWORD thread_id) OVERRIDE; virtual LRESULT OnAppCommand(HWND window, short app_command, |