OLD | NEW |
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 #include "chrome/browser/download/download_permission_request.h" | 5 #include "chrome/browser/download/download_permission_request.h" |
6 | 6 |
| 7 #include "chrome/app/vector_icons/vector_icons.h" |
7 #include "chrome/grit/generated_resources.h" | 8 #include "chrome/grit/generated_resources.h" |
8 #include "content/public/browser/web_contents.h" | 9 #include "content/public/browser/web_contents.h" |
9 #include "ui/base/l10n/l10n_util.h" | 10 #include "ui/base/l10n/l10n_util.h" |
10 #include "ui/gfx/vector_icons_public.h" | |
11 | 11 |
12 DownloadPermissionRequest::DownloadPermissionRequest( | 12 DownloadPermissionRequest::DownloadPermissionRequest( |
13 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host) | 13 base::WeakPtr<DownloadRequestLimiter::TabDownloadState> host) |
14 : host_(host) { | 14 : host_(host) { |
15 const content::WebContents* web_contents = host_->web_contents(); | 15 const content::WebContents* web_contents = host_->web_contents(); |
16 DCHECK(web_contents); | 16 DCHECK(web_contents); |
17 request_origin_ = web_contents->GetURL().GetOrigin(); | 17 request_origin_ = web_contents->GetURL().GetOrigin(); |
18 } | 18 } |
19 | 19 |
20 DownloadPermissionRequest::~DownloadPermissionRequest() {} | 20 DownloadPermissionRequest::~DownloadPermissionRequest() {} |
21 | 21 |
22 PermissionRequest::IconId DownloadPermissionRequest::GetIconId() const { | 22 PermissionRequest::IconId DownloadPermissionRequest::GetIconId() const { |
23 return gfx::VectorIconId::FILE_DOWNLOAD; | 23 return kFileDownloadIcon; |
24 } | 24 } |
25 | 25 |
26 base::string16 DownloadPermissionRequest::GetMessageTextFragment() const { | 26 base::string16 DownloadPermissionRequest::GetMessageTextFragment() const { |
27 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_PERMISSION_FRAGMENT); | 27 return l10n_util::GetStringUTF16(IDS_MULTI_DOWNLOAD_PERMISSION_FRAGMENT); |
28 } | 28 } |
29 | 29 |
30 GURL DownloadPermissionRequest::GetOrigin() const { | 30 GURL DownloadPermissionRequest::GetOrigin() const { |
31 return request_origin_; | 31 return request_origin_; |
32 } | 32 } |
33 | 33 |
(...skipping 19 matching lines...) Expand all Loading... |
53 } | 53 } |
54 | 54 |
55 void DownloadPermissionRequest::RequestFinished() { | 55 void DownloadPermissionRequest::RequestFinished() { |
56 delete this; | 56 delete this; |
57 } | 57 } |
58 | 58 |
59 PermissionRequestType DownloadPermissionRequest::GetPermissionRequestType() | 59 PermissionRequestType DownloadPermissionRequest::GetPermissionRequestType() |
60 const { | 60 const { |
61 return PermissionRequestType::DOWNLOAD; | 61 return PermissionRequestType::DOWNLOAD; |
62 } | 62 } |
OLD | NEW |