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

Side by Side Diff: chrome/browser/android/download/chrome_download_manager_overwrite_infobar_delegate.cc

Issue 1095243002: [chrome/browser/android] favor DCHECK_CURRENTLY_ON for better logs (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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/android/download/chrome_download_manager_overwrite_info bar_delegate.h" 5 #include "chrome/browser/android/download/chrome_download_manager_overwrite_info bar_delegate.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/files/file_util.h" 9 #include "base/files/file_util.h"
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after
66 return suggested_download_path_.DirName().value(); 66 return suggested_download_path_.DirName().value();
67 } 67 }
68 68
69 void ChromeDownloadManagerOverwriteInfoBarDelegate::InfoBarDismissed() { 69 void ChromeDownloadManagerOverwriteInfoBarDelegate::InfoBarDismissed() {
70 file_selected_callback_.Run(base::FilePath()); 70 file_selected_callback_.Run(base::FilePath());
71 } 71 }
72 72
73 void ChromeDownloadManagerOverwriteInfoBarDelegate::CreateNewFileInternal( 73 void ChromeDownloadManagerOverwriteInfoBarDelegate::CreateNewFileInternal(
74 const base::FilePath& suggested_download_path, 74 const base::FilePath& suggested_download_path,
75 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) { 75 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback) {
76 DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE)); 76 DCHECK_CURRENTLY_ON(content::BrowserThread::FILE);
77 int uniquifier = base::GetUniquePathNumber(suggested_download_path, 77 int uniquifier = base::GetUniquePathNumber(suggested_download_path,
78 base::FilePath::StringType()); 78 base::FilePath::StringType());
79 base::FilePath new_path = suggested_download_path; 79 base::FilePath new_path = suggested_download_path;
80 if (uniquifier > 0) { 80 if (uniquifier > 0) {
81 new_path = suggested_download_path.InsertBeforeExtensionASCII( 81 new_path = suggested_download_path.InsertBeforeExtensionASCII(
82 base::StringPrintf(" (%d)", uniquifier)); 82 base::StringPrintf(" (%d)", uniquifier));
83 } 83 }
84 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE, 84 content::BrowserThread::PostTask(content::BrowserThread::UI, FROM_HERE,
85 base::Bind(callback, new_path)); 85 base::Bind(callback, new_path));
86 } 86 }
87 87
88 } // namespace android 88 } // namespace android
89 } // namespace chrome 89 } // namespace chrome
OLDNEW
« no previous file with comments | « chrome/browser/android/cookies/cookies_fetcher.cc ('k') | chrome/browser/android/provider/blocking_ui_thread_async_request.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698