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

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

Issue 11415014: Stop using shell::GetInstance()->system_tray() in system tray items (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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) 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 "third_party/skia/include/core/SkCanvas.h" 7 #include "third_party/skia/include/core/SkCanvas.h"
8 #include "third_party/skia/include/core/SkColor.h" 8 #include "third_party/skia/include/core/SkColor.h"
9 #include "third_party/skia/include/core/SkPaint.h" 9 #include "third_party/skia/include/core/SkPaint.h"
10 #include "third_party/skia/include/core/SkPath.h" 10 #include "third_party/skia/include/core/SkPath.h"
(...skipping 288 matching lines...) Expand 10 before | Expand all | Expand 10 after
299 bubble_content_mask_->layer()->SetBounds(layer()->bounds()); 299 bubble_content_mask_->layer()->SetBounds(layer()->bounds());
300 GetWidget()->GetRootView()->SchedulePaint(); 300 GetWidget()->GetRootView()->SchedulePaint();
301 } 301 }
302 302
303 void TrayBubbleView::SetMaxHeight(int height) { 303 void TrayBubbleView::SetMaxHeight(int height) {
304 params_.max_height = height; 304 params_.max_height = height;
305 if (GetWidget()) 305 if (GetWidget())
306 SizeToContents(); 306 SizeToContents();
307 } 307 }
308 308
309 void TrayBubbleView::SetMinWidth(int width) {
310 if (params_.bubble_width >= width)
311 return;
312 params_.bubble_width = width;
313 if (GetWidget())
314 SizeToContents();
315 }
316
309 void TrayBubbleView::SetPaintArrow(bool paint_arrow) { 317 void TrayBubbleView::SetPaintArrow(bool paint_arrow) {
310 bubble_border_->set_paint_arrow(paint_arrow); 318 bubble_border_->set_paint_arrow(paint_arrow);
311 } 319 }
312 320
313 gfx::Insets TrayBubbleView::GetBorderInsets() const { 321 gfx::Insets TrayBubbleView::GetBorderInsets() const {
314 return bubble_border_->GetInsets(); 322 return bubble_border_->GetInsets();
315 } 323 }
316 324
317 void TrayBubbleView::Init() { 325 void TrayBubbleView::Init() {
318 views::BoxLayout* layout = new BottomAlignedBoxLayout(this); 326 views::BoxLayout* layout = new BottomAlignedBoxLayout(this);
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
382 views::View* parent, 390 views::View* parent,
383 views::View* child) { 391 views::View* child) {
384 if (is_add && child == this) { 392 if (is_add && child == this) {
385 parent->SetPaintToLayer(true); 393 parent->SetPaintToLayer(true);
386 parent->SetFillsBoundsOpaquely(true); 394 parent->SetFillsBoundsOpaquely(true);
387 parent->layer()->SetMasksToBounds(true); 395 parent->layer()->SetMasksToBounds(true);
388 } 396 }
389 } 397 }
390 398
391 } // namespace views 399 } // namespace views
OLDNEW
« ui/views/bubble/tray_bubble_view.h ('K') | « ui/views/bubble/tray_bubble_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698