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

Side by Side Diff: ash/common/frame/caption_buttons/frame_caption_button.h

Issue 2760133002: ui: Remove a bunch of uses of gfx::Canvas::ExtractImageRep() (Closed)
Patch Set: canvasbounds: ashnit Created 3 years, 9 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 #ifndef ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_ 5 #ifndef ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_
6 #define ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_ 6 #define ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_
7 7
8 #include <memory> 8 #include <memory>
9 9
10 #include "ash/ash_export.h" 10 #include "ash/ash_export.h"
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
59 59
60 CaptionButtonIcon icon() const { return icon_; } 60 CaptionButtonIcon icon() const { return icon_; }
61 61
62 void set_size(const gfx::Size& size) { size_ = size; } 62 void set_size(const gfx::Size& size) { size_ = size; }
63 63
64 protected: 64 protected:
65 // views::CustomButton override: 65 // views::CustomButton override:
66 void OnGestureEvent(ui::GestureEvent* event) override; 66 void OnGestureEvent(ui::GestureEvent* event) override;
67 67
68 private: 68 private:
69 // Paints |to_center| centered within the button with |alpha|. 69 // Determines what alpha to use for the icon based on animation and
70 void PaintCentered(gfx::Canvas* canvas, 70 // active state.
71 const gfx::ImageSkia& to_center, 71 int GetAlphaForIcon(int base_alpha) const;
72 int alpha);
73 72
74 // The button's current icon. 73 // The button's current icon.
75 CaptionButtonIcon icon_; 74 CaptionButtonIcon icon_;
76 75
77 // The size of the button. 76 // The size of the button.
78 gfx::Size size_; 77 gfx::Size size_;
79 78
80 // Whether the button should be painted as active. 79 // Whether the button should be painted as active.
81 bool paint_as_active_; 80 bool paint_as_active_;
82 81
(...skipping 14 matching lines...) Expand all
97 // Crossfade animation started when the button's images are changed by 96 // Crossfade animation started when the button's images are changed by
98 // SetImage(). 97 // SetImage().
99 std::unique_ptr<gfx::SlideAnimation> swap_images_animation_; 98 std::unique_ptr<gfx::SlideAnimation> swap_images_animation_;
100 99
101 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButton); 100 DISALLOW_COPY_AND_ASSIGN(FrameCaptionButton);
102 }; 101 };
103 102
104 } // namespace ash 103 } // namespace ash
105 104
106 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_ 105 #endif // ASH_COMMON_FRAME_CAPTION_BUTTONS_FRAME_CAPTION_BUTTON_H_
OLDNEW
« no previous file with comments | « ash/common/accelerators/debug_commands.cc ('k') | ash/common/frame/caption_buttons/frame_caption_button.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698