| 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 "apps/shell_window.h" | 7 #include "apps/shell_window.h" |
| 8 #include "apps/shell_window_registry.h" | 8 #include "apps/shell_window_registry.h" |
| 9 #include "apps/ui/native_app_window.h" | 9 #include "apps/ui/native_app_window.h" |
| 10 #include "base/bind.h" | 10 #include "base/bind.h" |
| (...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 156 // reload it. | 156 // reload it. |
| 157 std::string extension_id = dialog->host()->extension()->id(); | 157 std::string extension_id = dialog->host()->extension()->id(); |
| 158 // Reload the extension after a bit; the extension may not have been unloaded | 158 // Reload the extension after a bit; the extension may not have been unloaded |
| 159 // yet. We don't want to try to reload the extension only to have the Unload | 159 // yet. We don't want to try to reload the extension only to have the Unload |
| 160 // code execute after us and re-unload the extension. | 160 // code execute after us and re-unload the extension. |
| 161 // | 161 // |
| 162 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to | 162 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to |
| 163 // reload the extension at all - when we try to open the extension the next | 163 // reload the extension at all - when we try to open the extension the next |
| 164 // time, the extension subsystem would automatically reload it for us. At | 164 // time, the extension subsystem would automatically reload it for us. At |
| 165 // this time though this is broken because of some faulty wiring in | 165 // this time though this is broken because of some faulty wiring in |
| 166 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. | 166 // extensions::ProcessManager::CreateViewHost. Once that is fixed, remove |
| 167 // this. |
| 167 if (profile_) { | 168 if (profile_) { |
| 168 base::MessageLoop::current()->PostTask( | 169 base::MessageLoop::current()->PostTask( |
| 169 FROM_HERE, | 170 FROM_HERE, |
| 170 base::Bind(&ExtensionService::ReloadExtension, | 171 base::Bind(&ExtensionService::ReloadExtension, |
| 171 base::Unretained(extensions::ExtensionSystem::Get(profile_) | 172 base::Unretained(extensions::ExtensionSystem::Get(profile_) |
| 172 ->extension_service()), | 173 ->extension_service()), |
| 173 extension_id)); | 174 extension_id)); |
| 174 } | 175 } |
| 175 | 176 |
| 176 dialog->GetWidget()->Close(); | 177 dialog->GetWidget()->Close(); |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 384 } | 385 } |
| 385 | 386 |
| 386 // Connect our listener to FileDialogFunction's per-tab callbacks. | 387 // Connect our listener to FileDialogFunction's per-tab callbacks. |
| 387 AddPending(routing_id); | 388 AddPending(routing_id); |
| 388 | 389 |
| 389 extension_dialog_ = dialog; | 390 extension_dialog_ = dialog; |
| 390 params_ = params; | 391 params_ = params; |
| 391 routing_id_ = routing_id; | 392 routing_id_ = routing_id; |
| 392 owner_window_ = owner_window; | 393 owner_window_ = owner_window; |
| 393 } | 394 } |
| OLD | NEW |