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

Unified Diff: chrome/browser/browser.cc

Issue 2450004: Don't save last used locations in open and save dialogs when in incognito mode. (Closed) Base URL: git://codf21.jail.google.com/chromium.git
Patch Set: Rename kLastSelectedDirectory to kSelectFileLastDirectory. Created 10 years, 6 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/download/save_package.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/browser.cc
diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc
index 2cca70402e693649ec472fa03452e1f81650304a..6924de0bdbc722f9dbd6ae93b1c25bb4144da968 100644
--- a/chrome/browser/browser.cc
+++ b/chrome/browser/browser.cc
@@ -1578,10 +1578,12 @@ void Browser::OpenFile() {
if (!select_file_dialog_.get())
select_file_dialog_ = SelectFileDialog::Create(this);
+ const FilePath directory = profile_->last_selected_directory();
+
// TODO(beng): figure out how to juggle this.
gfx::NativeWindow parent_window = window_->GetNativeHandle();
select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE,
- string16(), FilePath(),
+ string16(), directory,
NULL, 0, FILE_PATH_LITERAL(""),
parent_window, NULL);
#endif
@@ -2850,6 +2852,7 @@ void Browser::OnDidGetApplicationInfo(TabContents* tab_contents,
// Browser, SelectFileDialog::Listener implementation:
void Browser::FileSelected(const FilePath& path, int index, void* params) {
+ profile_->set_last_selected_directory(path.DirName());
GURL file_url = net::FilePathToFileURL(path);
if (!file_url.is_empty())
OpenURL(file_url, GURL(), CURRENT_TAB, PageTransition::TYPED);
« no previous file with comments | « no previous file | chrome/browser/download/save_package.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698