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/options/options_window_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/options/options_window_view.cc')
-rw-r--r-- | chrome/browser/views/options/options_window_view.cc | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index 72c7029..5b29fdb 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -60,11 +60,6 @@ class OptionsWindowView : public ChromeViews::View, explicit OptionsWindowView(Profile* profile); virtual ~OptionsWindowView(); - ChromeViews::Window* container() const { return container_; } - void set_container(ChromeViews::Window* container) { - container_ = container; - } - // Shows the Tab corresponding to the specified OptionsPage. void ShowOptionsPage(OptionsPage page, OptionsGroup highlight_group); @@ -73,6 +68,7 @@ class OptionsWindowView : public ChromeViews::View, virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool Cancel(); + virtual ChromeViews::View* GetContentsView(); // ChromeViews::TabbedPane::Listener implementation: virtual void TabSelectedAt(int index); @@ -96,9 +92,6 @@ class OptionsWindowView : public ChromeViews::View, // The Tab view that contains all of the options pages. ChromeViews::TabbedPane* tabs_; - // The Options dialog window. - ChromeViews::Window* container_; - // The Profile associated with these options. Profile* profile_; @@ -135,10 +128,10 @@ void OptionsWindowView::ShowOptionsPage(OptionsPage page, OptionsGroup highlight_group) { // If the window is not yet visible, we need to show it (it will become // active), otherwise just bring it to the front. - if (!container_->IsVisible()) { - container_->Show(); + if (!window()->IsVisible()) { + window()->Show(); } else { - container_->Activate(); + window()->Activate(); } if (page == OPTIONS_PAGE_DEFAULT) { @@ -171,6 +164,10 @@ bool OptionsWindowView::Cancel() { return GetCurrentOptionsPageView()->CanClose(); } +ChromeViews::View* OptionsWindowView::GetContentsView() { + return this; +} + /////////////////////////////////////////////////////////////////////////////// // OptionsWindowView, ChromeViews::TabbedPane::Listener implementation: @@ -246,8 +243,7 @@ void ShowOptionsWindow(OptionsPage page, // about this case this will have to be fixed. if (!instance_) { instance_ = new OptionsWindowView(profile); - instance_->set_container(ChromeViews::Window::CreateChromeWindow( - NULL, gfx::Rect(), instance_, instance_)); + ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); // The window is alive by itself now... } instance_->ShowOptionsPage(page, highlight_group); |