Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / chrome / browser / chromeos / file_manager / open_with_browser.h
blob5137f8d31ddce158207db3fe4b83cb44628f74ac
1 // Copyright 2013 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 utilities for opening files with the browser.
7 #ifndef CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_WITH_BROWSER_H_
8 #define CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_WITH_BROWSER_H_
10 #include "base/files/file_path.h"
12 class Profile;
14 namespace storage {
15 class FileSystemURL;
18 namespace file_manager {
19 namespace util {
21 // Opens the file specified by |file_path| with the browser for
22 // |profile|. This function takes care of the following intricacies:
24 // - If there is no active browser window, open it.
25 // - If the file is a Drive hosted document, the hosted document will be
26 // opened in the browser by extracting the right URL for the file.
27 // - If the file is on Drive, the file will be downloaded from Drive as
28 // needed.
30 // Returns false if failed to open. This happens if the file type is unknown.
31 bool OpenFileWithBrowser(Profile* profile,
32 const storage::FileSystemURL& file_system_url);
34 // Checks whether a pepper plugin for |file_extension| is enabled.
35 bool ShouldBeOpenedWithPlugin(
36 Profile* profile,
37 const base::FilePath::StringType& file_extension);
39 } // namespace util
40 } // namespace file_manager
42 #endif // CHROME_BROWSER_CHROMEOS_FILE_MANAGER_OPEN_WITH_BROWSER_H_