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

Side by Side Diff: ui/views/bubble/tray_bubble_view.cc

Issue 11836003: Allow message center and related bubbles to render on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cut out SlideOutView when not using Aura. Created 7 years, 11 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
« no previous file with comments | « ui/message_center/quiet_mode_bubble.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "ui/views/bubble/tray_bubble_view.h" 5 #include "ui/views/bubble/tray_bubble_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "third_party/skia/include/core/SkCanvas.h" 9 #include "third_party/skia/include/core/SkCanvas.h"
10 #include "third_party/skia/include/core/SkColor.h" 10 #include "third_party/skia/include/core/SkColor.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 : views::BubbleDelegateView(anchor, init_params.arrow_location), 266 : views::BubbleDelegateView(anchor, init_params.arrow_location),
267 params_(init_params), 267 params_(init_params),
268 delegate_(delegate), 268 delegate_(delegate),
269 preferred_width_(init_params.min_width), 269 preferred_width_(init_params.min_width),
270 bubble_border_(NULL), 270 bubble_border_(NULL),
271 is_gesture_dragging_(false) { 271 is_gesture_dragging_(false) {
272 set_parent_window(parent_window); 272 set_parent_window(parent_window);
273 set_notify_enter_exit_on_child(true); 273 set_notify_enter_exit_on_child(true);
274 set_close_on_deactivate(init_params.close_on_deactivate); 274 set_close_on_deactivate(init_params.close_on_deactivate);
275 set_margins(gfx::Insets()); 275 set_margins(gfx::Insets());
276 SetPaintToLayer(true);
277 SetFillsBoundsOpaquely(true);
278
279 bubble_border_ = new TrayBubbleBorder(this, anchor_view(), params_); 276 bubble_border_ = new TrayBubbleBorder(this, anchor_view(), params_);
280 277
281 bubble_content_mask_.reset( 278 #ifdef USE_AURA
282 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius() - 1)); 279 SetPaintToLayer(true);
280 SetFillsBoundsOpaquely(true);
281
282 bubble_content_mask_.reset(
283 new TrayBubbleContentMask(bubble_border_->GetBorderCornerRadius() - 1));
Jun Mukai 2013/01/12 01:32:57 fix the indent
dewittj 2013/01/12 01:38:10 Done.
284 #endif //USE_AURA
283 } 285 }
284 286
285 TrayBubbleView::~TrayBubbleView() { 287 TrayBubbleView::~TrayBubbleView() {
286 // Inform host items (models) that their views are being destroyed. 288 // Inform host items (models) that their views are being destroyed.
287 if (delegate_) 289 if (delegate_)
288 delegate_->BubbleViewDestroyed(); 290 delegate_->BubbleViewDestroyed();
289 } 291 }
290 292
291 void TrayBubbleView::InitializeAndShowBubble() { 293 void TrayBubbleView::InitializeAndShowBubble() {
292 // Must occur after call to BubbleDelegateView::CreateBubble(). 294 // Must occur after call to BubbleDelegateView::CreateBubble().
293 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 295 SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
294 bubble_border_->UpdateArrowOffset(); 296 bubble_border_->UpdateArrowOffset();
295 297
298 #ifdef USE_AURA
296 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer()); 299 layer()->parent()->SetMaskLayer(bubble_content_mask_->layer());
300 #endif // USE_AURA
297 301
298 Show(); 302 Show();
299 UpdateBubble(); 303 UpdateBubble();
300 } 304 }
301 305
302 void TrayBubbleView::UpdateBubble() { 306 void TrayBubbleView::UpdateBubble() {
303 SizeToContents(); 307 SizeToContents();
308 #ifdef USE_AURA
304 bubble_content_mask_->layer()->SetBounds(layer()->bounds()); 309 bubble_content_mask_->layer()->SetBounds(layer()->bounds());
310 #endif // USE_AURA
305 GetWidget()->GetRootView()->SchedulePaint(); 311 GetWidget()->GetRootView()->SchedulePaint();
306 } 312 }
307 313
308 void TrayBubbleView::SetMaxHeight(int height) { 314 void TrayBubbleView::SetMaxHeight(int height) {
309 params_.max_height = height; 315 params_.max_height = height;
310 if (GetWidget()) 316 if (GetWidget())
311 SizeToContents(); 317 SizeToContents();
312 } 318 }
313 319
314 void TrayBubbleView::SetWidth(int width) { 320 void TrayBubbleView::SetWidth(int width) {
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 } 400 }
395 } 401 }
396 402
397 void TrayBubbleView::ChildPreferredSizeChanged(View* child) { 403 void TrayBubbleView::ChildPreferredSizeChanged(View* child) {
398 SizeToContents(); 404 SizeToContents();
399 } 405 }
400 406
401 void TrayBubbleView::ViewHierarchyChanged(bool is_add, 407 void TrayBubbleView::ViewHierarchyChanged(bool is_add,
402 views::View* parent, 408 views::View* parent,
403 views::View* child) { 409 views::View* child) {
410 #ifdef USE_AURA
404 if (is_add && child == this) { 411 if (is_add && child == this) {
405 parent->SetPaintToLayer(true); 412 parent->SetPaintToLayer(true);
406 parent->SetFillsBoundsOpaquely(true); 413 parent->SetFillsBoundsOpaquely(true);
407 parent->layer()->SetMasksToBounds(true); 414 parent->layer()->SetMasksToBounds(true);
408 } 415 }
416 #endif // USE_AURA
409 } 417 }
410 418
411 } // namespace views 419 } // namespace views
OLDNEW
« no previous file with comments | « ui/message_center/quiet_mode_bubble.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698