| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 // Download utility implementation | 5 // Download utility implementation |
| 6 | 6 |
| 7 #include "chrome/browser/download/download_util.h" | 7 #include "chrome/browser/download/download_util.h" |
| 8 | 8 |
| 9 #if defined(OS_WIN) | 9 #if defined(OS_WIN) |
| 10 #include <shobjidl.h> | 10 #include <shobjidl.h> |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 #include "views/widget/widget_gtk.h" | 65 #include "views/widget/widget_gtk.h" |
| 66 #elif defined(TOOLKIT_GTK) | 66 #elif defined(TOOLKIT_GTK) |
| 67 #include "chrome/browser/gtk/custom_drag.h" | 67 #include "chrome/browser/gtk/custom_drag.h" |
| 68 #endif // defined(TOOLKIT_GTK) | 68 #endif // defined(TOOLKIT_GTK) |
| 69 #endif // defined(TOOLKIT_USES_GTK) | 69 #endif // defined(TOOLKIT_USES_GTK) |
| 70 | 70 |
| 71 #if defined(OS_WIN) | 71 #if defined(OS_WIN) |
| 72 #include "app/os_exchange_data_provider_win.h" | 72 #include "app/os_exchange_data_provider_win.h" |
| 73 #include "app/win_util.h" | 73 #include "app/win_util.h" |
| 74 #include "base/base_drag_source.h" | 74 #include "base/base_drag_source.h" |
| 75 #include "base/registry.h" | 75 #include "base/win/scoped_comptr.h" |
| 76 #include "base/scoped_comptr_win.h" | |
| 77 #include "base/win_util.h" | 76 #include "base/win_util.h" |
| 78 #include "chrome/browser/browser_list.h" | 77 #include "chrome/browser/browser_list.h" |
| 79 #include "chrome/browser/views/frame/browser_view.h" | 78 #include "chrome/browser/views/frame/browser_view.h" |
| 80 #endif | 79 #endif |
| 81 | 80 |
| 82 namespace download_util { | 81 namespace download_util { |
| 83 | 82 |
| 84 // How many times to cycle the complete animation. This should be an odd number | 83 // How many times to cycle the complete animation. This should be an odd number |
| 85 // so that the animation ends faded out. | 84 // so that the animation ends faded out. |
| 86 static const int kCompleteAnimationCycles = 5; | 85 static const int kCompleteAnimationCycles = 5; |
| (...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 595 | 594 |
| 596 #if !defined(OS_MACOSX) | 595 #if !defined(OS_MACOSX) |
| 597 void UpdateAppIconDownloadProgress(int download_count, | 596 void UpdateAppIconDownloadProgress(int download_count, |
| 598 bool progress_known, | 597 bool progress_known, |
| 599 float progress) { | 598 float progress) { |
| 600 #if defined(OS_WIN) | 599 #if defined(OS_WIN) |
| 601 // Taskbar progress bar is only supported on Win7. | 600 // Taskbar progress bar is only supported on Win7. |
| 602 if (base::win::GetVersion() < base::win::VERSION_WIN7) | 601 if (base::win::GetVersion() < base::win::VERSION_WIN7) |
| 603 return; | 602 return; |
| 604 | 603 |
| 605 ScopedComPtr<ITaskbarList3> taskbar; | 604 base::win::ScopedComPtr<ITaskbarList3> taskbar; |
| 606 HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL, | 605 HRESULT result = taskbar.CreateInstance(CLSID_TaskbarList, NULL, |
| 607 CLSCTX_INPROC_SERVER); | 606 CLSCTX_INPROC_SERVER); |
| 608 if (FAILED(result)) { | 607 if (FAILED(result)) { |
| 609 LOG(INFO) << "failed creating a TaskbarList object: " << result; | 608 LOG(INFO) << "failed creating a TaskbarList object: " << result; |
| 610 return; | 609 return; |
| 611 } | 610 } |
| 612 | 611 |
| 613 result = taskbar->HrInit(); | 612 result = taskbar->HrInit(); |
| 614 if (FAILED(result)) { | 613 if (FAILED(result)) { |
| 615 LOG(ERROR) << "failed initializing an ITaskbarList3 interface."; | 614 LOG(ERROR) << "failed initializing an ITaskbarList3 interface."; |
| (...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 ExtensionsService* service = profile->GetExtensionsService(); | 725 ExtensionsService* service = profile->GetExtensionsService(); |
| 727 if (!service || | 726 if (!service || |
| 728 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { | 727 !service->IsDownloadFromGallery(info->url, info->referrer_url)) { |
| 729 return true; | 728 return true; |
| 730 } | 729 } |
| 731 } | 730 } |
| 732 return false; | 731 return false; |
| 733 } | 732 } |
| 734 | 733 |
| 735 } // namespace download_util | 734 } // namespace download_util |
| OLD | NEW |