Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(290)

Side by Side Diff: chrome/browser/download/download_commands.cc

Issue 1662783002: Remove HostDesktopType from Browser::CreateParams (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-12
Patch Set: remove desktop_type_ in bookmark_bubble_sign_in_delegate Created 4 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 301 matching lines...) Expand 10 before | Expand all | Expand 10 after
312 break; 312 break;
313 case COPY_TO_CLIPBOARD: 313 case COPY_TO_CLIPBOARD:
314 CopyFileAsImageToClipboard(); 314 CopyFileAsImageToClipboard();
315 break; 315 break;
316 } 316 }
317 } 317 }
318 318
319 Browser* DownloadCommands::GetBrowser() const { 319 Browser* DownloadCommands::GetBrowser() const {
320 Profile* profile = 320 Profile* profile =
321 Profile::FromBrowserContext(download_item_->GetBrowserContext()); 321 Profile::FromBrowserContext(download_item_->GetBrowserContext());
322 chrome::ScopedTabbedBrowserDisplayer browser_displayer( 322 chrome::ScopedTabbedBrowserDisplayer browser_displayer(profile);
323 profile, chrome::GetActiveDesktop());
324 DCHECK(browser_displayer.browser()); 323 DCHECK(browser_displayer.browser());
325 return browser_displayer.browser(); 324 return browser_displayer.browser();
326 } 325 }
327 326
328 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX) 327 #if defined(OS_WIN) || defined(OS_MACOSX) || defined(OS_LINUX)
329 bool DownloadCommands::IsDownloadPdf() const { 328 bool DownloadCommands::IsDownloadPdf() const {
330 base::FilePath path = download_item_->GetTargetFilePath(); 329 base::FilePath path = download_item_->GetTargetFilePath();
331 return path.MatchesExtension(FILE_PATH_LITERAL(".pdf")); 330 return path.MatchesExtension(FILE_PATH_LITERAL(".pdf"));
332 } 331 }
333 #endif 332 #endif
(...skipping 30 matching lines...) Expand all
364 &mime) || 363 &mime) ||
365 !mime_util::IsSupportedImageMimeType(mime)) { 364 !mime_util::IsSupportedImageMimeType(mime)) {
366 // It seems a non-image file. 365 // It seems a non-image file.
367 return; 366 return;
368 } 367 }
369 } 368 }
370 369
371 base::FilePath file_path = download_item_->GetFullPath(); 370 base::FilePath file_path = download_item_->GetFullPath();
372 ImageClipboardCopyManager::Start(file_path); 371 ImageClipboardCopyManager::Start(file_path);
373 } 372 }
OLDNEW
« no previous file with comments | « chrome/browser/download/chrome_download_manager_delegate.cc ('k') | chrome/browser/download/download_crx_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698