diff options
61 files changed, 120 insertions, 121 deletions
diff --git a/chrome/browser/chromeos/frame/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc index cff8723..b7513cb 100644 --- a/chrome/browser/chromeos/frame/panel_controller.cc +++ b/chrome/browser/chromeos/frame/panel_controller.cc @@ -142,7 +142,7 @@ void PanelController::Init(bool initial_focus, gfx::Rect title_bounds(0, 0, window_bounds.width(), kTitleHeight); title_window_ = views::Widget::CreateWidget(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.transparent = true; params.bounds = title_bounds; title_window_->Init(params); diff --git a/chrome/browser/chromeos/input_method/candidate_window.cc b/chrome/browser/chromeos/input_method/candidate_window.cc index dc693ca..1bae39b 100644 --- a/chrome/browser/chromeos/input_method/candidate_window.cc +++ b/chrome/browser/chromeos/input_method/candidate_window.cc @@ -802,7 +802,7 @@ void CandidateWindowView::HideLookupTable() { // not release mouse/keyboard grab even after it gets hidden. // // 1. create a popup window by views::Widget::CreateWidget() with the - // accept_events flag set to true on the CreateParams. + // accept_events flag set to true on the InitParams. // 2. press a mouse button on the window. // 3. before releasing the mouse button, Hide() the window. // 4. release the button. @@ -1285,7 +1285,7 @@ void CandidateWindowController::Impl::CreateView() { frame_.reset(views::Widget::CreateWidget()); // The size is initially zero. frame_->Init( - views::Widget::CreateParams(views::Widget::CreateParams::TYPE_POPUP)); + views::Widget::InitParams(views::Widget::InitParams::TYPE_POPUP)); // Create the candidate window. candidate_window_ = new CandidateWindowView(frame_.get()); diff --git a/chrome/browser/chromeos/login/background_view.cc b/chrome/browser/chromeos/login/background_view.cc index 17a5714..9f5b5a9 100644 --- a/chrome/browser/chromeos/login/background_view.cc +++ b/chrome/browser/chromeos/login/background_view.cc @@ -170,7 +170,7 @@ views::Widget* BackgroundView::CreateWindowContainingView( ResetXCursor(); Widget* window = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.bounds = bounds; window->Init(params); *view = new BackgroundView(); diff --git a/chrome/browser/chromeos/login/helper.cc b/chrome/browser/chromeos/login/helper.cc index f9e7919..d91fc12 100644 --- a/chrome/browser/chromeos/login/helper.cc +++ b/chrome/browser/chromeos/login/helper.cc @@ -114,7 +114,7 @@ void ThrobberHostView::StartThrobber() { make_transient_to_parent(); throbber_bounds.Offset(host_view_->GetScreenBounds().origin()); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.transparent = true; params.bounds = throbber_bounds; params.parent = host_gtk_window; diff --git a/chrome/browser/chromeos/login/message_bubble.cc b/chrome/browser/chromeos/login/message_bubble.cc index 25ebd7b..1fd2531 100644 --- a/chrome/browser/chromeos/login/message_bubble.cc +++ b/chrome/browser/chromeos/login/message_bubble.cc @@ -21,7 +21,7 @@ namespace chromeos { static const int kBorderSize = 4; static const int kMaxLabelWidth = 250; -MessageBubble::MessageBubble(views::Widget::CreateParams::Type type, +MessageBubble::MessageBubble(views::Widget::InitParams::Type type, views::Widget* parent, SkBitmap* image, const std::wstring& text, @@ -114,7 +114,7 @@ MessageBubble* MessageBubble::Show(views::Widget* parent, MessageBubbleDelegate* delegate) { // The bubble will be destroyed when it is closed. MessageBubble* bubble = new MessageBubble( - views::Widget::CreateParams::TYPE_WINDOW, parent, image, text, help, + views::Widget::InitParams::TYPE_WINDOW, parent, image, text, help, true, delegate); bubble->InitBubble(parent, position_relative_to, arrow_location, bubble->text_->parent(), delegate); @@ -132,7 +132,7 @@ MessageBubble* MessageBubble::ShowNoGrab( MessageBubbleDelegate* delegate) { // The bubble will be destroyed when it is closed. MessageBubble* bubble = new MessageBubble( - views::Widget::CreateParams::TYPE_CONTROL, parent, image, text, help, + views::Widget::InitParams::TYPE_CONTROL, parent, image, text, help, false, delegate); bubble->InitBubble(parent, position_relative_to, arrow_location, bubble->text_->parent(), delegate); diff --git a/chrome/browser/chromeos/login/message_bubble.h b/chrome/browser/chromeos/login/message_bubble.h index d734c70..dd3fc9c 100644 --- a/chrome/browser/chromeos/login/message_bubble.h +++ b/chrome/browser/chromeos/login/message_bubble.h @@ -77,7 +77,7 @@ class MessageBubble : public Bubble, virtual void SetMouseCapture(); private: - MessageBubble(views::Widget::CreateParams::Type type, + MessageBubble(views::Widget::InitParams::Type type, views::Widget* parent, SkBitmap* image, const std::wstring& text, diff --git a/chrome/browser/chromeos/login/screen_locker.cc b/chrome/browser/chromeos/login/screen_locker.cc index 195d50a..e7c453e 100644 --- a/chrome/browser/chromeos/login/screen_locker.cc +++ b/chrome/browser/chromeos/login/screen_locker.cc @@ -685,7 +685,7 @@ void ScreenLocker::Init() { LockWindow* lock_window = new LockWindow(); lock_window_ = lock_window; - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.bounds = init_bounds; lock_window_->Init(params); @@ -709,8 +709,8 @@ void ScreenLocker::Init() { // namespace feels a bit ugly.) GrabWidget* cast_lock_widget = new GrabWidget(this); lock_widget_ = cast_lock_widget; - views::Widget::CreateParams lock_params( - views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams lock_params( + views::Widget::InitParams::TYPE_CONTROL); lock_params.transparent = true; lock_params.parent_widget = lock_window_; lock_widget_->Init(lock_params); diff --git a/chrome/browser/chromeos/login/user_controller.cc b/chrome/browser/chromeos/login/user_controller.cc index 208321f..465efc2 100644 --- a/chrome/browser/chromeos/login/user_controller.cc +++ b/chrome/browser/chromeos/login/user_controller.cc @@ -420,7 +420,7 @@ void UserController::CreateBorderWindow(int index, } border_window_ = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_WINDOW); + Widget::InitParams params(Widget::InitParams::TYPE_WINDOW); params.transparent = true; params.bounds = gfx::Rect(0, 0, width, height); border_window_->Init(params); diff --git a/chrome/browser/chromeos/login/user_controller_gtk.cc b/chrome/browser/chromeos/login/user_controller_gtk.cc index bcd5023..941a424 100644 --- a/chrome/browser/chromeos/login/user_controller_gtk.cc +++ b/chrome/browser/chromeos/login/user_controller_gtk.cc @@ -55,7 +55,7 @@ class ClickNotifyingWidget : public WidgetGtk { }; views::Widget* InitWidget(views::Widget* widget, const gfx::Rect& bounds) { - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.transparent = true; params.bounds = bounds; widget->Init(params); diff --git a/chrome/browser/chromeos/login/wizard_controller.cc b/chrome/browser/chromeos/login/wizard_controller.cc index 258908b..fbe2d00 100644 --- a/chrome/browser/chromeos/login/wizard_controller.cc +++ b/chrome/browser/chromeos/login/wizard_controller.cc @@ -601,8 +601,8 @@ views::Widget* WizardController::CreateScreenWindow( // are constantly updating its contents (like image view with video // stream). Hence enabling double buffer. static_cast<views::WidgetGtk*>(widget_)->EnableDoubleBuffer(true); - views::Widget::CreateParams widget_params( - views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams widget_params( + views::Widget::InitParams::TYPE_WINDOW); widget_params.transparent = true; widget_params.bounds = bounds; widget_->Init(widget_params); diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index 89317af..80ba89b 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -270,8 +270,8 @@ void BalloonViewImpl::ViewHierarchyChanged( control_view_host_.reset(views::Widget::CreateWidget()); static_cast<views::WidgetGtk*>(control_view_host_.get())-> EnableDoubleBuffer(true); - views::Widget::CreateParams params( - views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params( + views::Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.parent = GetParentNativeView(); control_view_host_->Init(params); diff --git a/chrome/browser/chromeos/notifications/notification_panel.cc b/chrome/browser/chromeos/notifications/notification_panel.cc index 1724b56..0e264c8 100644 --- a/chrome/browser/chromeos/notifications/notification_panel.cc +++ b/chrome/browser/chromeos/notifications/notification_panel.cc @@ -422,8 +422,8 @@ void NotificationPanel::Show() { gfx::Rect bounds = GetPreferredBounds(); bounds = bounds.Union(min_bounds_); - views::Widget::CreateParams params( - views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params( + views::Widget::InitParams::TYPE_WINDOW); params.bounds = bounds; panel_widget_->Init(params); // Set minimum bounds so that it can grow freely. @@ -439,7 +439,7 @@ void NotificationPanel::Show() { ViewportWidget* widget = new ViewportWidget(this); container_host_ = widget; container_host_->Init( - views::Widget::CreateParams(views::Widget::CreateParams::TYPE_CONTROL)); + views::Widget::InitParams(views::Widget::InitParams::TYPE_CONTROL)); container_host_->SetContentsView(balloon_container_.get()); // The window_contents_ is onwed by the WidgetGtk. Increase ref count // so that window_contents does not get deleted when detached. diff --git a/chrome/browser/chromeos/panels/panel_scroller.cc b/chrome/browser/chromeos/panels/panel_scroller.cc index 9572a19..c09a912 100644 --- a/chrome/browser/chromeos/panels/panel_scroller.cc +++ b/chrome/browser/chromeos/panels/panel_scroller.cc @@ -81,7 +81,7 @@ PanelScroller::~PanelScroller() { // static PanelScroller* PanelScroller::CreateWindow() { views::Widget* widget = views::Widget::CreateWidget(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.bounds = gfx::Rect(0, 0, 100, 800); widget->Init(params); diff --git a/chrome/browser/external_tab_container_win.cc b/chrome/browser/external_tab_container_win.cc index 6e86bb5..38fc80c 100644 --- a/chrome/browser/external_tab_container_win.cc +++ b/chrome/browser/external_tab_container_win.cc @@ -135,7 +135,7 @@ bool ExternalTabContainer::Init(Profile* profile, set_window_style(WS_POPUP | WS_CLIPCHILDREN); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.bounds = bounds; GetWidget()->Init(params); if (!IsWindow()) { diff --git a/chrome/browser/first_run/try_chrome_dialog_view.cc b/chrome/browser/first_run/try_chrome_dialog_view.cc index 47c9996..190cc56 100644 --- a/chrome/browser/first_run/try_chrome_dialog_view.cc +++ b/chrome/browser/first_run/try_chrome_dialog_view.cc @@ -71,7 +71,7 @@ TryChromeDialogView::Result TryChromeDialogView::ShowModal( return DIALOG_ERROR; } - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.can_activate = true; params.bounds = gfx::Rect(310, 160); popup_->Init(params); diff --git a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc index 0529dad..19bb2fa 100644 --- a/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc +++ b/chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.cc @@ -329,7 +329,7 @@ void AutocompletePopupContentsView::UpdatePopupAppearance() { if (popup_ == NULL) { // If the popup is currently closed, we need to create it. popup_ = (new AutocompletePopupClass)->AsWeakPtr(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.can_activate = false; params.transparent = true; params.parent = location_bar_->GetWidget()->GetNativeView(); diff --git a/chrome/browser/ui/views/browser_bubble_gtk.cc b/chrome/browser/ui/views/browser_bubble_gtk.cc index fdf2654..c566f4a 100644 --- a/chrome/browser/ui/views/browser_bubble_gtk.cc +++ b/chrome/browser/ui/views/browser_bubble_gtk.cc @@ -94,7 +94,7 @@ void BrowserBubble::InitPopup() { BubbleWidget* pop = new BubbleWidget(this); pop->MakeTransparent(); pop->make_transient_to_parent(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); params.parent = frame_->GetNativeView(); pop->Init(params); #if defined(OS_CHROMEOS) diff --git a/chrome/browser/ui/views/browser_bubble_win.cc b/chrome/browser/ui/views/browser_bubble_win.cc index 16b4266..7d3f10c 100644 --- a/chrome/browser/ui/views/browser_bubble_win.cc +++ b/chrome/browser/ui/views/browser_bubble_win.cc @@ -117,7 +117,7 @@ void BrowserBubble::InitPopup() { // We make the BorderWidgetWin the owner of the Bubble HWND, so that the // latter is displayed on top of the former. - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.parent = border_widget->GetNativeView(); popup_->Init(params); popup_->SetContentsView(view_); diff --git a/chrome/browser/ui/views/bubble/border_widget_win.cc b/chrome/browser/ui/views/bubble/border_widget_win.cc index e43558d..2fd2fc7 100644 --- a/chrome/browser/ui/views/bubble/border_widget_win.cc +++ b/chrome/browser/ui/views/bubble/border_widget_win.cc @@ -18,7 +18,7 @@ void BorderWidgetWin::InitBorderWidgetWin(BorderContents* border_contents, border_contents_ = border_contents; border_contents_->Init(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.parent = owner; GetWidget()->Init(params); diff --git a/chrome/browser/ui/views/bubble/bubble.cc b/chrome/browser/ui/views/bubble/bubble.cc index 3bcd8a2..b5cd2cb 100644 --- a/chrome/browser/ui/views/bubble/bubble.cc +++ b/chrome/browser/ui/views/bubble/bubble.cc @@ -69,7 +69,7 @@ Bubble* Bubble::ShowFocusless( views::View* contents, BubbleDelegate* delegate, bool show_while_screen_is_locked) { - Bubble* bubble = new Bubble(views::Widget::CreateParams::TYPE_POPUP, + Bubble* bubble = new Bubble(views::Widget::InitParams::TYPE_POPUP, show_while_screen_is_locked); bubble->InitBubble(parent, position_relative_to, arrow_location, contents, delegate); @@ -130,7 +130,7 @@ Bubble::Bubble() show_status_(kOpen), fade_away_on_close_(false), #if defined(OS_LINUX) - type_(views::Widget::CreateParams::TYPE_WINDOW), + type_(views::Widget::InitParams::TYPE_WINDOW), #endif #if defined(OS_CHROMEOS) show_while_screen_is_locked_(false), @@ -140,7 +140,7 @@ Bubble::Bubble() } #if defined(OS_CHROMEOS) -Bubble::Bubble(views::Widget::CreateParams::Type type, +Bubble::Bubble(views::Widget::InitParams::Type type, bool show_while_screen_is_locked) : border_contents_(NULL), delegate_(NULL), @@ -193,13 +193,13 @@ void Bubble::InitBubble(views::Widget* parent, // We make the BorderWidgetWin the owner of the Bubble HWND, so that the // latter is displayed on top of the former. - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.parent = border_->GetNativeView(); GetWidget()->Init(params); SetWindowText(GetNativeView(), delegate_->accessible_name().c_str()); #elif defined(OS_LINUX) - views::Widget::CreateParams params(type_); + views::Widget::InitParams params(type_); params.transparent = true; params.parent_widget = parent; GetWidget()->Init(params); diff --git a/chrome/browser/ui/views/bubble/bubble.h b/chrome/browser/ui/views/bubble/bubble.h index fe19dad..a2a1b35 100644 --- a/chrome/browser/ui/views/bubble/bubble.h +++ b/chrome/browser/ui/views/bubble/bubble.h @@ -135,7 +135,7 @@ class Bubble protected: Bubble(); #if defined(OS_CHROMEOS) - Bubble(views::Widget::CreateParams::Type type, + Bubble(views::Widget::InitParams::Type type, bool show_while_screen_is_locked); #endif virtual ~Bubble(); @@ -203,7 +203,7 @@ class Bubble #if defined(OS_LINUX) // Some callers want the bubble to be a child control instead of a window. - views::Widget::CreateParams::Type type_; + views::Widget::InitParams::Type type_; #endif #if defined(OS_CHROMEOS) // Should we set a property telling the window manager to show this window diff --git a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc index 1b3855b..740b59e 100644 --- a/chrome/browser/ui/views/constrained_html_delegate_gtk.cc +++ b/chrome/browser/ui/views/constrained_html_delegate_gtk.cc @@ -84,7 +84,7 @@ ConstrainedHtmlDelegateGtk::ConstrainedHtmlDelegateGtk( GURL(), PageTransition::START_PAGE); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); GetWidget()->Init(params); tab_container_ = new TabContentsContainer; diff --git a/chrome/browser/ui/views/dom_view_browsertest.cc b/chrome/browser/ui/views/dom_view_browsertest.cc index 2d5c3b9..2ccd015 100644 --- a/chrome/browser/ui/views/dom_view_browsertest.cc +++ b/chrome/browser/ui/views/dom_view_browsertest.cc @@ -15,7 +15,7 @@ class DOMViewTest : public InProcessBrowserTest { public: Widget* CreatePopupWindow() { Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + Widget::InitParams params(Widget::InitParams::TYPE_POPUP); params.bounds = gfx::Rect(0, 0, 400, 400); widget->Init(params); return widget; diff --git a/chrome/browser/ui/views/download/download_started_animation_win.cc b/chrome/browser/ui/views/download/download_started_animation_win.cc index e5a193b..91099a0 100644 --- a/chrome/browser/ui/views/download/download_started_animation_win.cc +++ b/chrome/browser/ui/views/download/download_started_animation_win.cc @@ -104,7 +104,7 @@ DownloadStartedAnimationWin::DownloadStartedAnimationWin( popup_ = views::Widget::CreateWidget(); popup_->SetOpacity(0x00); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.accept_events = false; params.parent = tab_contents_->GetNativeView(); diff --git a/chrome/browser/ui/views/dropdown_bar_host.cc b/chrome/browser/ui/views/dropdown_bar_host.cc index d65ebda..24e10f6 100644 --- a/chrome/browser/ui/views/dropdown_bar_host.cc +++ b/chrome/browser/ui/views/dropdown_bar_host.cc @@ -55,7 +55,7 @@ void DropdownBarHost::Init(DropdownBarView* view) { // Initialize the host. host_.reset(views::Widget::CreateWidget()); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.parent_widget = browser_view_->GetWidget(); host_->Init(params); diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index a3e93da..aa38589 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -60,7 +60,7 @@ BrowserFrameWin::~BrowserFrameWin() { } void BrowserFrameWin::InitBrowserFrame() { - GetWidget()->Init(views::Widget::WindowCreateParams()); + GetWidget()->Init(views::Widget::WindowInitParams()); } // static diff --git a/chrome/browser/ui/views/frame/contents_container.cc b/chrome/browser/ui/views/frame/contents_container.cc index ebe4cb3..b3b96ef 100644 --- a/chrome/browser/ui/views/frame/contents_container.cc +++ b/chrome/browser/ui/views/frame/contents_container.cc @@ -157,7 +157,7 @@ void ContentsContainer::CreateOverlay(int initial_opacity) { gfx::Point screen_origin; views::View::ConvertPointToScreen(active_, &screen_origin); gfx::Rect overlay_bounds(screen_origin, active_->size()); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.accept_events = false; params.parent = active_->GetWidget()->GetNativeView(); diff --git a/chrome/browser/ui/views/fullscreen_exit_bubble.cc b/chrome/browser/ui/views/fullscreen_exit_bubble.cc index 9f79e5f..005a840 100644 --- a/chrome/browser/ui/views/fullscreen_exit_bubble.cc +++ b/chrome/browser/ui/views/fullscreen_exit_bubble.cc @@ -134,7 +134,7 @@ FullscreenExitBubble::FullscreenExitBubble( // Initialize the popup. popup_ = views::Widget::CreateWidget(); popup_->SetOpacity(static_cast<unsigned char>(0xff * kOpacity)); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.can_activate = false; params.delete_on_destroy = false; diff --git a/chrome/browser/ui/views/generic_info_view_unittest.cc b/chrome/browser/ui/views/generic_info_view_unittest.cc index a3c8f0f..f822a15 100644 --- a/chrome/browser/ui/views/generic_info_view_unittest.cc +++ b/chrome/browser/ui/views/generic_info_view_unittest.cc @@ -32,7 +32,7 @@ TEST_F(GenericInfoViewTest, GenericInfoView) { const string16 kValue = ASCIIToUTF16("Value"); Widget* widget = Widget::CreateWidget(); - Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + Widget::InitParams params(Widget::InitParams::TYPE_POPUP); params.bounds = gfx::Rect(0, 0, 100, 100); widget->Init(params); RootView* root_view = widget->GetRootView(); diff --git a/chrome/browser/ui/views/native_constrained_window_win.cc b/chrome/browser/ui/views/native_constrained_window_win.cc index dc1b7d6..0a33526 100644 --- a/chrome/browser/ui/views/native_constrained_window_win.cc +++ b/chrome/browser/ui/views/native_constrained_window_win.cc @@ -27,8 +27,8 @@ class NativeConstrainedWindowWin : public NativeConstrainedWindow, private: // Overridden from NativeConstrainedWindow: virtual void InitNativeConstrainedWindow(gfx::NativeView parent) OVERRIDE { - views::Widget::CreateParams params( - views::Widget::CreateParams::TYPE_WINDOW); + views::Widget::InitParams params( + views::Widget::InitParams::TYPE_WINDOW); params.child = true; params.parent = parent; GetWidget()->Init(params); diff --git a/chrome/browser/ui/views/notifications/balloon_view.cc b/chrome/browser/ui/views/notifications/balloon_view.cc index c1827d3..da2d251 100644 --- a/chrome/browser/ui/views/notifications/balloon_view.cc +++ b/chrome/browser/ui/views/notifications/balloon_view.cc @@ -318,7 +318,7 @@ void BalloonViewImpl::Show(Balloon* balloon) { html_contents_->SetPreferredSize(gfx::Size(10000, 10000)); html_container_ = Widget::CreateWidget(); html_container_->SetAlwaysOnTop(true); - Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + Widget::InitParams params(Widget::InitParams::TYPE_POPUP); params.bounds = contents_rect; html_container_->Init(params); html_container_->SetContentsView(html_contents_->view()); diff --git a/chrome/browser/ui/views/status_bubble_views.cc b/chrome/browser/ui/views/status_bubble_views.cc index ec387f0..d7ae56a 100644 --- a/chrome/browser/ui/views/status_bubble_views.cc +++ b/chrome/browser/ui/views/status_bubble_views.cc @@ -566,7 +566,7 @@ void StatusBubbleViews::Init() { if (!expand_view_.get()) expand_view_.reset(new StatusViewExpander(this, view_)); popup_->SetOpacity(0x00); - Widget::CreateParams params(Widget::CreateParams::TYPE_POPUP); + Widget::InitParams params(Widget::InitParams::TYPE_POPUP); params.transparent = true; params.accept_events = false; params.delete_on_destroy = false; diff --git a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc index 566f9d0..4f0bc23 100644 --- a/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc +++ b/chrome/browser/ui/views/tab_contents/native_tab_contents_view_win.cc @@ -31,7 +31,7 @@ HWND GetHiddenTabHostWindow() { if (!widget) { widget = views::Widget::CreateWidget(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); widget->Init(params); // If a background window requests focus, the hidden tab host will // be activated to focus the tab. Use WS_DISABLED to prevent @@ -70,7 +70,7 @@ void NativeTabContentsViewWin::EndDragging() { // NativeTabContentsViewWin, NativeTabContentsView implementation: void NativeTabContentsViewWin::InitNativeTabContentsView() { - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.parent = GetHiddenTabHostWindow(); GetWidget()->Init(params); diff --git a/chrome/browser/ui/views/tab_contents/tab_contents_view_gtk.cc b/chrome/browser/ui/views/tab_contents/tab_contents_view_gtk.cc index 20eff86..6b8c426 100644 --- a/chrome/browser/ui/views/tab_contents/tab_contents_view_gtk.cc +++ b/chrome/browser/ui/views/tab_contents/tab_contents_view_gtk.cc @@ -149,7 +149,7 @@ void TabContentsViewGtk::RemoveConstrainedWindow( } void TabContentsViewGtk::CreateView(const gfx::Size& initial_size) { - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_CONTROL); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); params.delete_on_destroy = false; params.bounds = gfx::Rect(initial_size); GetWidget()->Init(params); diff --git a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc index 629368c..2cbfb45 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_controller.cc @@ -206,7 +206,7 @@ class DraggedTabController::DockDisplayer : public ui::AnimationDelegate { popup_ = views::Widget::CreateWidget(); popup_->SetOpacity(0x00); // TODO(sky): This should "just work" on Gtk now. - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.keep_on_top = true; params.bounds = info.GetPopupRect(); diff --git a/chrome/browser/ui/views/tabs/dragged_tab_view.cc b/chrome/browser/ui/views/tabs/dragged_tab_view.cc index 18ca918..79942bd 100644 --- a/chrome/browser/ui/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/ui/views/tabs/dragged_tab_view.cc @@ -50,7 +50,7 @@ DraggedTabView::DraggedTabView(const std::vector<views::View*>& renderers, show_contents_on_drag_ = false; } #endif - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.keep_on_top = true; params.delete_on_destroy = false; diff --git a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc index cbd90e2..a010e3d 100644 --- a/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc +++ b/chrome/browser/ui/views/tabs/native_view_photobooth_win.cc @@ -152,7 +152,7 @@ void NativeViewPhotoboothWin::CreateCaptureWindow(HWND initial_hwnd) { contents_rect.right - contents_rect.left, contents_rect.bottom - contents_rect.top); capture_window_ = views::Widget::CreateWidget(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.bounds = capture_bounds; capture_window_->Init(params); diff --git a/chrome/browser/ui/views/tabs/tab_strip.cc b/chrome/browser/ui/views/tabs/tab_strip.cc index 83b3e69..0aa10a2 100644 --- a/chrome/browser/ui/views/tabs/tab_strip.cc +++ b/chrome/browser/ui/views/tabs/tab_strip.cc @@ -861,7 +861,7 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) arrow_view->SetImage(GetDropArrowImage(point_down)); arrow_window = views::Widget::CreateWidget(); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.keep_on_top = true; params.transparent = true; params.accept_events = false; diff --git a/chrome/browser/ui/views/theme_install_bubble_view.cc b/chrome/browser/ui/views/theme_install_bubble_view.cc index f04ef8b..9f35eff 100644 --- a/chrome/browser/ui/views/theme_install_bubble_view.cc +++ b/chrome/browser/ui/views/theme_install_bubble_view.cc @@ -72,7 +72,7 @@ ThemeInstallBubbleView::ThemeInstallBubbleView(TabContents* tab_contents) popup_ = views::Widget::CreateWidget(); popup_->SetOpacity(0xCC); - views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); + views::Widget::InitParams params(views::Widget::InitParams::TYPE_POPUP); params.transparent = true; params.accept_events = false; params.parent = tab_contents->GetNativeView(); 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, |