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

Side by Side Diff: content/browser/renderer_host/intercept_navigation_resource_throttle_impl.h

Issue 10310124: Implement a ResourceThrottle for URL overriding in Chrome on Android. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: fixed chromeos build issue + rebase Created 8 years, 6 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 (c) 2012 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 CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMP L_H_
6 #define CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_IMP L_H_
7 #pragma once
8
9 #include <string>
10
11 #include "base/memory/weak_ptr.h"
12 #include "content/public/browser/intercept_navigation_resource_throttle.h"
13
14 namespace net {
15 class URLRequest;
16 } // namespace net
17
18 // This class allows the embedder (via WebContentsDelegate) to selectively
19 // ignore top level navigations.
20 class InterceptNavigationResourceThrottleImpl
21 : public content::InterceptNavigationResourceThrottle {
22 public:
23 explicit InterceptNavigationResourceThrottleImpl(net::URLRequest* request);
24 virtual ~InterceptNavigationResourceThrottleImpl();
25
26 // content::ResourceThrottle implementation:
27 virtual void WillStartRequest(bool* defer) OVERRIDE;
28 virtual void WillRedirectRequest(const GURL& new_url, bool* defer) OVERRIDE;
29
30 private:
31 bool ShouldDeferRequestForURL(const GURL& url);
32 void OnResultObtained(bool should_ignore_navigation);
33
34 net::URLRequest* request_;
35 base::WeakPtrFactory<InterceptNavigationResourceThrottleImpl>
36 weak_ptr_factory_;
37
38 DISALLOW_COPY_AND_ASSIGN(InterceptNavigationResourceThrottleImpl);
39 };
40
41 #endif // CONTENT_BROWSER_RENDERER_HOST_INTERCEPT_NAVIGATION_RESOURCE_THROTTLE_ IMPL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698