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" |
11 #include "base/memory/singleton.h" | 11 #include "base/memory/singleton.h" |
12 #include "base/message_loop.h" | 12 #include "base/message_loop.h" |
13 #include "chrome/common/pref_names.h" | 13 #include "chrome/common/pref_names.h" |
14 #include "chrome/browser/browser_process.h" | 14 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" | 15 #include "chrome/browser/chromeos/extensions/file_browser_private_api.h" |
16 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 16 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
17 #include "chrome/browser/extensions/extension_host.h" | 17 #include "chrome/browser/extensions/extension_host.h" |
18 #include "chrome/browser/extensions/extension_service.h" | 18 #include "chrome/browser/extensions/extension_service.h" |
| 19 #include "chrome/browser/extensions/extension_system.h" |
19 #include "chrome/browser/extensions/shell_window_registry.h" | 20 #include "chrome/browser/extensions/shell_window_registry.h" |
20 #include "chrome/browser/profiles/profile_manager.h" | 21 #include "chrome/browser/profiles/profile_manager.h" |
21 #include "chrome/browser/sessions/session_tab_helper.h" | 22 #include "chrome/browser/sessions/session_tab_helper.h" |
22 #include "chrome/browser/ui/base_window.h" | 23 #include "chrome/browser/ui/base_window.h" |
23 #include "chrome/browser/ui/browser.h" | 24 #include "chrome/browser/ui/browser.h" |
24 #include "chrome/browser/ui/browser_finder.h" | 25 #include "chrome/browser/ui/browser_finder.h" |
25 #include "chrome/browser/ui/browser_list.h" | 26 #include "chrome/browser/ui/browser_list.h" |
26 #include "chrome/browser/ui/browser_tabstrip.h" | 27 #include "chrome/browser/ui/browser_tabstrip.h" |
27 #include "chrome/browser/ui/browser_window.h" | 28 #include "chrome/browser/ui/browser_window.h" |
28 #include "chrome/browser/ui/chrome_select_file_policy.h" | 29 #include "chrome/browser/ui/chrome_select_file_policy.h" |
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 // code execute after us and re-unload the extension. | 146 // code execute after us and re-unload the extension. |
146 // | 147 // |
147 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to | 148 // 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 | 149 // 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 | 150 // time, the extension subsystem would automatically reload it for us. At |
150 // this time though this is broken because of some faulty wiring in | 151 // this time though this is broken because of some faulty wiring in |
151 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. | 152 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. |
152 if (profile_) { | 153 if (profile_) { |
153 MessageLoop::current()->PostTask(FROM_HERE, | 154 MessageLoop::current()->PostTask(FROM_HERE, |
154 base::Bind(&ExtensionService::ReloadExtension, | 155 base::Bind(&ExtensionService::ReloadExtension, |
155 base::Unretained(profile_->GetExtensionService()), | 156 base::Unretained(extensions::ExtensionSystem::Get(profile_)-> |
| 157 extension_service()), |
156 extension_id)); | 158 extension_id)); |
157 } | 159 } |
158 | 160 |
159 dialog->Close(); | 161 dialog->Close(); |
160 } | 162 } |
161 | 163 |
162 // static | 164 // static |
163 void SelectFileDialogExtension::OnFileSelected( | 165 void SelectFileDialogExtension::OnFileSelected( |
164 int32 tab_id, | 166 int32 tab_id, |
165 const ui::SelectedFileInfo& file, | 167 const ui::SelectedFileInfo& file, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 kFileManagerMinimumHeight); | 354 kFileManagerMinimumHeight); |
353 | 355 |
354 // Connect our listener to FileDialogFunction's per-tab callbacks. | 356 // Connect our listener to FileDialogFunction's per-tab callbacks. |
355 AddPending(tab_id); | 357 AddPending(tab_id); |
356 | 358 |
357 extension_dialog_ = dialog; | 359 extension_dialog_ = dialog; |
358 params_ = params; | 360 params_ = params; |
359 tab_id_ = tab_id; | 361 tab_id_ = tab_id; |
360 owner_window_ = owner_window; | 362 owner_window_ = owner_window; |
361 } | 363 } |
OLD | NEW |