diff options
-rw-r--r-- | chrome/browser/download/download_util.cc | 6 | ||||
-rw-r--r-- | chrome/browser/ui/browser.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/browser_list.h | 2 |
3 files changed, 9 insertions, 1 deletions
diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index f00db36..fb69263 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -637,7 +637,11 @@ void UpdateAppIconDownloadProgress(int download_count, // Iterate through all the browser windows, and draw the progress bar. for (BrowserList::const_iterator browser_iterator = BrowserList::begin(); browser_iterator != BrowserList::end(); browser_iterator++) { - HWND frame = (*browser_iterator)->window()->GetNativeHandle(); + Browser* browser = *browser_iterator; + BrowserWindow* window = browser->window(); + if (!window) + continue; + HWND frame = window->GetNativeHandle(); if (download_count == 0 || progress == 1.0f) taskbar->SetProgressState(frame, TBPF_NOPROGRESS); else if (!progress_known) diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h index cc1686d..1c09b28 100644 --- a/chrome/browser/ui/browser.h +++ b/chrome/browser/ui/browser.h @@ -187,6 +187,8 @@ class Browser : public TabHandlerDelegate, } #endif + // |window()| will return NULL if called before |CreateBrowserWindow()| + // is done. BrowserWindow* window() const { return window_; } ToolbarModel* toolbar_model() { return &toolbar_model_; } const SessionID& session_id() const { return session_id_; } diff --git a/chrome/browser/ui/browser_list.h b/chrome/browser/ui/browser_list.h index 4ad4e7b..2099af1 100644 --- a/chrome/browser/ui/browser_list.h +++ b/chrome/browser/ui/browser_list.h @@ -130,6 +130,8 @@ class BrowserList { // closes. static bool WillKeepAlive(); + // Browsers are added to |browsers_| before they have constructed windows, + // so the |window()| member function may return NULL. static const_iterator begin() { return browsers_.begin(); } static const_iterator end() { return browsers_.end(); } |