| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted.h" | 8 #include "base/memory/ref_counted.h" |
| 9 #include "base/memory/singleton.h" | 9 #include "base/memory/singleton.h" |
| 10 #include "chrome/browser/extensions/extension_file_browser_private_api.h" | 10 #include "chrome/browser/extensions/extension_file_browser_private_api.h" |
| (...skipping 211 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 222 | 222 |
| 223 hasMultipleFileTypeChoices_ = | 223 hasMultipleFileTypeChoices_ = |
| 224 file_types ? file_types->extensions.size() > 1 : true; | 224 file_types ? file_types->extensions.size() > 1 : true; |
| 225 | 225 |
| 226 GURL file_browser_url = FileManagerUtil::GetFileBrowserUrlWithParams( | 226 GURL file_browser_url = FileManagerUtil::GetFileBrowserUrlWithParams( |
| 227 type, title, virtual_path, file_types, file_type_index, | 227 type, title, virtual_path, file_types, file_type_index, |
| 228 default_extension); | 228 default_extension); |
| 229 | 229 |
| 230 ExtensionDialog* dialog = ExtensionDialog::Show(file_browser_url, | 230 ExtensionDialog* dialog = ExtensionDialog::Show(file_browser_url, |
| 231 owner_browser, tab->tab_contents(), | 231 owner_browser, tab->tab_contents(), |
| 232 kFileManagerWidth, kFileManagerHeight, | 232 kFileManagerWidth, kFileManagerHeight, string16(), |
| 233 this /* ExtensionDialog::Observer */); | 233 this /* ExtensionDialog::Observer */); |
| 234 if (!dialog) { | 234 if (!dialog) { |
| 235 LOG(ERROR) << "Unable to create extension dialog"; | 235 LOG(ERROR) << "Unable to create extension dialog"; |
| 236 return; | 236 return; |
| 237 } | 237 } |
| 238 | 238 |
| 239 // Connect our listener to FileDialogFunction's per-tab callbacks. | 239 // Connect our listener to FileDialogFunction's per-tab callbacks. |
| 240 AddPending(tab_id); | 240 AddPending(tab_id); |
| 241 | 241 |
| 242 extension_dialog_ = dialog; | 242 extension_dialog_ = dialog; |
| 243 params_ = params; | 243 params_ = params; |
| 244 tab_id_ = tab_id; | 244 tab_id_ = tab_id; |
| 245 owner_window_ = owner_window; | 245 owner_window_ = owner_window; |
| 246 } | 246 } |
| OLD | NEW |