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

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: Address msw style nits. 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
« no previous file with comments | « no previous file | ash/system/tray/tray_background_view.cc » ('j') | 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 "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())
380 init_params.arrow_paint_type = views::BubbleBorder::PAINT_TRANSPARENT;
379 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type); 381 SystemTrayBubble* bubble = new SystemTrayBubble(this, items, bubble_type);
380 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble)); 382 system_bubble_.reset(new internal::SystemBubbleWrapper(bubble));
381 system_bubble_->InitView(this, tray_container(), &init_params); 383 system_bubble_->InitView(this, tray_container(), &init_params);
382 } 384 }
383 // Save height of default view for creating detailed views directly. 385 // Save height of default view for creating detailed views directly.
384 if (!detailed) 386 if (!detailed)
385 default_bubble_height_ = system_bubble_->bubble_view()->height(); 387 default_bubble_height_ = system_bubble_->bubble_view()->height();
386 388
387 if (detailed && items.size() > 0) 389 if (detailed && items.size() > 0)
388 detailed_item_ = items[0]; 390 detailed_item_ = items[0];
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 ConvertPointToWidget(this, &point); 534 ConvertPointToWidget(this, &point);
533 arrow_offset = point.x(); 535 arrow_offset = point.x();
534 } 536 }
535 } 537 }
536 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset); 538 ShowDefaultViewWithOffset(BUBBLE_CREATE_NEW, arrow_offset);
537 } 539 }
538 return true; 540 return true;
539 } 541 }
540 542
541 } // namespace ash 543 } // namespace ash
OLDNEW
« no previous file with comments | « no previous file | ash/system/tray/tray_background_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698