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

Side by Side Diff: ash/system/tray/system_tray.cc

Issue 12310022: More flexibility in BubbleBorder arrow rendering. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Now with more user choice: bool -> enum. Created 7 years, 10 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
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 "ash/system/tray/system_tray.h" 5 #include "ash/system/tray/system_tray.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell/panel_window.h" 9 #include "ash/shell/panel_window.h"
10 #include "ash/shell_window_ids.h" 10 #include "ash/shell_window_ids.h"
(...skipping 357 matching lines...) Expand 10 before | Expand all | Expand 10 after
368 // This is the case where a volume control or brightness control bubble 368 // This is the case where a volume control or brightness control bubble
369 // is created. 369 // is created.
370 init_params.max_height = default_bubble_height_; 370 init_params.max_height = default_bubble_height_;
371 init_params.arrow_color = kBackgroundColor; 371 init_params.arrow_color = kBackgroundColor;
372 } else { 372 } else {
373 init_params.arrow_color = kHeaderBackgroundColor; 373 init_params.arrow_color = kHeaderBackgroundColor;
374 } 374 }
375 init_params.arrow_offset = arrow_offset; 375 init_params.arrow_offset = arrow_offset;
376 // For Volume and Brightness we don't want to show an arrow when 376 // For Volume and Brightness we don't want to show an arrow when
377 // they are shown in a bubble by themselves. 377 // they are shown in a bubble by themselves.
378 init_params.hide_arrow = items.size() == 1 && items[0]->ShouldHideArrow(); 378 init_params.arrow_paint_type = views::BubbleBorder::PAINT_NORMAL;
379 if (items.size() == 1 && items[0]->ShouldHideArrow()) {
msw 2013/02/21 07:29:29 nit: remove braces.
dewittj 2013/02/21 19:13:57 Done. This is my Chromium style weakness. Sorry!
380 init_params.arrow_paint_type = views::BubbleBorder::PAINT_TRANSPARENT;
381 }
379 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); 382 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type);
380 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble)); 383 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble));
381 system_bubble_->InitView(this, tray_container(), &init_params); 384 system_bubble_->InitView(this, tray_container(), &init_params);
382 } 385 }
383 // Save height of default view for creating detailed views directly. 386 // Save height of default view for creating detailed views directly.
384 if (!detailed) 387 if (!detailed)
385 default_bubble_height_ = system_bubble_->bubble_view()->height(); 388 default_bubble_height_ = system_bubble_->bubble_view()->height();
386 389
387 if (detailed && items.size() > 0) 390 if (detailed && items.size() > 0)
388 detailed_item_ = items[0]; 391 detailed_item_ = items[0];
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 ConvertPointToWidget(this, &point); 535 ConvertPointToWidget(this, &point);
533 arrow_offset = point.x(); 536 arrow_offset = point.x();
534 } 537 }
535 } 538 }
536 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); 539 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset);
537 } 540 }
538 return true; 541 return true;
539 } 542 }
540 543
541 } // namespace ash 544 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tray_background_view.cc » ('j') | ash/system/tray/tray_background_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698