| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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_danger_prompt.h" | 5 #include "chrome/browser/download/download_danger_prompt.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/browser/chrome_notification_types.h" | 9 #include "chrome/browser/chrome_notification_types.h" |
| 10 #include "chrome/browser/download/chrome_download_manager_delegate.h" | 10 #include "chrome/browser/download/chrome_download_manager_delegate.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 31 public content::DownloadItem::Observer, | 31 public content::DownloadItem::Observer, |
| 32 public TabModalConfirmDialogDelegate { | 32 public TabModalConfirmDialogDelegate { |
| 33 public: | 33 public: |
| 34 DownloadDangerPromptImpl(content::DownloadItem* item, | 34 DownloadDangerPromptImpl(content::DownloadItem* item, |
| 35 content::WebContents* web_contents, | 35 content::WebContents* web_contents, |
| 36 bool show_context, | 36 bool show_context, |
| 37 const OnDone& done); | 37 const OnDone& done); |
| 38 virtual ~DownloadDangerPromptImpl(); | 38 virtual ~DownloadDangerPromptImpl(); |
| 39 | 39 |
| 40 // DownloadDangerPrompt: | 40 // DownloadDangerPrompt: |
| 41 virtual void InvokeActionForTesting(Action action) OVERRIDE; | 41 virtual void InvokeActionForTesting(Action action) override; |
| 42 | 42 |
| 43 private: | 43 private: |
| 44 // content::DownloadItem::Observer: | 44 // content::DownloadItem::Observer: |
| 45 virtual void OnDownloadUpdated(content::DownloadItem* download) OVERRIDE; | 45 virtual void OnDownloadUpdated(content::DownloadItem* download) override; |
| 46 | 46 |
| 47 // TabModalConfirmDialogDelegate: | 47 // TabModalConfirmDialogDelegate: |
| 48 virtual base::string16 GetTitle() OVERRIDE; | 48 virtual base::string16 GetTitle() override; |
| 49 virtual base::string16 GetDialogMessage() OVERRIDE; | 49 virtual base::string16 GetDialogMessage() override; |
| 50 virtual base::string16 GetAcceptButtonTitle() OVERRIDE; | 50 virtual base::string16 GetAcceptButtonTitle() override; |
| 51 virtual base::string16 GetCancelButtonTitle() OVERRIDE; | 51 virtual base::string16 GetCancelButtonTitle() override; |
| 52 virtual void OnAccepted() OVERRIDE; | 52 virtual void OnAccepted() override; |
| 53 virtual void OnCanceled() OVERRIDE; | 53 virtual void OnCanceled() override; |
| 54 virtual void OnClosed() OVERRIDE; | 54 virtual void OnClosed() override; |
| 55 | 55 |
| 56 void RunDone(Action action); | 56 void RunDone(Action action); |
| 57 | 57 |
| 58 content::DownloadItem* download_; | 58 content::DownloadItem* download_; |
| 59 bool show_context_; | 59 bool show_context_; |
| 60 OnDone done_; | 60 OnDone done_; |
| 61 | 61 |
| 62 scoped_ptr<ExperienceSamplingEvent> sampling_event_; | 62 scoped_ptr<ExperienceSamplingEvent> sampling_event_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(DownloadDangerPromptImpl); | 64 DISALLOW_COPY_AND_ASSIGN(DownloadDangerPromptImpl); |
| (...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 content::WebContents* web_contents, | 256 content::WebContents* web_contents, |
| 257 bool show_context, | 257 bool show_context, |
| 258 const OnDone& done) { | 258 const OnDone& done) { |
| 259 DownloadDangerPromptImpl* prompt = new DownloadDangerPromptImpl( | 259 DownloadDangerPromptImpl* prompt = new DownloadDangerPromptImpl( |
| 260 item, web_contents, show_context, done); | 260 item, web_contents, show_context, done); |
| 261 // |prompt| will be deleted when the dialog is done. | 261 // |prompt| will be deleted when the dialog is done. |
| 262 TabModalConfirmDialog::Create(prompt, web_contents); | 262 TabModalConfirmDialog::Create(prompt, web_contents); |
| 263 return prompt; | 263 return prompt; |
| 264 } | 264 } |
| 265 #endif | 265 #endif |
| OLD | NEW |