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

Side by Side Diff: content/browser/browser_url_handler_impl.h

Issue 667943003: Standardize usage of virtual/override/final in content/browser/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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 | « content/browser/browser_thread_impl.cc ('k') | content/browser/byte_stream.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 (c) 2012 The Chromium Authors. All rights reserved. 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 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 CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_ 5 #ifndef CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_
6 #define CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_ 6 #define CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_
7 7
8 #include <vector> 8 #include <vector>
9 #include <utility> 9 #include <utility>
10 10
11 #include "base/gtest_prod_util.h" 11 #include "base/gtest_prod_util.h"
12 #include "base/memory/singleton.h" 12 #include "base/memory/singleton.h"
13 #include "content/public/browser/browser_url_handler.h" 13 #include "content/public/browser/browser_url_handler.h"
14 14
15 class GURL; 15 class GURL;
16 16
17 namespace content { 17 namespace content {
18 class BrowserContext; 18 class BrowserContext;
19 19
20 class CONTENT_EXPORT BrowserURLHandlerImpl : public BrowserURLHandler { 20 class CONTENT_EXPORT BrowserURLHandlerImpl : public BrowserURLHandler {
21 public: 21 public:
22 // Returns the singleton instance. 22 // Returns the singleton instance.
23 static BrowserURLHandlerImpl* GetInstance(); 23 static BrowserURLHandlerImpl* GetInstance();
24 24
25 // BrowserURLHandler implementation: 25 // BrowserURLHandler implementation:
26 virtual void RewriteURLIfNecessary(GURL* url, 26 void RewriteURLIfNecessary(GURL* url,
27 BrowserContext* browser_context, 27 BrowserContext* browser_context,
28 bool* reverse_on_redirect) override; 28 bool* reverse_on_redirect) override;
29 // Add the specified handler pair to the list of URL handlers. 29 // Add the specified handler pair to the list of URL handlers.
30 virtual void AddHandlerPair(URLHandler handler, 30 void AddHandlerPair(URLHandler handler, URLHandler reverse_handler) override;
31 URLHandler reverse_handler) override;
32 31
33 // Reverses the rewriting that was done for |original| using the new |url|. 32 // Reverses the rewriting that was done for |original| using the new |url|.
34 bool ReverseURLRewrite(GURL* url, const GURL& original, 33 bool ReverseURLRewrite(GURL* url, const GURL& original,
35 BrowserContext* browser_context); 34 BrowserContext* browser_context);
36 35
37 private: 36 private:
38 // This object is a singleton: 37 // This object is a singleton:
39 BrowserURLHandlerImpl(); 38 BrowserURLHandlerImpl();
40 virtual ~BrowserURLHandlerImpl(); 39 ~BrowserURLHandlerImpl() override;
41 friend struct DefaultSingletonTraits<BrowserURLHandlerImpl>; 40 friend struct DefaultSingletonTraits<BrowserURLHandlerImpl>;
42 41
43 // The list of known URLHandlers, optionally with reverse-rewriters. 42 // The list of known URLHandlers, optionally with reverse-rewriters.
44 typedef std::pair<URLHandler, URLHandler> HandlerPair; 43 typedef std::pair<URLHandler, URLHandler> HandlerPair;
45 std::vector<HandlerPair> url_handlers_; 44 std::vector<HandlerPair> url_handlers_;
46 45
47 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, BasicRewriteAndReverse); 46 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, BasicRewriteAndReverse);
48 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, NullHandlerReverse); 47 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, NullHandlerReverse);
49 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, ViewSourceReverse); 48 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, ViewSourceReverse);
50 49
51 DISALLOW_COPY_AND_ASSIGN(BrowserURLHandlerImpl); 50 DISALLOW_COPY_AND_ASSIGN(BrowserURLHandlerImpl);
52 }; 51 };
53 52
54 } // namespace content 53 } // namespace content
55 54
56 #endif // CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_ 55 #endif // CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_
OLDNEW
« no previous file with comments | « content/browser/browser_thread_impl.cc ('k') | content/browser/byte_stream.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698