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

Side by Side Diff: ui/app_list/views/folder_header_view.cc

Issue 78803002: Fixing focus highlight on high DPI devices for accessibility (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Created 7 years 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
« no previous file with comments | « ash/system/tray/tray_popup_label_button.cc ('k') | ui/gfx/canvas.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/app_list/views/folder_header_view.h" 5 #include "ui/app_list/views/folder_header_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "grit/ui_resources.h" 8 #include "grit/ui_resources.h"
9 #include "grit/ui_strings.h" 9 #include "grit/ui_strings.h"
10 #include "ui/app_list/app_list_constants.h" 10 #include "ui/app_list/app_list_constants.h"
(...skipping 18 matching lines...) Expand all
29 const int kBottomSeparatorHeight = 1; 29 const int kBottomSeparatorHeight = 1;
30 30
31 const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0); 31 const SkColor kHintTextColor = SkColorSetRGB(0xA0, 0xA0, 0xA0);
32 32
33 } // namespace 33 } // namespace
34 34
35 class FolderHeaderView::FolderNameView : public views::Textfield { 35 class FolderHeaderView::FolderNameView : public views::Textfield {
36 public: 36 public:
37 FolderNameView() { 37 FolderNameView() {
38 set_border(views::Border::CreateEmptyBorder(1, 1, 1, 1)); 38 set_border(views::Border::CreateEmptyBorder(1, 1, 1, 1));
39 const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
40 set_focus_border(views::FocusBorder::CreateSolidFocusBorder(
41 kFocusBorderColor,
42 gfx::Insets(0, 0, 1, 1)));
39 } 43 }
40 44
41 virtual ~FolderNameView() { 45 virtual ~FolderNameView() {
42 } 46 }
43 47
44 // Overridden from views::View: 48 // Overridden from views::View:
45 virtual gfx::Size GetPreferredSize() OVERRIDE { 49 virtual gfx::Size GetPreferredSize() OVERRIDE {
46 return gfx::Size(kFolderNameWidth, kFolderNameHeight); 50 return gfx::Size(kFolderNameWidth, kFolderNameHeight);
47 } 51 }
48 52
49 virtual void OnPaintFocusBorder(gfx::Canvas* canvas) OVERRIDE {
50 const SkColor kFocusBorderColor = SkColorSetRGB(64, 128, 250);
51 if (HasFocus()) {
52 gfx::Rect rect = GetLocalBounds();
53 rect.Inset(0, 0, 1, 1);
54 canvas->DrawRect(rect, kFocusBorderColor);
55 }
56 }
57
58 private: 53 private:
59 DISALLOW_COPY_AND_ASSIGN(FolderNameView); 54 DISALLOW_COPY_AND_ASSIGN(FolderNameView);
60 }; 55 };
61 56
62 FolderHeaderView::FolderHeaderView(FolderHeaderViewDelegate* delegate) 57 FolderHeaderView::FolderHeaderView(FolderHeaderViewDelegate* delegate)
63 : folder_item_(NULL), 58 : folder_item_(NULL),
64 back_button_(new views::ImageButton(this)), 59 back_button_(new views::ImageButton(this)),
65 folder_name_view_(new FolderNameView), 60 folder_name_view_(new FolderNameView),
66 delegate_(delegate) { 61 delegate_(delegate) {
67 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 62 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 } 165 }
171 166
172 void FolderHeaderView::ItemIsInstallingChanged() { 167 void FolderHeaderView::ItemIsInstallingChanged() {
173 } 168 }
174 169
175 void FolderHeaderView::ItemPercentDownloadedChanged() { 170 void FolderHeaderView::ItemPercentDownloadedChanged() {
176 } 171 }
177 172
178 } // namespace app_list 173 } // namespace app_list
179 174
OLDNEW
« no previous file with comments | « ash/system/tray/tray_popup_label_button.cc ('k') | ui/gfx/canvas.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698