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

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

Issue 9316004: Move common file path related methods between chrome & content to file_util. I reduced the 4 meth... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 575 matching lines...) Expand 10 before | Expand all | Expand 10 after
586 taskbar->SetProgressValue(frame, static_cast<int>(progress * 100), 100); 586 taskbar->SetProgressValue(frame, static_cast<int>(progress * 100), 100);
587 } 587 }
588 #elif defined(TOOLKIT_GTK) 588 #elif defined(TOOLKIT_GTK)
589 unity::SetDownloadCount(download_count); 589 unity::SetDownloadCount(download_count);
590 unity::SetProgressFraction(progress); 590 unity::SetProgressFraction(progress);
591 #endif 591 #endif
592 } 592 }
593 #endif 593 #endif
594 594
595 int GetUniquePathNumberWithCrDownload(const FilePath& path) { 595 int GetUniquePathNumberWithCrDownload(const FilePath& path) {
596 return DownloadFile::GetUniquePathNumberWithSuffix( 596 return file_util::GetUniquePathNumber(
597 path, FILE_PATH_LITERAL(".crdownload")); 597 path, FILE_PATH_LITERAL(".crdownload"));
598 } 598 }
599 599
600 FilePath GetCrDownloadPath(const FilePath& suggested_path) { 600 FilePath GetCrDownloadPath(const FilePath& suggested_path) {
601 return DownloadFile::AppendSuffixToPath( 601 return file_util::AppendSuffixToPath(
602 suggested_path, FILE_PATH_LITERAL(".crdownload")); 602 suggested_path, FILE_PATH_LITERAL(".crdownload"));
603 } 603 }
604 604
605 bool IsSavableURL(const GURL& url) { 605 bool IsSavableURL(const GURL& url) {
606 for (int i = 0; chrome::GetSavableSchemes()[i] != NULL; ++i) { 606 for (int i = 0; chrome::GetSavableSchemes()[i] != NULL; ++i) {
607 if (url.SchemeIs(chrome::GetSavableSchemes()[i])) { 607 if (url.SchemeIs(chrome::GetSavableSchemes()[i])) {
608 return true; 608 return true;
609 } 609 }
610 } 610 }
611 return false; 611 return false;
(...skipping 17 matching lines...) Expand all
629 kMaxShelfSize); 629 kMaxShelfSize);
630 } 630 }
631 } 631 }
632 632
633 void RecordDownloadCount(ChromeDownloadCountTypes type) { 633 void RecordDownloadCount(ChromeDownloadCountTypes type) {
634 UMA_HISTOGRAM_ENUMERATION( 634 UMA_HISTOGRAM_ENUMERATION(
635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY); 635 "Download.CountsChrome", type, DOWNLOAD_COUNT_TYPES_LAST_ENTRY);
636 } 636 }
637 637
638 } // namespace download_util 638 } // namespace download_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698