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..ff4d56fd893cfc1617993553b6d3d36975f6dbdc |
| --- /dev/null |
| +++ b/chrome/browser/ui/views/location_bar/add_to_app_launcher_view.h |
| @@ -0,0 +1,62 @@ |
| +// 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. |
|
Peter Kasting
2014/06/11 18:20:48
Nit: Move "in the location bar" to after "displays
benwells
2014/06/12 03:36:35
Done.
|
| +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; |
| + |
| + LocationBarView* parent_; // Weak, owns us. |
| + scoped_ptr<views::Painter> background_painter_; |
| + views::ImageView* icon_; |
| + views::Label* text_label_; |
| + gfx::SlideAnimation slide_animator_; |
| + |
| + DISALLOW_COPY_AND_ASSIGN(AddToAppLauncherView); |
| +}; |
| + |
| +#endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_ |