| OLD | NEW |
| 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/views/select_file_dialog_extension.h" | 5 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/ref_counted.h" | 10 #include "base/memory/ref_counted.h" |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 73 | 73 |
| 74 scoped_refptr<SelectFileDialogExtension> PendingDialog::Find(int32 tab_id) { | 74 scoped_refptr<SelectFileDialogExtension> PendingDialog::Find(int32 tab_id) { |
| 75 Map::const_iterator it = map_.find(tab_id); | 75 Map::const_iterator it = map_.find(tab_id); |
| 76 if (it == map_.end()) | 76 if (it == map_.end()) |
| 77 return NULL; | 77 return NULL; |
| 78 return it->second; | 78 return it->second; |
| 79 } | 79 } |
| 80 | 80 |
| 81 } // namespace | 81 } // namespace |
| 82 | 82 |
| 83 // Linking this implementation of SelectFileDialog::Create into the target | 83 ///////////////////////////////////////////////////////////////////////////// |
| 84 // selects FileManagerDialog as the dialog of choice. | 84 |
| 85 // TODO(jamescook): Move this into a new file shell_dialogs_chromeos.cc | 85 // TODO(jamescook): Move this into a new file shell_dialogs_chromeos.cc |
| 86 // TODO(jamescook): Change all instances of SelectFileDialog::Create to return | 86 // TODO(jamescook): Change all instances of SelectFileDialog::Create to return |
| 87 // scoped_refptr<SelectFileDialog> as object is ref-counted. | 87 // scoped_refptr<SelectFileDialog> as object is ref-counted. |
| 88 // static | 88 // static |
| 89 SelectFileDialog* SelectFileDialog::Create(Listener* listener, | |
| 90 ui::SelectFilePolicy* policy) { | |
| 91 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | |
| 92 return SelectFileDialogExtension::Create(listener, policy); | |
| 93 } | |
| 94 | |
| 95 ///////////////////////////////////////////////////////////////////////////// | |
| 96 | |
| 97 // static | |
| 98 SelectFileDialogExtension* SelectFileDialogExtension::Create( | 89 SelectFileDialogExtension* SelectFileDialogExtension::Create( |
| 99 Listener* listener, | 90 Listener* listener, |
| 100 ui::SelectFilePolicy* policy) { | 91 ui::SelectFilePolicy* policy) { |
| 101 return new SelectFileDialogExtension(listener, policy); | 92 return new SelectFileDialogExtension(listener, policy); |
| 102 } | 93 } |
| 103 | 94 |
| 104 SelectFileDialogExtension::SelectFileDialogExtension( | 95 SelectFileDialogExtension::SelectFileDialogExtension( |
| 105 Listener* listener, | 96 Listener* listener, |
| 106 ui::SelectFilePolicy* policy) | 97 ui::SelectFilePolicy* policy) |
| 107 : SelectFileDialog(listener, policy), | 98 : SelectFileDialog(listener, policy), |
| (...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 } | 334 } |
| 344 | 335 |
| 345 // Connect our listener to FileDialogFunction's per-tab callbacks. | 336 // Connect our listener to FileDialogFunction's per-tab callbacks. |
| 346 AddPending(tab_id); | 337 AddPending(tab_id); |
| 347 | 338 |
| 348 extension_dialog_ = dialog; | 339 extension_dialog_ = dialog; |
| 349 params_ = params; | 340 params_ = params; |
| 350 tab_id_ = tab_id; | 341 tab_id_ = tab_id; |
| 351 owner_window_ = owner_window; | 342 owner_window_ = owner_window; |
| 352 } | 343 } |
| OLD | NEW |