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

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

Issue 1352663002: Extract some stuff into PackageManager (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: . Created 5 years, 3 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
OLDNEW
(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 #ifndef MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
6 #define MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
7
8 #include "mojo/shell/package_manager.h"
9
10 class GURL;
11
12 namespace mojo {
13 namespace shell {
14
15 // An implementation of PackageManager used by tests to support content handler
16 // registration for MIME types.
17 class TestPackageManager : public PackageManager {
18 public:
19 TestPackageManager();
20 virtual ~TestPackageManager();
21
22 void RegisterContentHandler(const std::string& mime_type,
23 const GURL& content_handler_url);
24
25 private:
26 using MimeTypeToURLMap = std::map<std::string, GURL>;
yzshen1 2015/09/16 23:47:20 nit: please add includes for std:: types.
27
28 // Overridden from PackageManager:
29 void SetApplicationManager(ApplicationManager* manager) override;
30 GURL ResolveURL(const GURL& url) override;
31 void FetchRequest(
32 URLRequestPtr request,
33 const Fetcher::FetchCallback& loader_callback) override;
34 bool HandleWithContentHandler(Fetcher* fetcher,
35 const GURL& unresolved_url,
36 base::TaskRunner* task_runner,
37 URLResponsePtr* new_response,
38 GURL* content_handler_url,
39 std::string* qualifier) override;
40
41 MimeTypeToURLMap mime_type_to_url_;
42
43 DISALLOW_COPY_AND_ASSIGN(TestPackageManager);
44 };
45
46 } // namespace shell
47 } // namespace mojo
48
49 #endif // MOJO_SHELL_TEST_PACKAGE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698