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

Side by Side Diff: ash/shelf/shelf_button.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 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 "ash/shelf/shelf_button.h" 5 #include "ash/shelf/shelf_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/ash_constants.h" 9 #include "ash/ash_constants.h"
10 #include "ash/ash_switches.h" 10 #include "ash/ash_switches.h"
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
221 // static 221 // static
222 const char ShelfButton::kViewClassName[] = "ash/ShelfButton"; 222 const char ShelfButton::kViewClassName[] = "ash/ShelfButton";
223 223
224 ShelfButton::ShelfButton(ShelfView* shelf_view) 224 ShelfButton::ShelfButton(ShelfView* shelf_view)
225 : CustomButton(shelf_view), 225 : CustomButton(shelf_view),
226 shelf_view_(shelf_view), 226 shelf_view_(shelf_view),
227 icon_view_(new views::ImageView()), 227 icon_view_(new views::ImageView()),
228 bar_(new BarView(shelf_view->shelf())), 228 bar_(new BarView(shelf_view->shelf())),
229 state_(STATE_NORMAL), 229 state_(STATE_NORMAL),
230 destroyed_flag_(nullptr) { 230 destroyed_flag_(nullptr) {
231 SetAccessibilityFocusable(true); 231 SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
232 232
233 const gfx::ShadowValue kShadows[] = { 233 const gfx::ShadowValue kShadows[] = {
234 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)), 234 gfx::ShadowValue(gfx::Vector2d(0, 2), 0, SkColorSetARGB(0x1A, 0, 0, 0)),
235 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)), 235 gfx::ShadowValue(gfx::Vector2d(0, 3), 1, SkColorSetARGB(0x1A, 0, 0, 0)),
236 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)), 236 gfx::ShadowValue(gfx::Vector2d(0, 0), 1, SkColorSetARGB(0x54, 0, 0, 0)),
237 }; 237 };
238 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows)); 238 icon_shadows_.assign(kShadows, kShadows + arraysize(kShadows));
239 239
240 // TODO: refactor the layers so each button doesn't require 2. 240 // TODO: refactor the layers so each button doesn't require 2.
241 icon_view_->SetPaintToLayer(true); 241 icon_view_->SetPaintToLayer(true);
(...skipping 262 matching lines...) Expand 10 before | Expand all | Expand 10 after
504 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( 504 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment(
505 views::ImageView::TRAILING, views::ImageView::CENTER, 505 views::ImageView::TRAILING, views::ImageView::CENTER,
506 views::ImageView::CENTER)); 506 views::ImageView::CENTER));
507 bar_->SchedulePaint(); 507 bar_->SchedulePaint();
508 } 508 }
509 509
510 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); 510 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL);
511 } 511 }
512 512
513 } // namespace ash 513 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.cc ('k') | ash/shell/lock_view.cc » ('j') | ui/views/view.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698