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

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

Issue 2051663005: Vectorize the remaining material design shelf icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: nit addressed Created 4 years, 6 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/overflow_button.h" 5 #include "ash/shelf/overflow_button.h"
6 6
7 #include "ash/ash_constants.h"
7 #include "ash/ash_switches.h" 8 #include "ash/ash_switches.h"
8 #include "ash/common/material_design/material_design_controller.h" 9 #include "ash/common/material_design/material_design_controller.h"
9 #include "ash/common/shelf/shelf_constants.h" 10 #include "ash/common/shelf/shelf_constants.h"
10 #include "ash/shelf/shelf.h" 11 #include "ash/shelf/shelf.h"
11 #include "ash/shelf/shelf_layout_manager.h" 12 #include "ash/shelf/shelf_layout_manager.h"
12 #include "ash/shelf/shelf_widget.h" 13 #include "ash/shelf/shelf_widget.h"
13 #include "grit/ash_resources.h" 14 #include "grit/ash_resources.h"
14 #include "grit/ash_strings.h" 15 #include "grit/ash_strings.h"
15 #include "third_party/skia/include/core/SkPaint.h" 16 #include "third_party/skia/include/core/SkPaint.h"
16 #include "third_party/skia/include/core/SkPath.h" 17 #include "third_party/skia/include/core/SkPath.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
18 #include "ui/base/resource/resource_bundle.h" 19 #include "ui/base/resource/resource_bundle.h"
19 #include "ui/gfx/animation/throb_animation.h" 20 #include "ui/gfx/animation/throb_animation.h"
20 #include "ui/gfx/canvas.h" 21 #include "ui/gfx/canvas.h"
21 #include "ui/gfx/image/image_skia_operations.h" 22 #include "ui/gfx/image/image_skia_operations.h"
23 #include "ui/gfx/paint_vector_icon.h"
22 #include "ui/gfx/skbitmap_operations.h" 24 #include "ui/gfx/skbitmap_operations.h"
23 #include "ui/gfx/skia_util.h" 25 #include "ui/gfx/skia_util.h"
24 #include "ui/gfx/transform.h" 26 #include "ui/gfx/transform.h"
27 #include "ui/gfx/vector_icons_public.h"
25 #include "ui/views/widget/widget.h" 28 #include "ui/views/widget/widget.h"
26 29
27 namespace ash { 30 namespace ash {
28 31
29 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf) 32 OverflowButton::OverflowButton(views::ButtonListener* listener, Shelf* shelf)
30 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) { 33 : CustomButton(listener), bottom_image_(nullptr), shelf_(shelf) {
31 ui::ResourceBundle* rb = &ui::ResourceBundle::GetSharedInstance(); 34 if (MaterialDesignController::IsShelfMaterial()) {
32 bottom_image_ = rb->GetImageNamed(IDR_ASH_SHELF_OVERFLOW).ToImageSkia(); 35 bottom_image_md_ =
36 CreateVectorIcon(gfx::VectorIconId::SHELF_OVERFLOW, kShelfIconColor);
37 bottom_image_ = &bottom_image_md_;
38 } else {
39 bottom_image_ = ui::ResourceBundle::GetSharedInstance().GetImageSkiaNamed(
40 IDR_ASH_SHELF_OVERFLOW);
41 }
33 42
34 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); 43 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY);
35 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME)); 44 SetAccessibleName(l10n_util::GetStringUTF16(IDS_ASH_SHELF_OVERFLOW_NAME));
36 } 45 }
37 46
38 OverflowButton::~OverflowButton() {} 47 OverflowButton::~OverflowButton() {}
39 48
40 void OverflowButton::OnShelfAlignmentChanged() { 49 void OverflowButton::OnShelfAlignmentChanged() {
41 SchedulePaint(); 50 SchedulePaint();
42 } 51 }
(...skipping 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 bounds.x() + (bounds.width() - background->width()) / 2, 147 bounds.x() + (bounds.width() - background->width()) / 2,
139 bounds.y() + ShelfLayoutManager::kShelfItemInset, 148 bounds.y() + ShelfLayoutManager::kShelfItemInset,
140 background->width(), background->height()); 149 background->width(), background->height());
141 } 150 }
142 } 151 }
143 152
144 return bounds; 153 return bounds;
145 } 154 }
146 155
147 } // namespace ash 156 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shelf/overflow_button.h ('k') | ash/system/chromeos/virtual_keyboard/virtual_keyboard_tray.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698