OLD | NEW |
| (Empty) |
1 // Copyright 2015 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 #include "base/files/file_path.h" | |
6 #include "mojo/fetcher/url_resolver.h" | |
7 #include "mojo/services/network/public/interfaces/network_service.mojom.h" | |
8 #include "mojo/services/network/public/interfaces/url_loader_factory.mojom.h" | |
9 #include "mojo/shell/application_fetcher.h" | |
10 | |
11 namespace mojo { | |
12 namespace fetcher { | |
13 | |
14 // This is the default implementation of shell::ApplicationFetcher. It loads | |
15 // http/s urls off the network as well as providing special handling for mojo: | |
16 // and about: urls. | |
17 class BaseApplicationFetcher : public shell::ApplicationFetcher { | |
18 public: | |
19 // mojo: urls are only supported if |shell_file_root| is non-empty. | |
20 BaseApplicationFetcher(const base::FilePath& shell_file_root); | |
21 ~BaseApplicationFetcher() override; | |
22 | |
23 private: | |
24 // Overridden from shell::ApplicationFetcher: | |
25 void SetApplicationManager(shell::ApplicationManager* manager) override; | |
26 GURL ResolveURL(const GURL& url) override; | |
27 void FetchRequest( | |
28 URLRequestPtr request, | |
29 const shell::Fetcher::FetchCallback& loader_callback) override; | |
30 | |
31 shell::ApplicationManager* application_manager_; | |
32 scoped_ptr<URLResolver> url_resolver_; | |
33 const bool disable_cache_; | |
34 NetworkServicePtr network_service_; | |
35 URLLoaderFactoryPtr url_loader_factory_; | |
36 | |
37 DISALLOW_COPY_AND_ASSIGN(BaseApplicationFetcher); | |
38 }; | |
39 | |
40 } // namespace fetcher | |
41 } // namespace mojo | |
OLD | NEW |