Chromium Code Reviews| 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 194 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 205 NOTREACHED() << "Can't find owning browser"; | 205 NOTREACHED() << "Can't find owning browser"; |
| 206 return; | 206 return; |
| 207 } | 207 } |
| 208 | 208 |
| 209 TabContentsWrapper* tab = owner_browser->GetSelectedTabContentsWrapper(); | 209 TabContentsWrapper* tab = owner_browser->GetSelectedTabContentsWrapper(); |
| 210 | 210 |
| 211 // Check if we have another dialog opened in the tab. It's unlikely, but | 211 // Check if we have another dialog opened in the tab. It's unlikely, but |
| 212 // possible. | 212 // possible. |
| 213 int32 tab_id = tab ? tab->restore_tab_helper()->session_id().id() : 0; | 213 int32 tab_id = tab ? tab->restore_tab_helper()->session_id().id() : 0; |
| 214 if (PendingExists(tab_id)) | 214 if (PendingExists(tab_id)) |
| 215 return; | 215 PendingDialog::GetInstance()->Remove(tab_id); |
|
Rick Byers
2011/11/25 15:06:06
I haven't looked at the code in detail, but doesn'
bshe
2011/11/25 17:58:49
I am not sure when and how a user attempts to open
| |
| 216 | 216 |
| 217 FilePath virtual_path; | 217 FilePath virtual_path; |
| 218 if (!file_manager_util::ConvertFileToRelativeFileSystemPath( | 218 if (!file_manager_util::ConvertFileToRelativeFileSystemPath( |
| 219 owner_browser->profile(), default_path, &virtual_path)) { | 219 owner_browser->profile(), default_path, &virtual_path)) { |
| 220 virtual_path = default_path.BaseName(); | 220 virtual_path = default_path.BaseName(); |
| 221 } | 221 } |
| 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 |
| (...skipping 11 matching lines...) Expand all Loading... | |
| 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 |