• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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
3 // found in the LICENSE file.
4 //
5 // This file provides functions for opening an item (file or directory) using
6 // the file manager.
7 
8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_
9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_
10 
11 class Profile;
12 
13 namespace base {
14 class FilePath;
15 }
16 
17 namespace file_manager {
18 namespace util {
19 
20 // Opens the file manager for the freshly mounted removable drive specified
21 // by |file_path|.
22 // If there is another file manager instance open, this call does nothing.
23 // The mount event will cause the file manager to show the new drive in
24 // the left panel.
25 // If there is no file manager open, this call opens a new one pointing to
26 // |file_path|. In this case the tab will automatically close on |file_path|
27 // unmount.
28 void OpenRemovableDrive(Profile* profile, const base::FilePath& file_path);
29 
30 // Opens an item (file or directory). If the target is a directory, the
31 // directory will be opened in the file manager. If the target is a file, the
32 // file will be opened using a file handler, a file browser handler, or the
33 // browser (open in a tab). The default handler has precedence over other
34 // handlers, if defined for the type of the target file.
35 void OpenItem(Profile* profile, const base::FilePath& file_path);
36 
37 // Opens the file manager for the folder containing the item specified by
38 // |file_path|, with the item selected.
39 void ShowItemInFolder(Profile* profile, const base::FilePath& file_path);
40 
41 }  // namespace util
42 }  // namespace file_manager
43 
44 #endif  // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_
45