- add sources.
[platform/framework/web/crosswalk.git] / src / chrome / browser / ui / views / bookmarks / bookmark_prompt_view.h
1 // Copyright (c) 2012 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.
4
5 #ifndef CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_PROMPT_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_PROMPT_VIEW_H_
7
8 #include "base/basictypes.h"
9 #include "ui/views/bubble/bubble_delegate.h"
10 #include "ui/views/controls/link_listener.h"
11
12 class PrefService;
13
14 // BookmarkPromptView is a view intended to be used as the content of an
15 // Bubble. BookmarkPromptView provides views for prompting user for action box
16 // or star icon. Don't create a BookmarkPromptView directly, instead use
17 // the static ShowPrompt() method.
18 class BookmarkPromptView : public views::BubbleDelegateView,
19                            public views::LinkListener {
20  public:
21   // Show the prompt bubble.
22   static void ShowPrompt(views::View* anchor_view, PrefService* prefs);
23
24  private:
25   // Creates a BookmarkPromptView.
26   BookmarkPromptView(views::View* anchor_view, PrefService* prefs);
27
28   virtual ~BookmarkPromptView();
29
30   // views::BubbleDelegateView method.
31   virtual void Init() OVERRIDE;
32
33   // views::LinkListener method.
34   virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
35
36   // views::WidgetDelegate method.
37   virtual void WindowClosing() OVERRIDE;
38
39   // The bookmark bubble, if we're showing one.
40   static BookmarkPromptView* bookmark_bubble_;
41
42   // Link for dismissing the prompt.
43   views::Link* dismiss_link_;
44
45   // The pref service to use disabling bookmark prompt feature.
46   PrefService* prefs_;
47
48   DISALLOW_COPY_AND_ASSIGN(BookmarkPromptView);
49 };
50
51 #endif  // CHROME_BROWSER_UI_VIEWS_BOOKMARKS_BOOKMARK_PROMPT_VIEW_H_