Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(102)

Side by Side Diff: mojo/shell/test_package_manager.h

Issue 1358533004: Move more of ContentHandler handling into PackageManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « mojo/shell/package_manager.h ('k') | mojo/shell/test_package_manager.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 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 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 4
5 #ifndef MOJO_SHELL_TEST_PACKAGE_MANAGER_H_ 5 #ifndef MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
6 #define MOJO_SHELL_TEST_PACKAGE_MANAGER_H_ 6 #define MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
7 7
8 #include <map>
9 #include <string>
10
11 #include "mojo/shell/package_manager.h" 8 #include "mojo/shell/package_manager.h"
12 9
13 class GURL;
14
15 namespace mojo { 10 namespace mojo {
16 namespace shell { 11 namespace shell {
12 namespace test {
17 13
18 // An implementation of PackageManager used by tests to support content handler
19 // registration for MIME types.
20 class TestPackageManager : public PackageManager { 14 class TestPackageManager : public PackageManager {
21 public: 15 public:
22 TestPackageManager(); 16 TestPackageManager();
23 ~TestPackageManager() override; 17 ~TestPackageManager() override;
24 18
25 void RegisterContentHandler(const std::string& mime_type,
26 const GURL& content_handler_url);
27
28 private: 19 private:
29 using MimeTypeToURLMap = std::map<std::string, GURL>;
30
31 // Overridden from PackageManager: 20 // Overridden from PackageManager:
32 void SetApplicationManager(ApplicationManager* manager) override; 21 void SetApplicationManager(ApplicationManager* manager) override;
33 void FetchRequest( 22 void FetchRequest(
34 URLRequestPtr request, 23 URLRequestPtr request,
35 const Fetcher::FetchCallback& loader_callback) override; 24 const Fetcher::FetchCallback& loader_callback) override;
36 bool HandleWithContentHandler(Fetcher* fetcher, 25 uint32_t HandleWithContentHandler(
37 const GURL& url, 26 Fetcher* fetcher,
38 base::TaskRunner* task_runner, 27 const Identity& source,
39 URLResponsePtr* new_response, 28 const GURL& target_url,
40 GURL* content_handler_url, 29 const CapabilityFilter& target_filter,
41 std::string* qualifier) override; 30 InterfaceRequest<Application>* application_request) override;
42
43 MimeTypeToURLMap mime_type_to_url_;
44 31
45 DISALLOW_COPY_AND_ASSIGN(TestPackageManager); 32 DISALLOW_COPY_AND_ASSIGN(TestPackageManager);
46 }; 33 };
47 34
35 } // namespace test
48 } // namespace shell 36 } // namespace shell
49 } // namespace mojo 37 } // namespace mojo
50 38
51 #endif // MOJO_SHELL_TEST_PACKAGE_MANAGER_H_ 39 #endif // MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
OLDNEW
« no previous file with comments | « mojo/shell/package_manager.h ('k') | mojo/shell/test_package_manager.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698