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

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

Issue 1898633004: Views: Add new SetFocusBehavior method. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 4 years, 7 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 | « ash/shelf/overflow_button.cc ('k') | ash/shell/lock_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 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(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 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
501 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment( 501 bar_->SetVerticalAlignment(shelf->SelectValueForShelfAlignment(
502 views::ImageView::TRAILING, views::ImageView::CENTER, 502 views::ImageView::TRAILING, views::ImageView::CENTER,
503 views::ImageView::CENTER)); 503 views::ImageView::CENTER));
504 bar_->SchedulePaint(); 504 bar_->SchedulePaint();
505 } 505 }
506 506
507 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL); 507 bar_->SetVisible(bar_id != 0 && state_ != STATE_NORMAL);
508 } 508 }
509 509
510 } // namespace ash 510 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.cc ('k') | ash/shell/lock_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698