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

Side by Side Diff: chrome/browser/ui/views/frame/contents_container.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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/frame/contents_container.h" 5 #include "chrome/browser/ui/views/frame/contents_container.h"
6 6
7 #include "base/logging.h" 7 #include "base/logging.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "ui/base/animation/slide_animation.h" 9 #include "ui/base/animation/slide_animation.h"
10 #include "views/background.h" 10 #include "views/background.h"
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after
145 if (preview_) 145 if (preview_)
146 preview_->SetBounds(0, 0, width(), height()); 146 preview_->SetBounds(0, 0, width(), height());
147 147
148 // Need to invoke views::View in case any views whose bounds didn't change 148 // Need to invoke views::View in case any views whose bounds didn't change
149 // still need a layout. 149 // still need a layout.
150 views::View::Layout(); 150 views::View::Layout();
151 } 151 }
152 152
153 void ContentsContainer::CreateOverlay(int initial_opacity) { 153 void ContentsContainer::CreateOverlay(int initial_opacity) {
154 DCHECK(!active_overlay_); 154 DCHECK(!active_overlay_);
155 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP); 155 active_overlay_ = views::Widget::CreateWidget();
156 params.transparent = true;
157 params.accept_events = false;
158 active_overlay_ = views::Widget::CreateWidget(params);
159 active_overlay_->SetOpacity(initial_opacity); 156 active_overlay_->SetOpacity(initial_opacity);
160 gfx::Point screen_origin; 157 gfx::Point screen_origin;
161 views::View::ConvertPointToScreen(active_, &screen_origin); 158 views::View::ConvertPointToScreen(active_, &screen_origin);
162 gfx::Rect overlay_bounds(screen_origin, active_->size()); 159 gfx::Rect overlay_bounds(screen_origin, active_->size());
163 active_overlay_->Init(active_->GetWidget()->GetNativeView(), overlay_bounds); 160 views::Widget::CreateParams params(views::Widget::CreateParams::TYPE_POPUP);
161 params.transparent = true;
162 params.accept_events = false;
163 params.parent = active_->GetWidget()->GetNativeView();
164 params.bounds = overlay_bounds;
165 active_overlay_->Init(params);
164 overlay_view_ = new OverlayContentView(this); 166 overlay_view_ = new OverlayContentView(this);
165 overlay_view_->set_background( 167 overlay_view_->set_background(
166 views::Background::CreateSolidBackground(SK_ColorWHITE)); 168 views::Background::CreateSolidBackground(SK_ColorWHITE));
167 active_overlay_->SetContentsView(overlay_view_); 169 active_overlay_->SetContentsView(overlay_view_);
168 active_overlay_->Show(); 170 active_overlay_->Show();
169 active_overlay_->MoveAboveWidget(active_->GetWidget()); 171 active_overlay_->MoveAboveWidget(active_->GetWidget());
170 } 172 }
171 173
172 void ContentsContainer::OverlayViewDestroyed() { 174 void ContentsContainer::OverlayViewDestroyed() {
173 active_overlay_ = NULL; 175 active_overlay_ = NULL;
174 overlay_view_ = NULL; 176 overlay_view_ = NULL;
175 } 177 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_frame_win.cc ('k') | chrome/browser/ui/views/fullscreen_exit_bubble.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698