diff options
author | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 04:12:18 +0000 |
---|---|---|
committer | beng@google.com <beng@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-07-30 04:12:18 +0000 |
commit | 0f2f4b60511540e292e085ba5e1985be6bf93908 (patch) | |
tree | 6d6bb042fe78bb23c4eca3cf4a4222a3dab38e74 /chrome/browser/views/bookmark_editor_view.cc | |
parent | aaeb9dc745d49afa66c1b613daa5a3123f309955 (diff) | |
download | chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.zip chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.gz chromium_src-0f2f4b60511540e292e085ba5e1985be6bf93908.tar.bz2 |
Window Delegate Improvements:
- Windows now must have a Delegate. Just construct the default WindowDelegate
if
you don't want to have to write one in testing.
- Windows now obtain their contents view by asking the delegate via
WindowDelegate::GetContentsView.
- Contents views no longer need to manually store a pointer to the Window that
contains them, WindowDelegate does this automatically via its window()
accessor.
Reviewer notes:
- review window_delegate.h first, then
- window.h/cc
- custom frame window.h/cc
- constrained_window_impl.h/cc
- then everything else (just updating all call sites)
B=1280060
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@96 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/bookmark_editor_view.cc')
-rw-r--r-- | chrome/browser/views/bookmark_editor_view.cc | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index e7a834a..da5a92d 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -79,7 +79,6 @@ BookmarkEditorView::BookmarkEditorView(Profile* profile, #pragma warning(suppress: 4355) // Okay to pass "this" here. new_group_button_( l10n_util::GetString(IDS_BOOMARK_EDITOR_NEW_FOLDER_BUTTON)), - dialog_(NULL), url_(url), title_(title), running_menu_for_root_(false) { @@ -122,6 +121,10 @@ bool BookmarkEditorView::AreAcceleratorsEnabled(DialogButton button) { return !tree_view_.GetEditingNode(); } +ChromeViews::View* BookmarkEditorView::GetContentsView() { + return this; +} + void BookmarkEditorView::Layout() { // Let the grid layout manager lay out most of the dialog... GetLayoutManager()->Layout(this); @@ -205,12 +208,11 @@ bool BookmarkEditorView::IsCommandEnabled(int id) const { } void BookmarkEditorView::Show(HWND parent_hwnd) { - dialog_ = ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), - this, this); + ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this); UserInputChanged(); if (bb_model_->IsLoaded()) ExpandAndSelect(); - dialog_->Show(); + window()->Show(); // Select all the text in the name textfield. title_tf_.SelectAll(); // Give focus to the name textfield. @@ -218,8 +220,8 @@ void BookmarkEditorView::Show(HWND parent_hwnd) { } void BookmarkEditorView::Close() { - DCHECK(dialog_); - dialog_->Close(); + DCHECK(window()); + window()->Close(); } void BookmarkEditorView::ShowContextMenu(View* source, @@ -389,7 +391,7 @@ void BookmarkEditorView::UserInputChanged() { url_tf_.SetBackgroundColor(kErrorColor); else url_tf_.SetDefaultBackgroundColor(); - dialog_->UpdateDialogButtons(); + window()->UpdateDialogButtons(); } void BookmarkEditorView::NewGroup() { |