| 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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 276 std::vector<Profile*> profiles = | 276 std::vector<Profile*> profiles = |
| 277 g_browser_process->profile_manager()->GetLoadedProfiles(); | 277 g_browser_process->profile_manager()->GetLoadedProfiles(); |
| 278 for (std::vector<Profile*>::const_iterator i(profiles.begin()); | 278 for (std::vector<Profile*>::const_iterator i(profiles.begin()); |
| 279 i < profiles.end(); ++i) { | 279 i < profiles.end(); ++i) { |
| 280 extensions::ShellWindowRegistry* registry = | 280 extensions::ShellWindowRegistry* registry = |
| 281 extensions::ShellWindowRegistry::Get(*i); | 281 extensions::ShellWindowRegistry::Get(*i); |
| 282 DCHECK(registry); | 282 DCHECK(registry); |
| 283 ShellWindow* shell_window = registry->GetShellWindowForNativeWindow( | 283 ShellWindow* shell_window = registry->GetShellWindowForNativeWindow( |
| 284 owner_window); | 284 owner_window); |
| 285 if (shell_window) { | 285 if (shell_window) { |
| 286 base_window = shell_window; | 286 base_window = shell_window->GetBaseWindow(); |
| 287 tab = shell_window->tab_contents(); | 287 tab = shell_window->tab_contents(); |
| 288 profile_ = *i; | 288 profile_ = *i; |
| 289 break; | 289 break; |
| 290 } | 290 } |
| 291 } | 291 } |
| 292 } | 292 } |
| 293 | 293 |
| 294 if (!base_window) { | 294 if (!base_window) { |
| 295 NOTREACHED() << "Can't find owning window."; | 295 NOTREACHED() << "Can't find owning window."; |
| 296 return; | 296 return; |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 341 kFileManagerMinimumHeight); | 341 kFileManagerMinimumHeight); |
| 342 | 342 |
| 343 // Connect our listener to FileDialogFunction's per-tab callbacks. | 343 // Connect our listener to FileDialogFunction's per-tab callbacks. |
| 344 AddPending(tab_id); | 344 AddPending(tab_id); |
| 345 | 345 |
| 346 extension_dialog_ = dialog; | 346 extension_dialog_ = dialog; |
| 347 params_ = params; | 347 params_ = params; |
| 348 tab_id_ = tab_id; | 348 tab_id_ = tab_id; |
| 349 owner_window_ = owner_window; | 349 owner_window_ = owner_window; |
| 350 } | 350 } |
| OLD | NEW |