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

Side by Side Diff: ash/system/user/tray_user.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/user/tray_user.h" 5 #include "ash/system/user/tray_user.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/system/tray/system_tray_delegate.h" 8 #include "ash/system/tray/system_tray_delegate.h"
9 #include "ash/system/tray/tray_constants.h" 9 #include "ash/system/tray/tray_constants.h"
10 #include "base/utf_string_conversions.h" 10 #include "base/utf_string_conversions.h"
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 views::TextButton::OnPaintBackground(canvas); 80 views::TextButton::OnPaintBackground(canvas);
81 } 81 }
82 82
83 virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE { 83 virtual void OnPaintBorder(gfx::Canvas* canvas) OVERRIDE {
84 if (hover_) 84 if (hover_)
85 hover_border_->Paint(*this, canvas); 85 hover_border_->Paint(*this, canvas);
86 else 86 else
87 views::TextButton::OnPaintBorder(canvas); 87 views::TextButton::OnPaintBorder(canvas);
88 } 88 }
89 89
90 void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE {
91 if (HasFocus() && (focusable() || IsAccessibilityFocusable())) {
92 canvas->DrawRect(gfx::Rect(1, 1, width() - 3, height() - 3),
93 ash::kFocusBorderColor);
94 }
95 }
96
90 bool hover_; 97 bool hover_;
91 scoped_ptr<views::Background> hover_bg_; 98 scoped_ptr<views::Background> hover_bg_;
92 scoped_ptr<views::Border> hover_border_; 99 scoped_ptr<views::Border> hover_border_;
93 100
94 DISALLOW_COPY_AND_ASSIGN(TrayButton); 101 DISALLOW_COPY_AND_ASSIGN(TrayButton);
95 }; 102 };
96 103
97 } // namespace 104 } // namespace
98 105
99 namespace ash { 106 namespace ash {
(...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 } 363 }
357 364
358 void TrayUser::OnUserUpdate() { 365 void TrayUser::OnUserUpdate() {
359 avatar_->SetImage( 366 avatar_->SetImage(
360 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(), 367 ash::Shell::GetInstance()->tray_delegate()->GetUserImage(),
361 gfx::Size(kUserIconSize, kUserIconSize)); 368 gfx::Size(kUserIconSize, kUserIconSize));
362 } 369 }
363 370
364 } // namespace internal 371 } // namespace internal
365 } // namespace ash 372 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698