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 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 // code execute after us and re-unload the extension. | 147 // code execute after us and re-unload the extension. |
147 // | 148 // |
148 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to | 149 // TODO(rkc): This is ugly. The ideal solution is that we shouldn't need to |
149 // reload the extension at all - when we try to open the extension the next | 150 // reload the extension at all - when we try to open the extension the next |
150 // time, the extension subsystem would automatically reload it for us. At | 151 // time, the extension subsystem would automatically reload it for us. At |
151 // this time though this is broken because of some faulty wiring in | 152 // this time though this is broken because of some faulty wiring in |
152 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. | 153 // ExtensionProcessManager::CreateViewHost. Once that is fixed, remove this. |
153 if (profile_) { | 154 if (profile_) { |
154 MessageLoop::current()->PostTask(FROM_HERE, | 155 MessageLoop::current()->PostTask(FROM_HERE, |
155 base::Bind(&ExtensionService::ReloadExtension, | 156 base::Bind(&ExtensionService::ReloadExtension, |
156 base::Unretained(profile_->GetExtensionService()), | 157 base::Unretained(extensions::ExtensionSystem::Get(profile_)-> |
| 158 extension_service()), |
157 extension_id)); | 159 extension_id)); |
158 } | 160 } |
159 | 161 |
160 dialog->Close(); | 162 dialog->Close(); |
161 } | 163 } |
162 | 164 |
163 // static | 165 // static |
164 void SelectFileDialogExtension::OnFileSelected( | 166 void SelectFileDialogExtension::OnFileSelected( |
165 int32 tab_id, | 167 int32 tab_id, |
166 const ui::SelectedFileInfo& file, | 168 const ui::SelectedFileInfo& file, |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
353 kFileManagerMinimumHeight); | 355 kFileManagerMinimumHeight); |
354 | 356 |
355 // Connect our listener to FileDialogFunction's per-tab callbacks. | 357 // Connect our listener to FileDialogFunction's per-tab callbacks. |
356 AddPending(tab_id); | 358 AddPending(tab_id); |
357 | 359 |
358 extension_dialog_ = dialog; | 360 extension_dialog_ = dialog; |
359 params_ = params; | 361 params_ = params; |
360 tab_id_ = tab_id; | 362 tab_id_ = tab_id; |
361 owner_window_ = owner_window; | 363 owner_window_ = owner_window; |
362 } | 364 } |
OLD | NEW |