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 #include "chrome/browser/chromeos/extensions/file_manager_util.h" | 4 #include "chrome/browser/chromeos/extensions/file_manager_util.h" |
5 | 5 |
6 #include "base/bind.h" | 6 #include "base/bind.h" |
7 #include "base/file_util.h" | 7 #include "base/file_util.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "chrome/browser/extensions/crx_installer.h" | 21 #include "chrome/browser/extensions/crx_installer.h" |
22 #include "chrome/browser/extensions/extension_install_ui.h" | 22 #include "chrome/browser/extensions/extension_install_ui.h" |
23 #include "chrome/browser/extensions/extension_service.h" | 23 #include "chrome/browser/extensions/extension_service.h" |
24 #include "chrome/browser/plugin_prefs.h" | 24 #include "chrome/browser/plugin_prefs.h" |
25 #include "chrome/browser/profiles/profile.h" | 25 #include "chrome/browser/profiles/profile.h" |
26 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
28 #include "chrome/browser/ui/browser_finder.h" | 28 #include "chrome/browser/ui/browser_finder.h" |
29 #include "chrome/browser/ui/browser_list.h" | 29 #include "chrome/browser/ui/browser_list.h" |
30 #include "chrome/browser/ui/browser_window.h" | 30 #include "chrome/browser/ui/browser_window.h" |
| 31 #include "chrome/browser/ui/extensions/application_launch.h" |
31 #include "chrome/browser/ui/simple_message_box.h" | 32 #include "chrome/browser/ui/simple_message_box.h" |
32 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 33 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
33 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 34 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
34 #include "chrome/common/chrome_paths.h" | 35 #include "chrome/common/chrome_paths.h" |
35 #include "chrome/common/extensions/file_browser_handler.h" | 36 #include "chrome/common/extensions/file_browser_handler.h" |
36 #include "chrome/common/url_constants.h" | 37 #include "chrome/common/url_constants.h" |
37 #include "content/public/browser/browser_thread.h" | 38 #include "content/public/browser/browser_thread.h" |
38 #include "content/public/browser/plugin_service.h" | 39 #include "content/public/browser/plugin_service.h" |
39 #include "content/public/browser/user_metrics.h" | 40 #include "content/public/browser/user_metrics.h" |
40 #include "content/public/browser/web_contents.h" | 41 #include "content/public/browser/web_contents.h" |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
466 const Extension* extension = | 467 const Extension* extension = |
467 service->GetExtensionById(kFileBrowserDomain, false); | 468 service->GetExtensionById(kFileBrowserDomain, false); |
468 if (!extension) | 469 if (!extension) |
469 return; | 470 return; |
470 | 471 |
471 extension_misc::LaunchContainer launch_container = | 472 extension_misc::LaunchContainer launch_container = |
472 service->extension_prefs()-> | 473 service->extension_prefs()-> |
473 GetLaunchContainer(extension, ExtensionPrefs::LAUNCH_DEFAULT); | 474 GetLaunchContainer(extension, ExtensionPrefs::LAUNCH_DEFAULT); |
474 | 475 |
475 content::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); | 476 content::RecordAction(UserMetricsAction("ShowFileBrowserFullTab")); |
476 Browser::OpenApplication( | 477 ApplicationLaunch::OpenApplication( |
477 profile, extension, launch_container, GURL(url), NEW_FOREGROUND_TAB); | 478 profile, extension, launch_container, GURL(url), NEW_FOREGROUND_TAB); |
478 } | 479 } |
479 | 480 |
480 void ViewRemovableDrive(const FilePath& path) { | 481 void ViewRemovableDrive(const FilePath& path) { |
481 OpenFileBrowser(path, REUSE_ANY_FILE_MANAGER, "mountTriggered"); | 482 OpenFileBrowser(path, REUSE_ANY_FILE_MANAGER, "mountTriggered"); |
482 } | 483 } |
483 | 484 |
484 void ShowFileInFolder(const FilePath& path) { | 485 void ShowFileInFolder(const FilePath& path) { |
485 // This action changes the selection so we do not reuse existing tabs. | 486 // This action changes the selection so we do not reuse existing tabs. |
486 OpenFileBrowser(path, REUSE_NEVER, "selectOnly"); | 487 OpenFileBrowser(path, REUSE_NEVER, "selectOnly"); |
(...skipping 239 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
726 GDataOperationRegistry::ProgressStatus>::const_iterator iter = | 727 GDataOperationRegistry::ProgressStatus>::const_iterator iter = |
727 list.begin(); | 728 list.begin(); |
728 iter != list.end(); ++iter) { | 729 iter != list.end(); ++iter) { |
729 result_list->Append( | 730 result_list->Append( |
730 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); | 731 ProgessStatusToDictionaryValue(profile, origin_url, *iter)); |
731 } | 732 } |
732 return result_list.release(); | 733 return result_list.release(); |
733 } | 734 } |
734 | 735 |
735 } // namespace file_manager_util | 736 } // namespace file_manager_util |
OLD | NEW |