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 132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
143 // Reload the extension after a bit; the extension may not have been unloaded | 143 // Reload the extension after a bit; the extension may not have been unloaded |
144 // yet. We don't want to try to reload the extension only to have the Unload | 144 // yet. We don't want to try to reload the extension only to have the Unload |
145 // code execute after us and re-unload the extension. | 145 // code execute after us and re-unload the extension. |
146 // | 146 // |
147 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to | 147 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to |
148 // reload the extension at all - when we try to open the extension the next | 148 // reload the extension at all - when we try to open the extension the next |
149 // time, the extension subsystem would automatically reload it for us. At | 149 // time, the extension subsystem would automatically reload it for us. At |
150 // this time though this is broken because of some faulty wiring in | 150 // this time though this is broken because of some faulty wiring in |
151 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. | 151 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. |
152 if (profile_) { | 152 if (profile_) { |
153 MessageLoop::current()->PostTask(FROM_HERE, | 153 base::MessageLoop::current()->PostTask( |
| 154 FROM_HERE, |
154 base::Bind(&ExtensionService::ReloadExtension, | 155 base::Bind(&ExtensionService::ReloadExtension, |
155 base::Unretained(extensions::ExtensionSystem::Get(profile_)-> | 156 base::Unretained(extensions::ExtensionSystem::Get(profile_) |
156 extension_service()), | 157 ->extension_service()), |
157 extension_id)); | 158 extension_id)); |
158 } | 159 } |
159 | 160 |
160 dialog->Close(); | 161 dialog->Close(); |
161 } | 162 } |
162 | 163 |
163 // static | 164 // static |
164 void SelectFileDialogExtension::OnFileSelected( | 165 void SelectFileDialogExtension::OnFileSelected( |
165 int32 tab_id, | 166 int32 tab_id, |
166 const ui::SelectedFileInfo& file, | 167 const ui::SelectedFileInfo& file, |
167 int index) { | 168 int index) { |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 kFileManagerMinimumHeight); | 369 kFileManagerMinimumHeight); |
369 | 370 |
370 // Connect our listener to FileDialogFunction's per-tab callbacks. | 371 // Connect our listener to FileDialogFunction's per-tab callbacks. |
371 AddPending(tab_id); | 372 AddPending(tab_id); |
372 | 373 |
373 extension_dialog_ = dialog; | 374 extension_dialog_ = dialog; |
374 params_ = params; | 375 params_ = params; |
375 tab_id_ = tab_id; | 376 tab_id_ = tab_id; |
376 owner_window_ = owner_window; | 377 owner_window_ = owner_window; |
377 } | 378 } |
OLD | NEW |