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

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

Issue 1520543004: Add method for identifying different InfoBars (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Nit again Created 4 years, 11 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 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA R_DELEGATE_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA R_DELEGATE_H_
6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA R_DELEGATE_H_ 6 #define CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INFOBA R_DELEGATE_H_
7 7
8 #include "base/android/scoped_java_ref.h" 8 #include "base/android/scoped_java_ref.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/files/file_path.h" 10 #include "base/files/file_path.h"
(...skipping 20 matching lines...) Expand all
31 const base::FilePath& suggested_download_path, 31 const base::FilePath& suggested_download_path,
32 const DownloadTargetDeterminerDelegate::FileSelectedCallback& 32 const DownloadTargetDeterminerDelegate::FileSelectedCallback&
33 file_selected_callback); 33 file_selected_callback);
34 34
35 private: 35 private:
36 ChromeDownloadManagerOverwriteInfoBarDelegate( 36 ChromeDownloadManagerOverwriteInfoBarDelegate(
37 const base::FilePath& suggested_path, 37 const base::FilePath& suggested_path,
38 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); 38 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback);
39 39
40 // DownloadOverwriteInfoBarDelegate: 40 // DownloadOverwriteInfoBarDelegate:
41 infobars::InfoBarDelegate::InfoBarIdentifier GetIdentifier() const override;
41 bool OverwriteExistingFile() override; 42 bool OverwriteExistingFile() override;
42 bool CreateNewFile() override; 43 bool CreateNewFile() override;
43 std::string GetFileName() const override; 44 std::string GetFileName() const override;
44 std::string GetDirName() const override; 45 std::string GetDirName() const override;
45 std::string GetDirFullPath() const override; 46 std::string GetDirFullPath() const override;
46 void InfoBarDismissed() override; 47 void InfoBarDismissed() override;
47 48
48 // Called on the FILE thread to create a new file. Calls |callback| on the UI 49 // Called on the FILE thread to create a new file. Calls |callback| on the UI
49 // thread when finished. 50 // thread when finished.
50 static void CreateNewFileInternal( 51 static void CreateNewFileInternal(
51 const base::FilePath& suggested_download_path, 52 const base::FilePath& suggested_download_path,
52 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback); 53 const DownloadTargetDeterminerDelegate::FileSelectedCallback& callback);
53 54
54 // The suggested download path from download target determiner. This is used 55 // The suggested download path from download target determiner. This is used
55 // to show users the file name and the directory that will be used. 56 // to show users the file name and the directory that will be used.
56 base::FilePath suggested_download_path_; 57 base::FilePath suggested_download_path_;
57 58
58 // A callback to download target determiner to notify that file selection 59 // A callback to download target determiner to notify that file selection
59 // is made (or cancelled). 60 // is made (or cancelled).
60 DownloadTargetDeterminerDelegate::FileSelectedCallback 61 DownloadTargetDeterminerDelegate::FileSelectedCallback
61 file_selected_callback_; 62 file_selected_callback_;
62 63
63 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerOverwriteInfoBarDelegate); 64 DISALLOW_COPY_AND_ASSIGN(ChromeDownloadManagerOverwriteInfoBarDelegate);
64 }; 65 };
65 66
66 } // namespace android 67 } // namespace android
67 } // namespace chrome 68 } // namespace chrome
68 69
69 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INF OBAR_DELEGATE_H_ 70 #endif // CHROME_BROWSER_ANDROID_DOWNLOAD_CHROME_DOWNLOAD_MANAGER_OVERWRITE_INF OBAR_DELEGATE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698