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

Side by Side Diff: chrome/browser/views/options/content_page_view.cc

Issue 45048: Remove Windows "Save As" dialogs from Save Page code.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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 <windows.h> 5 #include <windows.h>
6 #include <shlobj.h> 6 #include <shlobj.h>
7 #include <vsstyle.h> 7 #include <vsstyle.h>
8 #include <vssym32.h> 8 #include <vssym32.h>
9 9
10 #include "chrome/browser/views/options/content_page_view.h" 10 #include "chrome/browser/views/options/content_page_view.h"
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after
187 OptionsPageView(profile) { 187 OptionsPageView(profile) {
188 } 188 }
189 189
190 ContentPageView::~ContentPageView() { 190 ContentPageView::~ContentPageView() {
191 select_file_dialog_->ListenerDestroyed(); 191 select_file_dialog_->ListenerDestroyed();
192 } 192 }
193 193
194 //////////////////////////////////////////////////////////////////////////////// 194 ////////////////////////////////////////////////////////////////////////////////
195 // ContentPageView, SelectFileDialog::Listener implementation: 195 // ContentPageView, SelectFileDialog::Listener implementation:
196 196
197 void ContentPageView::FileSelected(const std::wstring& path, void* params) { 197 void ContentPageView::FileSelected(const std::wstring& path,
198 int index, void* params) {
198 UserMetricsRecordAction(L"Options_SetDownloadDirectory", 199 UserMetricsRecordAction(L"Options_SetDownloadDirectory",
199 profile()->GetPrefs()); 200 profile()->GetPrefs());
200 default_download_location_.SetValue(path); 201 default_download_location_.SetValue(path);
201 // We need to call this manually here since because we're setting the value 202 // We need to call this manually here since because we're setting the value
202 // through the pref member which avoids notifying the listener that set the 203 // through the pref member which avoids notifying the listener that set the
203 // value. 204 // value.
204 UpdateDownloadDirectoryDisplay(); 205 UpdateDownloadDirectoryDisplay();
205 } 206 }
206 207
207 /////////////////////////////////////////////////////////////////////////////// 208 ///////////////////////////////////////////////////////////////////////////////
208 // ContentPageView, views::ButtonListener implementation: 209 // ContentPageView, views::ButtonListener implementation:
209 210
210 void ContentPageView::ButtonPressed(views::Button* sender) { 211 void ContentPageView::ButtonPressed(views::Button* sender) {
211 if (sender == download_browse_button_) { 212 if (sender == download_browse_button_) {
212 const std::wstring dialog_title = 213 const std::wstring dialog_title =
213 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE); 214 l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE);
214 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER, 215 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_FOLDER,
215 dialog_title, 216 dialog_title,
216 profile()->GetPrefs()->GetString( 217 profile()->GetPrefs()->GetString(
217 prefs::kDownloadDefaultDirectory), 218 prefs::kDownloadDefaultDirectory),
218 std::wstring(), std::wstring(), 219 std::wstring(), 0, std::wstring(),
219 GetRootWindow(), 220 GetRootWindow(),
220 NULL); 221 NULL);
221 } else if (sender == download_ask_for_save_location_checkbox_) { 222 } else if (sender == download_ask_for_save_location_checkbox_) {
222 bool enabled = download_ask_for_save_location_checkbox_->checked(); 223 bool enabled = download_ask_for_save_location_checkbox_->checked();
223 if (enabled) { 224 if (enabled) {
224 UserMetricsRecordAction(L"Options_AskForSaveLocation_Enable", 225 UserMetricsRecordAction(L"Options_AskForSaveLocation_Enable",
225 profile()->GetPrefs()); 226 profile()->GetPrefs());
226 } else { 227 } else {
227 UserMetricsRecordAction(L"Options_AskForSaveLocation_Disable", 228 UserMetricsRecordAction(L"Options_AskForSaveLocation_Disable",
228 profile()->GetPrefs()); 229 profile()->GetPrefs());
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
507 fonts_lang_group_ = new OptionsGroupView( 508 fonts_lang_group_ = new OptionsGroupView(
508 contents, 509 contents,
509 l10n_util::GetString(IDS_OPTIONS_FONTSANDLANGUAGES_GROUP_NAME), 510 l10n_util::GetString(IDS_OPTIONS_FONTSANDLANGUAGES_GROUP_NAME),
510 L"", true); 511 L"", true);
511 } 512 }
512 513
513 void ContentPageView::UpdateDownloadDirectoryDisplay() { 514 void ContentPageView::UpdateDownloadDirectoryDisplay() {
514 download_default_download_location_display_->SetFile( 515 download_default_download_location_display_->SetFile(
515 FilePath::FromWStringHack(default_download_location_.GetValue())); 516 FilePath::FromWStringHack(default_download_location_.GetValue()));
516 } 517 }
OLDNEW
« no previous file with comments | « chrome/browser/views/options/content_page_view.h ('k') | chrome/browser/views/shell_dialogs_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698