| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/browser/ui/webui/active_downloads_ui.h" | 5 #include "chrome/browser/ui/webui/active_downloads_ui.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <string> | 8 #include <string> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 396 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 browser->window()->Show(); | 407 browser->window()->Show(); |
| 408 return browser; | 408 return browser; |
| 409 } | 409 } |
| 410 | 410 |
| 411 // static | 411 // static |
| 412 Browser* ActiveDownloadsUI::GetPopup() { | 412 Browser* ActiveDownloadsUI::GetPopup() { |
| 413 for (BrowserList::const_iterator it = BrowserList::begin(); | 413 for (BrowserList::const_iterator it = BrowserList::begin(); |
| 414 it != BrowserList::end(); | 414 it != BrowserList::end(); |
| 415 ++it) { | 415 ++it) { |
| 416 if ((*it)->is_type_panel() && (*it)->is_app()) { | 416 if ((*it)->is_type_panel() && (*it)->is_app()) { |
| 417 WebContents* web_contents = | 417 WebContents* web_contents = (*it)->GetSelectedWebContents(); |
| 418 (*it)->GetSelectedTabContentsWrapper()->web_contents(); | |
| 419 DCHECK(web_contents); | 418 DCHECK(web_contents); |
| 420 if (!web_contents) | 419 if (!web_contents) |
| 421 continue; | 420 continue; |
| 422 const GURL& url = web_contents->GetURL(); | 421 const GURL& url = web_contents->GetURL(); |
| 423 | 422 |
| 424 if (url.SchemeIs(chrome::kChromeUIScheme) && | 423 if (url.SchemeIs(chrome::kChromeUIScheme) && |
| 425 url.host() == chrome::kChromeUIActiveDownloadsHost) { | 424 url.host() == chrome::kChromeUIActiveDownloadsHost) { |
| 426 return (*it); | 425 return (*it); |
| 427 } | 426 } |
| 428 } | 427 } |
| 429 } | 428 } |
| 430 return NULL; | 429 return NULL; |
| 431 } | 430 } |
| 432 | 431 |
| 433 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { | 432 const ActiveDownloadsUI::DownloadList& ActiveDownloadsUI::GetDownloads() const { |
| 434 return handler_->downloads(); | 433 return handler_->downloads(); |
| 435 } | 434 } |
| OLD | NEW |