Chromium Code Reviews| Index: chrome/browser/ui/views/location_bar/add_to_app_launcher_view.h |
| diff --git a/chrome/browser/ui/views/location_bar/add_to_app_launcher_view.h b/chrome/browser/ui/views/location_bar/add_to_app_launcher_view.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..3856a352312258688d2cfdcb731ffd1305305eab |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/location_bar/add_to_app_launcher_view.h |
| @@ -0,0 +1,69 @@ |
| +// Copyright 2014 The Chromium Authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_ |
| +#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_ |
| + |
| +#include "base/memory/scoped_ptr.h" |
| +#include "ui/gfx/animation/animation_delegate.h" |
| +#include "ui/gfx/animation/slide_animation.h" |
| +#include "ui/views/painter.h" |
| +#include "ui/views/view.h" |
| + |
| +class LocationBarView; |
| + |
| +namespace content { |
| +class WebContents; |
| +} |
| + |
| +namespace gfx { |
| +class FontList; |
| +} |
| + |
| +namespace views { |
| +class ImageView; |
| +class Label; |
| +} |
| + |
| +// The AddToAppLauncherView displays a UI to allow adding the current page to |
| +// the App Launcher in the location bar. |
| +class AddToAppLauncherView : public gfx::AnimationDelegate, public views::View { |
| + public: |
| + AddToAppLauncherView(LocationBarView* parent, |
| + const gfx::FontList& font_list, |
| + SkColor text_color, |
| + SkColor parent_background_color); |
| + virtual ~AddToAppLauncherView(); |
| + |
| + // Updates the decoration from the shown WebContents. |
| + void Update(content::WebContents* web_contents); |
| + |
| + private: |
| + // gfx::AnimationDelegate: |
| + virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
| + virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
| + virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE; |
| + |
| + // views::View: |
| + virtual gfx::Size GetPreferredSize() const OVERRIDE; |
| + virtual void Layout() OVERRIDE; |
| + virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE; |
| + |
| + bool background_showing() const { |
| + return slide_animator_.is_animating() || pause_animation_; |
| + } |
| + |
| + int GetTotalSpacingWhileAnimating() const; |
|
calamity
2014/06/11 04:17:27
Looks like this can be moved into the anonymous na
benwells
2014/06/11 07:34:42
Done.
|
| + |
| + LocationBarView* parent_; // Weak, owns us. |
| + scoped_ptr<views::Painter> background_painter_; |
| + views::ImageView* icon_; |
| + views::Label* text_label_; |
| + gfx::SlideAnimation slide_animator_; |
| + bool pause_animation_; |
|
calamity
2014/06/11 04:17:27
Unused.
benwells
2014/06/11 07:34:42
Done.
|
| + |
| + DISALLOW_COPY_AND_ASSIGN(AddToAppLauncherView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_ |