| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_commands.h" | 5 #include "chrome/browser/download/download_commands.h" |
| 6 | 6 |
| 7 #include <stdint.h> | 7 #include <stdint.h> |
| 8 | 8 |
| 9 #include "base/base64.h" | 9 #include "base/base64.h" |
| 10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
| (...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 335 GetBrowser()); | 335 GetBrowser()); |
| 336 #else | 336 #else |
| 337 // Should only be getting invoked if we are using safe browsing. | 337 // Should only be getting invoked if we are using safe browsing. |
| 338 NOTREACHED(); | 338 NOTREACHED(); |
| 339 #endif | 339 #endif |
| 340 break; | 340 break; |
| 341 } | 341 } |
| 342 case LEARN_MORE_INTERRUPTED: | 342 case LEARN_MORE_INTERRUPTED: |
| 343 GetBrowser()->OpenURL(content::OpenURLParams( | 343 GetBrowser()->OpenURL(content::OpenURLParams( |
| 344 GetLearnMoreURLForInterruptedDownload(), content::Referrer(), | 344 GetLearnMoreURLForInterruptedDownload(), content::Referrer(), |
| 345 NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, false)); | 345 WindowOpenDisposition::NEW_FOREGROUND_TAB, ui::PAGE_TRANSITION_LINK, |
| 346 false)); |
| 346 break; | 347 break; |
| 347 case PAUSE: | 348 case PAUSE: |
| 348 download_item_->Pause(); | 349 download_item_->Pause(); |
| 349 break; | 350 break; |
| 350 case RESUME: | 351 case RESUME: |
| 351 download_item_->Resume(); | 352 download_item_->Resume(); |
| 352 break; | 353 break; |
| 353 case COPY_TO_CLIPBOARD: | 354 case COPY_TO_CLIPBOARD: |
| 354 CopyFileAsImageToClipboard(); | 355 CopyFileAsImageToClipboard(); |
| 355 break; | 356 break; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 download_item_->GetReceivedBytes() > kMaxImageClipboardSize) { | 401 download_item_->GetReceivedBytes() > kMaxImageClipboardSize) { |
| 401 return; | 402 return; |
| 402 } | 403 } |
| 403 | 404 |
| 404 if (!DownloadItemModel(download_item_).HasSupportedImageMimeType()) | 405 if (!DownloadItemModel(download_item_).HasSupportedImageMimeType()) |
| 405 return; | 406 return; |
| 406 | 407 |
| 407 base::FilePath file_path = download_item_->GetFullPath(); | 408 base::FilePath file_path = download_item_->GetFullPath(); |
| 408 ImageClipboardCopyManager::Start(file_path); | 409 ImageClipboardCopyManager::Start(file_path); |
| 409 } | 410 } |
| OLD | NEW |