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 #ifndef CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_H_ | |
6 #define CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_H_ | |
7 | |
8 #include "base/memory/weak_ptr.h" | |
9 #include "net/url_request/url_request_interceptor.h" | |
10 #include "url/gurl.h" | |
11 | |
12 class NewTabPageInterceptor : public net::URLRequestInterceptor { | |
13 public: | |
14 // Constructs the interceptor. | |
15 explicit NewTabPageInterceptor(const GURL& new_tab_url); | |
16 | |
17 // Destroys the interceptor. | |
mmenke
2015/01/15 22:35:30
nit: Don't think these two comments add anything.
Mathieu
2015/01/22 19:21:58
Done.
| |
18 ~NewTabPageInterceptor() override; | |
19 | |
20 base::WeakPtr<NewTabPageInterceptor> GetWeakPtr(); | |
mmenke
2015/01/15 22:35:30
Making globally accessible weak pointers is strong
Mathieu
2015/01/22 19:21:58
Let me know if that is what you had in mind.
| |
21 | |
22 void SetNewTabPageURL(const GURL& new_tab_page_url); | |
23 | |
24 private: | |
25 // Overrides from net::URLRequestInterceptor: | |
26 net::URLRequestJob* MaybeInterceptRequest( | |
27 net::URLRequest* request, | |
28 net::NetworkDelegate* network_delegate) const override; | |
29 net::URLRequestJob* MaybeInterceptResponse( | |
30 net::URLRequest* request, | |
31 net::NetworkDelegate* network_delegate) const override; | |
32 | |
33 GURL new_tab_url_; | |
34 base::WeakPtrFactory<NewTabPageInterceptor> weak_factory_; | |
35 | |
36 DISALLOW_COPY_AND_ASSIGN(NewTabPageInterceptor); | |
mmenke
2015/01/15 22:35:30
Should include base/macros.h for DISALLOW_COPY_AND
Mathieu
2015/01/22 19:21:58
Done.
| |
37 }; | |
38 | |
39 #endif // CHROME_BROWSER_UI_SEARCH_NEW_TAB_PAGE_INTERCEPTOR_H_ | |
OLD | NEW |