browser_dialogs.h revision ca12bfac764ba476d6cd062bf1dde12cc64c3f40
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_BROWSER_DIALOGS_H_
6#define CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_
7
8#include "base/memory/scoped_ptr.h"
9#include "ui/gfx/native_widget_types.h"
10
11// This file contains functions for running a variety of browser dialogs and
12// popups. The dialogs here are the ones that the caller does not need to
13// access the class of the popup. It allows us to break dependencies by
14// allowing the callers to not depend on the classes implementing the dialogs.
15// TODO: Make as many of these methods as possible cross platform, and move them
16// into chrome/browser/ui/browser_dialogs.h.
17
18class BookmarkBubbleDelegate;
19class BookmarkBubbleViewObserver;
20class Browser;
21class BrowserView;
22class EditSearchEngineControllerDelegate;
23class FindBar;
24class GURL;
25class Profile;
26class TemplateURL;
27
28namespace extensions {
29class Extension;
30}
31
32namespace views {
33class View;
34}
35
36namespace chrome {
37
38// Shows or hides the bookmark bubble anchored to the supplied view.
39void ShowBookmarkBubbleView(views::View* anchor_view,
40                            BookmarkBubbleViewObserver* observer,
41                            scoped_ptr<BookmarkBubbleDelegate> delegate,
42                            Profile* profile,
43                            const GURL& url,
44                            bool newly_bookmarked);
45void HideBookmarkBubbleView();
46bool IsBookmarkBubbleViewShowing();
47
48// Creates and returns a find bar for the given browser window. See FindBarWin.
49FindBar* CreateFindBar(BrowserView* browser_view);
50
51// Shows a dialog box that allows a search engine to be edited. |template_url|
52// is the search engine being edited. If it is NULL, then the dialog will add a
53// new search engine with the data the user supplies. |delegate| is an object
54// to be notified when the user is done editing, or NULL. If NULL, the dialog
55// will update the model with the user's edits directly.
56void EditSearchEngine(gfx::NativeWindow parent,
57                      TemplateURL* template_url,
58                      EditSearchEngineControllerDelegate* delegate,
59                      Profile* profile);
60
61// Shows the create chrome app shortcut dialog box.
62void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow parent_window,
63                                        Profile* profile,
64                                        const extensions::Extension* app);
65
66}  // namespace chrome
67
68#endif  // CHROME_BROWSER_UI_VIEWS_BROWSER_DIALOGS_H_
69