diff options
author | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 23:24:42 +0000 |
---|---|---|
committer | estade@chromium.org <estade@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-06-14 23:24:42 +0000 |
commit | f1b149409ab54866b1a1e619ab9d59dc1d8f808d (patch) | |
tree | c736a35d6a1923905cb6ca4471719e7b88eae301 /ui/views | |
parent | 00f0caa6a7ccb0333306951688fbb0765e4e8b10 (diff) | |
download | chromium_src-f1b149409ab54866b1a1e619ab9d59dc1d8f808d.zip chromium_src-f1b149409ab54866b1a1e619ab9d59dc1d8f808d.tar.gz chromium_src-f1b149409ab54866b1a1e619ab9d59dc1d8f808d.tar.bz2 |
Autofill dialog splash page on Views
BUG=243555
Review URL: https://chromiumcodereview.appspot.com/16358027
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@206515 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui/views')
-rw-r--r-- | ui/views/widget/widget.cc | 1 | ||||
-rw-r--r-- | ui/views/widget/widget_delegate.cc | 4 | ||||
-rw-r--r-- | ui/views/widget/widget_delegate.h | 6 | ||||
-rw-r--r-- | ui/views/window/non_client_view.cc | 21 | ||||
-rw-r--r-- | ui/views/window/non_client_view.h | 7 |
5 files changed, 38 insertions, 1 deletions
diff --git a/ui/views/widget/widget.cc b/ui/views/widget/widget.cc index cbf7f43..63610cb 100644 --- a/ui/views/widget/widget.cc +++ b/ui/views/widget/widget.cc @@ -378,6 +378,7 @@ void Widget::Init(const InitParams& in_params) { // Create the ClientView, add it to the NonClientView and add the // NonClientView to the RootView. This will cause everything to be parented. non_client_view_->set_client_view(widget_delegate_->CreateClientView(this)); + non_client_view_->SetOverlayView(widget_delegate_->CreateOverlayView()); SetContentsView(non_client_view_); SetInitialBounds(params.bounds); if (params.show_state == ui::SHOW_STATE_MAXIMIZED) diff --git a/ui/views/widget/widget_delegate.cc b/ui/views/widget/widget_delegate.cc index bf73efc..dcb7c36 100644 --- a/ui/views/widget/widget_delegate.cc +++ b/ui/views/widget/widget_delegate.cc @@ -146,6 +146,10 @@ NonClientFrameView* WidgetDelegate::CreateNonClientFrameView(Widget* widget) { return NULL; } +View* WidgetDelegate::CreateOverlayView() { + return NULL; +} + bool WidgetDelegate::WillProcessWorkAreaChange() const { return false; } diff --git a/ui/views/widget/widget_delegate.h b/ui/views/widget/widget_delegate.h index e06b697..f465ffb 100644 --- a/ui/views/widget/widget_delegate.h +++ b/ui/views/widget/widget_delegate.h @@ -141,6 +141,12 @@ class VIEWS_EXPORT WidgetDelegate { // Return NULL to use the default one. virtual NonClientFrameView* CreateNonClientFrameView(Widget* widget); + // Called by the Widget to create the overlay View for this widget. Return + // NULL for no overlay. The overlay View will fill the Widget and sit on top + // of the ClientView and NonClientFrameView (both visually and wrt click + // targeting). + virtual View* CreateOverlayView(); + // Returns true if the window can be notified with the work area change. // Otherwise, the work area change for the top window will be processed by // the default window manager. In some cases, like panel, we would like to diff --git a/ui/views/window/non_client_view.cc b/ui/views/window/non_client_view.cc index c6cb594..316d00f 100644 --- a/ui/views/window/non_client_view.cc +++ b/ui/views/window/non_client_view.cc @@ -27,12 +27,14 @@ const char NonClientView::kViewClassName[] = // handling mouse messages. static const int kFrameViewIndex = 0; static const int kClientViewIndex = 1; +// The overlay view is always on top (index == child_count() - 1). //////////////////////////////////////////////////////////////////////////////// // NonClientView, public: NonClientView::NonClientView() - : client_view_(NULL) { + : client_view_(NULL), + overlay_view_(NULL) { } NonClientView::~NonClientView() { @@ -51,6 +53,18 @@ void NonClientView::SetFrameView(NonClientFrameView* frame_view) { AddChildViewAt(frame_view_.get(), kFrameViewIndex); } +void NonClientView::SetOverlayView(View* view) { + if (overlay_view_) + RemoveChildView(overlay_view_); + + if (!view) + return; + + overlay_view_ = view; + if (parent()) + AddChildView(overlay_view_); +} + bool NonClientView::CanClose() { return client_view_->CanClose(); } @@ -147,6 +161,9 @@ void NonClientView::Layout() { // We need to manually call Layout on the ClientView as well for the same // reason as above. client_view_->Layout(); + + if (overlay_view_ && overlay_view_->visible()) + overlay_view_->SetBoundsRect(GetLocalBounds()); } void NonClientView::ViewHierarchyChanged( @@ -157,6 +174,8 @@ void NonClientView::ViewHierarchyChanged( if (details.is_add && GetWidget() && details.child == this) { AddChildViewAt(frame_view_.get(), kFrameViewIndex); AddChildViewAt(client_view_, kClientViewIndex); + if (overlay_view_) + AddChildView(overlay_view_); } } diff --git a/ui/views/window/non_client_view.h b/ui/views/window/non_client_view.h index 64944e6..e5be44e 100644 --- a/ui/views/window/non_client_view.h +++ b/ui/views/window/non_client_view.h @@ -145,6 +145,9 @@ class VIEWS_EXPORT NonClientView : public View { // Replaces the current NonClientFrameView (if any) with the specified one. void SetFrameView(NonClientFrameView* frame_view); + // Replaces the current |overlay_view_| (if any) with the specified one. + void SetOverlayView(View* view); + // Returns true if the ClientView determines that the containing window can be // closed, false otherwise. bool CanClose(); @@ -233,6 +236,10 @@ class VIEWS_EXPORT NonClientView : public View { // dynamically as the system settings change. scoped_ptr<NonClientFrameView> frame_view_; + // The overlay view, when non-NULL and visible, takes up the entire widget and + // is placed on top of the ClientView and NonClientFrameView. + View* overlay_view_; + // The accessible name of this view. string16 accessible_name_; |