| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/download/download_ui_controller.h" | 5 #include "chrome/browser/download/download_ui_controller.h" |
| 6 | 6 |
| 7 #include "base/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/stl_util.h" | 8 #include "base/stl_util.h" |
| 9 #include "chrome/browser/download/download_item_model.h" | 9 #include "chrome/browser/download/download_item_model.h" |
| 10 #include "chrome/browser/download/download_shelf.h" | 10 #include "chrome/browser/download/download_shelf.h" |
| 11 #include "chrome/browser/ui/browser_finder.h" | 11 #include "chrome/browser/ui/browser_finder.h" |
| 12 #include "chrome/browser/ui/browser_tabstrip.h" | 12 #include "chrome/browser/ui/browser_tabstrip.h" |
| 13 #include "chrome/browser/ui/browser_window.h" | 13 #include "chrome/browser/ui/browser_window.h" |
| 14 #include "chrome/browser/ui/host_desktop.h" |
| 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 15 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 15 #include "content/public/browser/download_item.h" | 16 #include "content/public/browser/download_item.h" |
| 16 #include "content/public/browser/web_contents.h" | 17 #include "content/public/browser/web_contents.h" |
| 17 #include "content/public/browser/web_contents_delegate.h" | 18 #include "content/public/browser/web_contents_delegate.h" |
| 18 | 19 |
| 19 #if defined(OS_ANDROID) | 20 #if defined(OS_ANDROID) |
| 20 #include "content/public/browser/android/download_controller_android.h" | 21 #include "content/public/browser/android/download_controller_android.h" |
| 21 #else | 22 #else |
| 22 #include "chrome/browser/download/notification/download_notification_manager.h" | 23 #include "chrome/browser/download/notification/download_notification_manager.h" |
| 23 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
| 24 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
| 25 #include "chrome/browser/ui/host_desktop.h" | 26 #include "ui/gfx/host_desktop_type.h" |
| 26 #endif | 27 #endif |
| 27 | 28 |
| 28 namespace { | 29 namespace { |
| 29 | 30 |
| 30 // DownloadShelfUIControllerDelegate{Android,} is used when a | 31 // DownloadShelfUIControllerDelegate{Android,} is used when a |
| 31 // DownloadUIController is | 32 // DownloadUIController is |
| 32 // constructed without specifying an explicit Delegate. | 33 // constructed without specifying an explicit Delegate. |
| 33 #if defined(OS_ANDROID) | 34 #if defined(OS_ANDROID) |
| 34 | 35 |
| 35 class AndroidUIControllerDelegate : public DownloadUIController::Delegate { | 36 class AndroidUIControllerDelegate : public DownloadUIController::Delegate { |
| (...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 161 browser->tab_strip_model()->GetIndexOfWebContents(web_contents) != | 162 browser->tab_strip_model()->GetIndexOfWebContents(web_contents) != |
| 162 TabStripModel::kNoTab && | 163 TabStripModel::kNoTab && |
| 163 !item->IsSavePackageDownload()) { | 164 !item->IsSavePackageDownload()) { |
| 164 web_contents->Close(); | 165 web_contents->Close(); |
| 165 } | 166 } |
| 166 } | 167 } |
| 167 #endif | 168 #endif |
| 168 | 169 |
| 169 delegate_->OnNewDownloadReady(item); | 170 delegate_->OnNewDownloadReady(item); |
| 170 } | 171 } |
| OLD | NEW |