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

Side by Side Diff: chrome/browser/ui/select_file_dialog.cc

Issue 9706012: Add abstractions that let embedders drive tests of WebContents. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Remove CONTENT_EXPORT on statically linked functions. Merge to head for commit. Created 8 years, 9 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 #include "chrome/browser/ui/select_file_dialog.h" 5 #include "chrome/browser/ui/select_file_dialog.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 if (source_contents) { 76 if (source_contents) {
77 TabContentsWrapper* wrapper = 77 TabContentsWrapper* wrapper =
78 TabContentsWrapper::GetCurrentWrapperForContents(source_contents); 78 TabContentsWrapper::GetCurrentWrapperForContents(source_contents);
79 InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper(); 79 InfoBarTabHelper* infobar_helper = wrapper->infobar_tab_helper();
80 infobar_helper->AddInfoBar(new SimpleAlertInfoBarDelegate( 80 infobar_helper->AddInfoBar(new SimpleAlertInfoBarDelegate(
81 infobar_helper, 81 infobar_helper,
82 NULL, 82 NULL,
83 l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR), 83 l10n_util::GetStringUTF16(IDS_FILE_SELECTION_DIALOG_INFOBAR),
84 true)); 84 true));
85 } else { 85 } else {
86 LOG(WARNING) << "File-selection dialogs are disabled but no TabContents " 86 LOG(WARNING) << "File-selection dialogs are disabled but no WebContents "
87 << "is given to display the InfoBar."; 87 << "is given to display the InfoBar.";
88 } 88 }
89 89
90 // Inform the listener that no file was selected. 90 // Inform the listener that no file was selected.
91 // Post a task rather than calling FileSelectionCanceled directly to ensure 91 // Post a task rather than calling FileSelectionCanceled directly to ensure
92 // that the listener is called asynchronously. 92 // that the listener is called asynchronously.
93 MessageLoop::current()->PostTask( 93 MessageLoop::current()->PostTask(
94 FROM_HERE, base::Bind(&SelectFileDialog::CancelFileSelection, this, 94 FROM_HERE, base::Bind(&SelectFileDialog::CancelFileSelection, this,
95 params)); 95 params));
96 return; 96 return;
97 } 97 }
98 // Call the platform specific implementation of the file selection dialog. 98 // Call the platform specific implementation of the file selection dialog.
99 SelectFileImpl(type, title, default_path, file_types, file_type_index, 99 SelectFileImpl(type, title, default_path, file_types, file_type_index,
100 default_extension, owning_window, params); 100 default_extension, owning_window, params);
101 } 101 }
102 102
103 bool SelectFileDialog::HasMultipleFileTypeChoices() { 103 bool SelectFileDialog::HasMultipleFileTypeChoices() {
104 return HasMultipleFileTypeChoicesImpl(); 104 return HasMultipleFileTypeChoicesImpl();
105 } 105 }
106 106
107 void SelectFileDialog::CancelFileSelection(void* params) { 107 void SelectFileDialog::CancelFileSelection(void* params) {
108 if (listener_) 108 if (listener_)
109 listener_->FileSelectionCanceled(params); 109 listener_->FileSelectionCanceled(params);
110 } 110 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/prefs/prefs_tab_helper_unittest.cc ('k') | chrome/browser/ui/tab_contents/test_tab_contents_wrapper.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698