Dismiss autofill popup on screen orientation change.
[chromium-blink-merge.git] / webkit / browser / appcache / appcache_executable_handler.h
blob43ee0a39e2d8291e06b0aa9c60b543b7e4c98d08
1 // Copyright (c) 2013 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.
5 #ifndef WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_
6 #define WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_
8 #include "base/callback.h"
9 #include "base/memory/scoped_ptr.h"
10 #include "url/gurl.h"
11 #include "webkit/browser/webkit_storage_browser_export.h"
13 namespace net {
14 class IOBuffer;
15 class URLRequest;
18 namespace appcache {
20 // An interface that must be provided by the embedder to support this feature.
21 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandler {
22 public:
23 // A handler can respond in one of 4 ways, if each of the GURL fields
24 // in 'Response' are empty and use_network is false, an error response is
25 // synthesized.
26 struct Response {
27 GURL cached_resource_url;
28 GURL redirect_url;
29 bool use_network;
30 // TODO: blob + headers would be a good one to provide as well, as it would
31 // make templating possible.
33 typedef base::Callback<void(const Response&)> ResponseCallback;
35 // Deletion of the handler cancels all pending callbacks.
36 virtual ~AppCacheExecutableHandler() {}
38 virtual void HandleRequest(net::URLRequest* req,
39 ResponseCallback callback) = 0;
42 // A factory to produce instances.
43 class WEBKIT_STORAGE_BROWSER_EXPORT AppCacheExecutableHandlerFactory {
44 public:
45 virtual scoped_ptr<AppCacheExecutableHandler> CreateHandler(
46 const GURL& handler_url, net::IOBuffer* handler_source) = 0;
48 protected:
49 virtual ~AppCacheExecutableHandlerFactory() {}
52 } // namespace appcache
54 #endif // WEBKIT_BROWSER_APPCACHE_APPCACHE_EXECUTABLE_HANDLER_H_