diff options
author | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 21:29:22 +0000 |
---|---|---|
committer | brettw@chromium.org <brettw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-05-22 21:29:22 +0000 |
commit | a984b917749505c9bb86cab6ad7a3cf36d37d4dd (patch) | |
tree | 5303775b7d763865cba3fc05fb16fd7220872cfc /chrome | |
parent | d7509b924091be8c5130bad343055dfe39c306d3 (diff) | |
download | chromium_src-a984b917749505c9bb86cab6ad7a3cf36d37d4dd.zip chromium_src-a984b917749505c9bb86cab6ad7a3cf36d37d4dd.tar.gz chromium_src-a984b917749505c9bb86cab6ad7a3cf36d37d4dd.tar.bz2 |
Move more dialog showing routines to browser_dialogs.h to reduce dependencies
and make this file easier to port.
Review URL: http://codereview.chromium.org/113778
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@16798 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome')
-rw-r--r-- | chrome/browser/views/bookmark_manager_view.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/browser_dialogs.h | 16 | ||||
-rw-r--r-- | chrome/browser/views/find_bar_win.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/frame/browser_view.cc | 19 | ||||
-rw-r--r-- | chrome/browser/views/keyword_editor_view.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/new_profile_dialog.cc | 9 | ||||
-rw-r--r-- | chrome/browser/views/options/passwords_exceptions_window_view.cc | 9 |
7 files changed, 68 insertions, 12 deletions
diff --git a/chrome/browser/views/bookmark_manager_view.cc b/chrome/browser/views/bookmark_manager_view.cc index a66c105..eb0e3d3 100644 --- a/chrome/browser/views/bookmark_manager_view.cc +++ b/chrome/browser/views/bookmark_manager_view.cc @@ -133,6 +133,15 @@ BookmarkManagerView::CutCopyPasteType KeyCodeToCutCopyPaste( } // namespace +namespace browser { + +// Declared in browser_dialogs.h so others don't need to depend on our header. +void ShowBookmarkManagerView(Profile* profile) { + BookmarkManagerView::Show(profile); +} + +} // namespace browser + BookmarkManagerView::BookmarkManagerView(Profile* profile) : profile_(profile->GetOriginalProfile()), table_view_(NULL), diff --git a/chrome/browser/views/browser_dialogs.h b/chrome/browser/views/browser_dialogs.h index 7884719..dd02f80 100644 --- a/chrome/browser/views/browser_dialogs.h +++ b/chrome/browser/views/browser_dialogs.h @@ -56,6 +56,9 @@ void ShowBookmarkBubbleView(views::Window* parent, void HideBookmarkBubbleView(); bool IsBookmarkBubbleViewShowing(); +// Shows the bookmark manager. +void ShowBookmarkManagerView(Profile* profile); + // Shows the about dialog. See AboutChromeView. void ShowAboutChromeView(views::Widget* parent, Profile* profile); @@ -64,6 +67,19 @@ void ShowAboutChromeView(views::Widget* parent, void ShowHtmlDialogView(gfx::NativeWindow parent, Browser* browser, HtmlDialogUIDelegate* delegate); +// Creates and returns a find bar for the given browser window. See FindBarWin. +FindBar* CreateFindBar(BrowserView* browser_view); + +// Shows the "Save passwords and exceptions" dialog. +// See PasswordsExceptionsWindowView. +void ShowPasswordsExceptionsWindowView(Profile* profile); + +// Shows the keyword editor. See KeywordEditorView. +void ShowKeywordEditorView(Profile* profile); + +// Shows the "new profile" dialog box. See NewProfileDialog. +void ShowNewProfileDialog(); + } // namespace browser #endif // CHROME_BROWSER_VIEWS_BROWSER_DIALOGS_H_ diff --git a/chrome/browser/views/find_bar_win.cc b/chrome/browser/views/find_bar_win.cc index 5c2af1a..9cf82e1 100644 --- a/chrome/browser/views/find_bar_win.cc +++ b/chrome/browser/views/find_bar_win.cc @@ -26,6 +26,15 @@ static const int kMinFindWndDistanceFromSelection = 5; // static bool FindBarWin::disable_animations_during_testing_ = false; +namespace browser { + +// Declared in browser_dialogs.h so others don't have to depend on our header. +FindBar* CreateFindBar(BrowserView* browser_view) { + return new FindBarWin(browser_view); +} + +} // namespace browser + //////////////////////////////////////////////////////////////////////////////// // FindBarWin, public: diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 4bf8e1d..5dce7a2 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -19,23 +19,18 @@ #include "chrome/browser/download/download_manager.h" #include "chrome/browser/encoding_menu_controller_delegate.h" #include "chrome/browser/extensions/extension_shelf.h" +#include "chrome/browser/find_bar.h" #include "chrome/browser/find_bar_controller.h" #include "chrome/browser/view_ids.h" #include "chrome/browser/views/about_chrome_view.h" #include "chrome/browser/views/bookmark_bar_view.h" -#include "chrome/browser/views/bookmark_manager_view.h" #include "chrome/browser/views/browser_bubble.h" #include "chrome/browser/views/browser_dialogs.h" -#include "chrome/browser/views/bug_report_view.h" #include "chrome/browser/views/chrome_views_delegate.h" #include "chrome/browser/views/download_shelf_view.h" -#include "chrome/browser/views/find_bar_win.h" #include "chrome/browser/views/frame/browser_frame.h" #include "chrome/browser/views/fullscreen_exit_bubble.h" #include "chrome/browser/views/infobars/infobar_container.h" -#include "chrome/browser/views/keyword_editor_view.h" -#include "chrome/browser/views/new_profile_dialog.h" -#include "chrome/browser/views/options/passwords_exceptions_window_view.h" #include "chrome/browser/views/status_bubble_views.h" #include "chrome/browser/views/tab_contents_container_view.h" #include "chrome/browser/views/tabs/tab_strip.h" @@ -793,7 +788,7 @@ void BrowserView::ShowAboutChromeDialog() { } void BrowserView::ShowBookmarkManager() { - BookmarkManagerView::Show(browser_->profile()); + browser::ShowBookmarkManagerView(browser_->profile()); } void BrowserView::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) { @@ -817,19 +812,19 @@ void BrowserView::ShowImportDialog() { } void BrowserView::ShowSearchEnginesDialog() { - KeywordEditorView::Show(browser_->profile()); + browser::ShowKeywordEditorView(browser_->profile()); } void BrowserView::ShowPasswordManager() { - PasswordsExceptionsWindowView::Show(browser_->profile()); + browser::ShowPasswordsExceptionsWindowView(browser_->profile()); } void BrowserView::ShowSelectProfileDialog() { - ShowSelectProfileDialog(); + browser::ShowSelectProfileDialog(); } void BrowserView::ShowNewProfileDialog() { - NewProfileDialog::RunDialog(); + browser::ShowNewProfileDialog(); } void BrowserView::ConfirmBrowserCloseWithPendingDownloads() { @@ -1683,7 +1678,7 @@ BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { // static FindBar* BrowserWindow::CreateFindBar(Browser* browser) { - return new FindBarWin(static_cast<BrowserView*>(browser->window())); + return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); } // static diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index cf5a3d8..d84afa0 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -42,6 +42,15 @@ using views::TableColumn; static const int kMainGroupID = 0; static const int kOtherGroupID = 1; +namespace browser { + +// Declared in browser_dialogs.h so others don't have to depend on our header. +void ShowKeywordEditorView(Profile* profile) { + KeywordEditorView::Show(profile); +} + +} // namespace browser + // ModelEntry ---------------------------------------------------- // ModelEntry wraps a TemplateURL as returned from the TemplateURL. diff --git a/chrome/browser/views/new_profile_dialog.cc b/chrome/browser/views/new_profile_dialog.cc index 9b3b5fa..8b851f4 100644 --- a/chrome/browser/views/new_profile_dialog.cc +++ b/chrome/browser/views/new_profile_dialog.cc @@ -19,6 +19,15 @@ #include "views/view.h" #include "views/window/window.h" +namespace browser { + +// Declared in browser_dialogs.h so others don't have to depend on our header. +void ShowNewProfileDialog() { + NewProfileDialog::RunDialog(); +} + +} // namespace browser + // static void NewProfileDialog::RunDialog() { NewProfileDialog* dlg = new NewProfileDialog(); diff --git a/chrome/browser/views/options/passwords_exceptions_window_view.cc b/chrome/browser/views/options/passwords_exceptions_window_view.cc index 587548a..8dfd250 100644 --- a/chrome/browser/views/options/passwords_exceptions_window_view.cc +++ b/chrome/browser/views/options/passwords_exceptions_window_view.cc @@ -16,6 +16,15 @@ static const int kDefaultWindowWidth = 530; static const int kDefaultWindowHeight = 240; static const int kDialogPadding = 7; +namespace browser { + +// Declared in browser_dialogs.h so others don't have to depend on our header. +void ShowPasswordsExceptionsWindowView(Profile* profile) { + PasswordsExceptionsWindowView::Show(profile); +} + +} // namespace browser + /////////////////////////////////////////////////////////////////////////////// // PasswordsExceptionsWindowView, public |