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

Unified Diff: ash/frame/caption_buttons/frame_caption_button_container_view.h

Issue 1505223004: Do not use assets for Ash window control button backgrounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: WIP for pkasting and estade feedback Created 5 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 side-by-side diff with in-line comments
Download patch
Index: ash/frame/caption_buttons/frame_caption_button_container_view.h
diff --git a/ash/frame/caption_buttons/frame_caption_button_container_view.h b/ash/frame/caption_buttons/frame_caption_button_container_view.h
index e5620f56d6f0e2a31955a2c596e534110e500353..e77a87ea31ef48b6d84580d4590f1e6921d1053b 100644
--- a/ash/frame/caption_buttons/frame_caption_button_container_view.h
+++ b/ash/frame/caption_buttons/frame_caption_button_container_view.h
@@ -64,13 +64,10 @@ class ASH_EXPORT FrameCaptionButtonContainerView
DISALLOW_COPY_AND_ASSIGN(TestApi);
};
- // Sets the resource ids of the images to paint the button for |icon|. The
- // FrameCaptionButtonContainerView will keep track of the images to use for
+ // Sets the resource id of the image to paint the button for |icon|. The
+ // FrameCaptionButtonContainerView will keep track of the image to use for
// |icon| even if none of the buttons currently use |icon|.
- void SetButtonImages(CaptionButtonIcon icon,
- int icon_image_id,
- int hovered_background_image_id,
- int pressed_background_image_id);
+ void SetButtonImage(CaptionButtonIcon icon, int icon_image_id);
// Sets whether the buttons should be painted as active. Does not schedule
// a repaint.
@@ -89,30 +86,21 @@ class ASH_EXPORT FrameCaptionButtonContainerView
// to reflect the change in visibility.
void UpdateSizeButtonVisibility();
+ // Sets the size of the buttons in this container.
+ void SetButtonSize(const gfx::Size& size);
+
// views::View:
gfx::Size GetPreferredSize() const override;
void Layout() override;
const char* GetClassName() const override;
- // Overridden from gfx::AnimationDelegate:
+ // gfx::AnimationDelegate:
void AnimationEnded(const gfx::Animation* animation) override;
void AnimationProgressed(const gfx::Animation* animation) override;
private:
friend class FrameCaptionButtonContainerViewTest;
- struct ButtonIconIds {
- ButtonIconIds();
- ButtonIconIds(int icon_id,
- int hovered_background_id,
- int pressed_background_id);
- ~ButtonIconIds();
-
- int icon_image_id;
- int hovered_background_image_id;
- int pressed_background_image_id;
- };
-
// Sets |button|'s icon to |icon|. If |animate| is ANIMATE_YES, the button
// will crossfade to the new icon. If |animate| is ANIMATE_NO and
// |icon| == |button|->icon(), the crossfade animation is progressed to the
@@ -148,9 +136,9 @@ class ASH_EXPORT FrameCaptionButtonContainerView
FrameCaptionButton* size_button_;
FrameCaptionButton* close_button_;
- // Mapping of the images needed to paint a button for each of the values of
+ // Mapping of the image needed to paint a button for each of the values of
// CaptionButtonIcon.
- std::map<CaptionButtonIcon, ButtonIconIds> button_icon_id_map_;
+ std::map<CaptionButtonIcon, int> button_icon_id_map_;
// Animation that affects the position of |minimize_button_| and the
// visibility of |size_button_|.

Powered by Google App Engine
This is Rietveld 408576698