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

Side by Side Diff: chrome/browser/renderer_host/database_permission_request.h

Issue 3299020: Remove vestigial cookie/web app permissions prompting UI now that the async U... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 3 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 | Annotate | Revision Log
OLDNEW
(Empty)
1 // Copyright (c) 2010 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_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_
6 #define CHROME_BROWSER_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_
7 #pragma once
8
9 #include "base/ref_counted.h"
10 #include "base/scoped_ptr.h"
11 #include "base/string16.h"
12 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h"
13 #include "chrome/common/content_settings.h"
14 #include "googleurl/src/gurl.h"
15
16 class HostContentSettingsMap;
17 class Task;
18
19 // This class is fully threadsafe.
20 class DatabasePermissionRequest
21 : public base::RefCountedThreadSafe<DatabasePermissionRequest>,
22 public CookiePromptModalDialogDelegate {
23 public:
24 DatabasePermissionRequest(const GURL& url,
25 const string16& database_name,
26 const string16& display_name,
27 unsigned long estimated_size,
28 Task* on_allow,
29 Task* on_block,
30 HostContentSettingsMap* settings_map);
31 ~DatabasePermissionRequest();
32
33 const GURL& url() const { return url_; }
34 const string16& database_name() const { return database_name_; }
35 const string16& display_name() const { return display_name_; }
36 unsigned long estimated_size() const { return estimated_size_; }
37
38 // Start the permission request process.
39 void RequestPermission();
40
41 // CookiesPromptViewDelegate methods:
42 virtual void AllowSiteData(bool session_expire);
43 virtual void BlockSiteData();
44
45 private:
46 void SendResponse(ContentSetting content_setting);
47
48 // The URL to get permission for.
49 const GURL url_;
50 const string16 database_name_;
51 const string16 display_name_;
52 unsigned long estimated_size_;
53
54 // Set on IO, possibly release()ed on UI, destroyed on IO or UI.
55 scoped_ptr<Task> on_allow_;
56 scoped_ptr<Task> on_block_;
57
58 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
59
60 // Released once we have our answer.
61 scoped_refptr<DatabasePermissionRequest> self_ref_;
62
63 DISALLOW_IMPLICIT_CONSTRUCTORS(DatabasePermissionRequest);
64 };
65
66 #endif // CHROME_BROWSER_RENDERER_HOST_DATABASE_PERMISSION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698