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

Side by Side Diff: chrome/browser/download/download_permission_request.h

Issue 176053002: [WebsiteSettings] Change permission bubble API to adapt to new mocks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: try 2 Created 6 years, 9 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
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_ 5 #ifndef CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_
6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_ 6 #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_
7 7
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/download/download_request_limiter.h" 10 #include "chrome/browser/download/download_request_limiter.h"
11 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 11 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
12 12
13 // A permission bubble request that presents the user with a choice to allow 13 // A permission bubble request that presents the user with a choice to allow
14 // or deny multiple downloads from the same site. This confirmation step 14 // or deny multiple downloads from the same site. This confirmation step
15 // protects against "carpet-bombing", where a malicious site forces multiple 15 // protects against "carpet-bombing", where a malicious site forces multiple
16 // downloads on an unsuspecting user. 16 // downloads on an unsuspecting user.
17 class DownloadPermissionRequest : public PermissionBubbleRequest { 17 class DownloadPermissionRequest : public PermissionBubbleRequest {
18 public: 18 public:
19 explicit DownloadPermissionRequest( 19 explicit DownloadPermissionRequest(
20 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host); 20 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host);
21 virtual ~DownloadPermissionRequest(); 21 virtual ~DownloadPermissionRequest();
22 22
23 // PermisisonBubbleDelegate: 23 // PermisisonBubbleDelegate:
24 virtual int GetIconID() const OVERRIDE;
24 virtual base::string16 GetMessageText() const OVERRIDE; 25 virtual base::string16 GetMessageText() const OVERRIDE;
25 virtual base::string16 GetMessageTextFragment() const OVERRIDE; 26 virtual base::string16 GetMessageTextFragment() const OVERRIDE;
26 virtual base::string16 GetAlternateAcceptButtonText() const OVERRIDE; 27 virtual bool HasUserGesture() const OVERRIDE;
27 virtual base::string16 GetAlternateDenyButtonText() const OVERRIDE; 28 virtual GURL GetRequestingHostname() const OVERRIDE;
28 virtual void PermissionGranted() OVERRIDE; 29 virtual void PermissionGranted() OVERRIDE;
29 virtual void PermissionDenied() OVERRIDE; 30 virtual void PermissionDenied() OVERRIDE;
30 virtual void Cancelled() OVERRIDE; 31 virtual void Cancelled() OVERRIDE;
31 virtual void RequestFinished() OVERRIDE; 32 virtual void RequestFinished() OVERRIDE;
32 33
33 private: 34 private:
34 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host_; 35 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host_;
35 36
36 DISALLOW_COPY_AND_ASSIGN(DownloadPermissionRequest); 37 DISALLOW_COPY_AND_ASSIGN(DownloadPermissionRequest);
37 }; 38 };
38 39
39 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_ 40 #endif // CHROME_BROWSER_DOWNLOAD_DOWNLOAD_PERMISSION_REQUEST_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698