| OLD | NEW |
| 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 |
| (...skipping 23 matching lines...) Expand all Loading... |
| 34 void FixupURLBeforeRewrite(GURL* url, BrowserContext* browser_context); | 34 void FixupURLBeforeRewrite(GURL* url, BrowserContext* browser_context); |
| 35 | 35 |
| 36 // Reverses the rewriting that was done for |original| using the new |url|. | 36 // Reverses the rewriting that was done for |original| using the new |url|. |
| 37 bool ReverseURLRewrite(GURL* url, const GURL& original, | 37 bool ReverseURLRewrite(GURL* url, const GURL& original, |
| 38 BrowserContext* browser_context); | 38 BrowserContext* browser_context); |
| 39 | 39 |
| 40 private: | 40 private: |
| 41 // This object is a singleton: | 41 // This object is a singleton: |
| 42 BrowserURLHandlerImpl(); | 42 BrowserURLHandlerImpl(); |
| 43 ~BrowserURLHandlerImpl() override; | 43 ~BrowserURLHandlerImpl() override; |
| 44 friend struct DefaultSingletonTraits<BrowserURLHandlerImpl>; | 44 friend struct base::DefaultSingletonTraits<BrowserURLHandlerImpl>; |
| 45 | 45 |
| 46 // A URLHandler to run in a preliminary phase, before rewriting is done. | 46 // A URLHandler to run in a preliminary phase, before rewriting is done. |
| 47 URLHandler fixup_handler_; | 47 URLHandler fixup_handler_; |
| 48 | 48 |
| 49 // The list of known URLHandlers, optionally with reverse-rewriters. | 49 // The list of known URLHandlers, optionally with reverse-rewriters. |
| 50 typedef std::pair<URLHandler, URLHandler> HandlerPair; | 50 typedef std::pair<URLHandler, URLHandler> HandlerPair; |
| 51 std::vector<HandlerPair> url_handlers_; | 51 std::vector<HandlerPair> url_handlers_; |
| 52 | 52 |
| 53 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, BasicRewriteAndReverse); | 53 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, BasicRewriteAndReverse); |
| 54 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, NullHandlerReverse); | 54 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, NullHandlerReverse); |
| 55 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, ViewSourceReverse); | 55 FRIEND_TEST_ALL_PREFIXES(BrowserURLHandlerImplTest, ViewSourceReverse); |
| 56 | 56 |
| 57 DISALLOW_COPY_AND_ASSIGN(BrowserURLHandlerImpl); | 57 DISALLOW_COPY_AND_ASSIGN(BrowserURLHandlerImpl); |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 } // namespace content | 60 } // namespace content |
| 61 | 61 |
| 62 #endif // CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_ | 62 #endif // CONTENT_BROWSER_BROWSER_URL_HANDLER_IMPL_H_ |
| OLD | NEW |