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

Side by Side Diff: chrome/browser/ui/views/download/download_danger_prompt_views.cc

Issue 114003005: Add Download.ShowDangerousDownloadConfirmationPrompt for Windows/CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Typo Created 6 years, 11 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "base/compiler_specific.h" 5 #include "base/compiler_specific.h"
6 #include "chrome/browser/download/download_danger_prompt.h" 6 #include "chrome/browser/download/download_danger_prompt.h"
7 #include "chrome/browser/download/download_stats.h"
7 #include "chrome/browser/ui/views/constrained_window_views.h" 8 #include "chrome/browser/ui/views/constrained_window_views.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 9 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 11 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
11 #include "content/public/browser/browser_thread.h" 12 #include "content/public/browser/browser_thread.h"
12 #include "content/public/browser/download_danger_type.h" 13 #include "content/public/browser/download_danger_type.h"
13 #include "content/public/browser/download_item.h" 14 #include "content/public/browser/download_item.h"
14 #include "content/public/browser/web_contents.h" 15 #include "content/public/browser/web_contents.h"
15 #include "grit/chromium_strings.h" 16 #include "grit/chromium_strings.h"
16 #include "grit/generated_resources.h" 17 #include "grit/generated_resources.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
123 layout->AddPaddingRow(0, kParagraphPadding); 124 layout->AddPaddingRow(0, kParagraphPadding);
124 } 125 }
125 126
126 views::Label* message_body_label = new views::Label(GetMessageBody()); 127 views::Label* message_body_label = new views::Label(GetMessageBody());
127 message_body_label->SetMultiLine(true); 128 message_body_label->SetMultiLine(true);
128 message_body_label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 129 message_body_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
129 message_body_label->SetAllowCharacterBreak(true); 130 message_body_label->SetAllowCharacterBreak(true);
130 131
131 layout->StartRow(0, 0); 132 layout->StartRow(0, 0);
132 layout->AddView(message_body_label); 133 layout->AddView(message_body_label);
134
135 RecordOpenedDangerousConfirmDialog(download_->GetDangerType());
133 } 136 }
134 137
135 // DownloadDangerPrompt methods: 138 // DownloadDangerPrompt methods:
136 void DownloadDangerPromptViews::InvokeActionForTesting(Action action) { 139 void DownloadDangerPromptViews::InvokeActionForTesting(Action action) {
137 switch (action) { 140 switch (action) {
138 case ACCEPT: 141 case ACCEPT:
139 Accept(); 142 Accept();
140 break; 143 break;
141 144
142 case CANCEL: 145 case CANCEL:
(...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 WebContentsModalDialogManagerDelegate* modal_delegate = 369 WebContentsModalDialogManagerDelegate* modal_delegate =
367 web_contents_modal_dialog_manager->delegate(); 370 web_contents_modal_dialog_manager->delegate();
368 CHECK(modal_delegate); 371 CHECK(modal_delegate);
369 views::Widget* dialog = views::Widget::CreateWindowAsFramelessChild( 372 views::Widget* dialog = views::Widget::CreateWindowAsFramelessChild(
370 download_danger_prompt, 373 download_danger_prompt,
371 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); 374 modal_delegate->GetWebContentsModalDialogHost()->GetHostView());
372 web_contents_modal_dialog_manager->ShowDialog(dialog->GetNativeView()); 375 web_contents_modal_dialog_manager->ShowDialog(dialog->GetNativeView());
373 376
374 return download_danger_prompt; 377 return download_danger_prompt;
375 } 378 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698