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

Side by Side Diff: ash/system/brightness/tray_brightness.cc

Issue 10086005: ash: Show better focus rects for the tray. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 8 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) 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/brightness/tray_brightness.h" 5 #include "ash/system/brightness/tray_brightness.h"
6 6
7 #include "ash/accelerators/accelerator_controller.h" 7 #include "ash/accelerators/accelerator_controller.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/system/brightness/brightness_control_delegate.h" 9 #include "ash/system/brightness/brightness_control_delegate.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal, 49 SetLayoutManager(new views::BoxLayout(views::BoxLayout::kHorizontal,
50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems)); 50 kTrayPopupPaddingHorizontal, 0, kTrayPopupPaddingBetweenItems));
51 51
52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight); 52 views::ImageView* icon = new FixedSizedImageView(0, kTrayPopupItemHeight);
53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed( 53 gfx::Image image = ui::ResourceBundle::GetSharedInstance().GetImageNamed(
54 IDR_AURA_UBER_TRAY_BRIGHTNESS); 54 IDR_AURA_UBER_TRAY_BRIGHTNESS);
55 icon->SetImage(image.ToSkBitmap()); 55 icon->SetImage(image.ToSkBitmap());
56 AddChildView(icon); 56 AddChildView(icon);
57 57
58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL); 58 slider_ = new views::Slider(this, views::Slider::HORIZONTAL);
59 slider_->set_focus_color(kFocusBorderColor);
59 slider_->SetValue(static_cast<float>(initial_percent / 100.0)); 60 slider_->SetValue(static_cast<float>(initial_percent / 100.0));
60 slider_->SetAccessibleName( 61 slider_->SetAccessibleName(
61 ui::ResourceBundle::GetSharedInstance().GetLocalizedString( 62 ui::ResourceBundle::GetSharedInstance().GetLocalizedString(
62 IDS_ASH_STATUS_TRAY_BRIGHTNESS)); 63 IDS_ASH_STATUS_TRAY_BRIGHTNESS));
63 AddChildView(slider_); 64 AddChildView(slider_);
64 } 65 }
65 66
66 virtual ~BrightnessView() {} 67 virtual ~BrightnessView() {}
67 68
68 // |percent| is in the range [0.0, 100.0]. 69 // |percent| is in the range [0.0, 100.0].
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 return; 194 return;
194 195
195 if (brightness_view_.get()) 196 if (brightness_view_.get())
196 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds); 197 SetDetailedViewCloseDelay(kTrayPopupAutoCloseDelayInSeconds);
197 else 198 else
198 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false); 199 PopupDetailedView(kTrayPopupAutoCloseDelayInSeconds, false);
199 } 200 }
200 201
201 } // namespace internal 202 } // namespace internal
202 } // namespace ash 203 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698