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

Unified Diff: views/widget/widget.h

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
« no previous file with comments | « views/widget/native_widget_test_utils_win.cc ('k') | views/widget/widget.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/widget.h
===================================================================
--- views/widget/widget.h (revision 83020)
+++ views/widget/widget.h (working copy)
@@ -12,6 +12,7 @@
#include "base/memory/scoped_ptr.h"
#include "ui/base/accessibility/accessibility_types.h"
#include "ui/gfx/native_widget_types.h"
+#include "ui/gfx/rect.h"
#include "views/focus/focus_manager.h"
#include "views/widget/native_widget_delegate.h"
@@ -61,6 +62,7 @@
class Widget : public internal::NativeWidgetDelegate,
public FocusTraversable {
public:
+ // TODO(beng): Rename to InitParams now this is required for Init().
struct CreateParams {
enum Type {
TYPE_WINDOW, // A Window, like a frame window.
@@ -74,7 +76,6 @@
explicit CreateParams(Type type);
Type type;
-
bool child;
bool transparent;
bool accept_events;
@@ -83,14 +84,18 @@
bool delete_on_destroy;
bool mirror_origin_in_rtl;
bool has_dropshadow;
+ gfx::NativeView parent;
+ Widget* parent_widget;
+ gfx::Rect bounds;
NativeWidget* native_widget;
};
+ static CreateParams WindowCreateParams();
Widget();
virtual ~Widget();
// Creates a Widget instance with the supplied params.
- static Widget* CreateWidget(const CreateParams& params);
+ static Widget* CreateWidget();
// Enumerates all windows pertaining to us and notifies their
// view hierarchies that the locale has changed.
@@ -104,8 +109,7 @@
const Widget* target,
gfx::Rect* rect);
- // Sets the creation params for the Widget.
- void SetCreateParams(const CreateParams& params);
+ void Init(const CreateParams& params);
// Unconverted methods -------------------------------------------------------
@@ -113,16 +117,6 @@
// Widget subclasses are still implementing these methods by overriding from
// here rather than by implementing NativeWidget.
- // Initialize the Widget with a parent and an initial desired size.
- // |contents_view| is the view that will be the single child of RootView
- // within this Widget. As contents_view is inserted into RootView's tree,
- // RootView assumes ownership of this view and cleaning it up. If you remove
- // this view, you are responsible for its destruction. If this value is NULL,
- // the caller is responsible for populating the RootView, and sizing its
- // contents as the window is sized.
- virtual void Init(gfx::NativeView parent, const gfx::Rect& bounds);
- virtual void InitWithWidget(Widget* parent, const gfx::Rect& bounds);
-
// Returns the gfx::NativeView associated with this Widget.
virtual gfx::NativeView GetNativeView() const;
« no previous file with comments | « views/widget/native_widget_test_utils_win.cc ('k') | views/widget/widget.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698