diff options
author | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 18:26:36 +0000 |
---|---|---|
committer | tc@google.com <tc@google.com@0039d316-1c4b-4281-b951-d872f2087c98> | 2009-01-20 18:26:36 +0000 |
commit | 02b9cd6fa95f4797bb23dff09ac5a0a0529f2e9c (patch) | |
tree | c9d1378a22acc3363c15ae96a42722c4a3c6f382 /chrome/browser | |
parent | dfb96df122af2da6adc25320742ae44aede063de (diff) | |
download | chromium_src-02b9cd6fa95f4797bb23dff09ac5a0a0529f2e9c.zip chromium_src-02b9cd6fa95f4797bb23dff09ac5a0a0529f2e9c.tar.gz chromium_src-02b9cd6fa95f4797bb23dff09ac5a0a0529f2e9c.tar.bz2 |
Revert "revert r8217 until memory tests are fixed." This re-applies r8217.
This reverts commit r8245.
TBR=ben
Review URL: http://codereview.chromium.org/18410
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@8292 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r-- | chrome/browser/browser_list.cc | 39 | ||||
-rw-r--r-- | chrome/browser/browser_list.h | 21 | ||||
-rw-r--r-- | chrome/browser/views/frame/aero_glass_frame.h | 3 | ||||
-rw-r--r-- | chrome/browser/views/frame/opaque_frame.h | 1 |
4 files changed, 8 insertions, 56 deletions
diff --git a/chrome/browser/browser_list.cc b/chrome/browser/browser_list.cc index 69fb122..90ccb56 100644 --- a/chrome/browser/browser_list.cc +++ b/chrome/browser/browser_list.cc @@ -14,11 +14,9 @@ #include "chrome/browser/profile_manager.h" #include "chrome/browser/tab_contents/web_contents.h" #include "chrome/common/notification_service.h" -#include "chrome/views/window.h" BrowserList::list_type BrowserList::browsers_; std::vector<BrowserList::Observer*> BrowserList::observers_; -BrowserList::DependentWindowList BrowserList::dependent_windows_; // static void BrowserList::AddBrowser(Browser* browser) { @@ -60,27 +58,12 @@ void BrowserList::RemoveBrowser(Browser* browser) { // If the last Browser object was destroyed, make sure we try to close any // remaining dependent windows too. - if (browsers_.empty()) - CloseAllDependentWindows(); - - g_browser_process->ReleaseModule(); -} - -// static -void BrowserList::AddDependentWindow(views::Window* window) { - DependentWindowList::const_iterator existing = - find(dependent_windows_.begin(), dependent_windows_.end(), window); - DCHECK(existing == dependent_windows_.end()); - dependent_windows_.push_back(window); - g_browser_process->AddRefModule(); -} + if (browsers_.empty()) { + NotificationService::current()->Notify(NOTIFY_ALL_APPWINDOWS_CLOSED, + NotificationService::AllSources(), + NotificationService::NoDetails()); + } -// static -void BrowserList::RemoveDependentWindow(views::Window* window) { - DependentWindowList::iterator existing = - find(dependent_windows_.begin(), dependent_windows_.end(), window); - DCHECK(existing != dependent_windows_.end()); - dependent_windows_.erase(existing); g_browser_process->ReleaseModule(); } @@ -242,18 +225,6 @@ bool BrowserList::IsOffTheRecordSessionActive() { } // static -void BrowserList::CloseAllDependentWindows() { - // Note that |dependent_windows_| is guaranteed to be consistent for the - // duration of this operation because windows are not actually closed - // (destroyed, then deleted, and thus removed from this list) until we return - // to the message loop. So this basically just schedules a bunch of close - // operations to be performed asynchronously. - DependentWindowList::iterator window = dependent_windows_.begin(); - for (; window != dependent_windows_.end(); ++window) - (*window)->Close(); -} - -// static void BrowserList::RemoveBrowserFrom(Browser* browser, list_type* browser_list) { const iterator remove_browser = find(browser_list->begin(), browser_list->end(), browser); diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h index cda32a9..72262a9 100644 --- a/chrome/browser/browser_list.h +++ b/chrome/browser/browser_list.h @@ -10,12 +10,6 @@ #include "chrome/browser/browser.h" -namespace views { -class AppModalDialogDelegate; -class Window; -}; -class WebContents; - // Stores a list of all Browser objects. class BrowserList { public: @@ -41,13 +35,6 @@ class BrowserList { static void AddBrowser(Browser* browser); static void RemoveBrowser(Browser* browser); - // Adds and removes non-browser dependent windows. These are windows that are - // top level, but whose lifetime is associated wtih the existence of at least - // one active Browser. When the last Browser is destroyed, all open dependent - // windows are closed. - static void AddDependentWindow(views::Window* window); - static void RemoveDependentWindow(views::Window* window); - static void AddObserver(Observer* observer); static void RemoveObserver(Observer* observer); @@ -113,20 +100,12 @@ class BrowserList { static bool IsOffTheRecordSessionActive(); private: - // Closes all registered dependent windows. - static void CloseAllDependentWindows(); - // Helper method to remove a browser instance from a list of browsers static void RemoveBrowserFrom(Browser* browser, list_type* browser_list); static list_type browsers_; static std::vector<Observer*> observers_; static list_type last_active_browsers_; - typedef std::vector<views::Window*> DependentWindowList; - static DependentWindowList dependent_windows_; - - // Set to the currently showing modal dialog delegate if any, NULL otherwise. - static views::AppModalDialogDelegate* app_modal_dialog_; }; class WebContents; diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index 7daa04a..4ff6288 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -53,8 +53,9 @@ class AeroGlassFrame : public BrowserFrame, virtual LRESULT OnNCCalcSize(BOOL mode, LPARAM l_param); virtual LRESULT OnNCHitTest(const CPoint& pt); - // Overridden from views::CustomFrameWindow: + // Overridden from views::Window: virtual int GetShowState() const; + virtual bool IsAppWindow() const { return true; } private: // Updates the DWM with the frame bounds. diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index 13c20d2..e5d2f552 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -43,6 +43,7 @@ class OpaqueFrame : public BrowserFrame, // Overridden from views::CustomFrameWindow: virtual void UpdateWindowIcon(); virtual int GetShowState() const; + virtual bool IsAppWindow() const { return true; } // Overridden from views::WidgetWin: virtual bool AcceleratorPressed(views::Accelerator* accelerator); |