Popular sites on the NTP: check that experiment group StartsWith (rather than IS...
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / open_util.h
blob668827a539b1069c1d34b28ffcb05ec6a12fde8f
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.
8 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_
9 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_
11 #include "base/callback_forward.h"
12 #include "chrome/browser/platform_util.h"
14 class Profile;
16 namespace base {
17 class FilePath;
20 namespace file_manager {
21 namespace util {
23 // If |item_type| is OPEN_FILE: Opens an item using a file handler, a file
24 // browser handler, or the browser (open in a tab). The default handler has
25 // precedence over other handlers, if defined for the type of the target file.
27 // If |item_type| is OPEN_FOLDER: Open the directory at |file_path| using the
28 // file browser.
30 // It is an error for |file_path| to not match the type implied by |item_type|.
31 // This error will be reported to |callback|.
33 // If |callback| is null, shows an error message to the user indicating the
34 // error if the operation is unsuccessful. No error messages will be displayed
35 // if |callback| is non-null.
36 void OpenItem(Profile* profile,
37 const base::FilePath& file_path,
38 platform_util::OpenItemType item_type,
39 const platform_util::OpenOperationCallback& callback);
41 // Opens the file manager for the folder containing the item specified by
42 // |file_path|, with the item selected.
43 void ShowItemInFolder(Profile* profile,
44 const base::FilePath& file_path,
45 const platform_util::OpenOperationCallback& callback);
47 // Change the behavior of the above functions to do everything except launch any
48 // extensions including a file browser.
49 void DisableShellOperationsForTesting();
51 } // namespace util
52 } // namespace file_manager
54 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_UTIL_H_