1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "ui/gfx/animation/animation_delegate.h"
10 #include "ui/gfx/animation/slide_animation.h"
11 #include "ui/views/painter.h"
12 #include "ui/views/view.h"
14 class LocationBarView;
29 // The AddToAppLauncherView displays a UI in the location bar to allow adding
30 // the current page to the App Launcher.
31 class AddToAppLauncherView : public gfx::AnimationDelegate, public views::View {
33 AddToAppLauncherView(LocationBarView* parent,
34 const gfx::FontList& font_list,
36 SkColor parent_background_color);
37 virtual ~AddToAppLauncherView();
39 // Updates the decoration from the shown WebContents.
40 void Update(content::WebContents* web_contents);
43 // gfx::AnimationDelegate:
44 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE;
45 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE;
46 virtual void AnimationCanceled(const gfx::Animation* animation) OVERRIDE;
49 virtual gfx::Size GetPreferredSize() const OVERRIDE;
50 virtual void Layout() OVERRIDE;
51 virtual void OnPaintBackground(gfx::Canvas* canvas) OVERRIDE;
53 LocationBarView* parent_; // Weak, owns us.
54 scoped_ptr<views::Painter> background_painter_;
55 views::ImageView* icon_;
56 views::Label* text_label_;
57 gfx::SlideAnimation slide_animator_;
59 DISALLOW_COPY_AND_ASSIGN(AddToAppLauncherView);
62 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_ADD_TO_APP_LAUNCHER_VIEW_H_