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

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

Issue 287123002: [WebModals] New API for browser-scoped popup management. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Make PopupManager a thin API for WCMDM Created 6 years, 6 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 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/download/download_stats.h"
8 #include "components/web_modal/web_contents_modal_dialog_host.h" 8 #include "components/web_modal/web_contents_modal_dialog_host.h"
9 #include "components/web_modal/web_contents_modal_dialog_manager.h" 9 #include "components/web_modal/web_contents_modal_dialog_manager.h"
10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h" 10 #include "components/web_modal/web_contents_modal_dialog_manager_delegate.h"
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 } // namespace 342 } // namespace
343 343
344 DownloadDangerPrompt* DownloadDangerPrompt::Create( 344 DownloadDangerPrompt* DownloadDangerPrompt::Create(
345 content::DownloadItem* item, 345 content::DownloadItem* item,
346 content::WebContents* web_contents, 346 content::WebContents* web_contents,
347 bool show_context, 347 bool show_context,
348 const OnDone& done) { 348 const OnDone& done) {
349 DownloadDangerPromptViews* download_danger_prompt = 349 DownloadDangerPromptViews* download_danger_prompt =
350 new DownloadDangerPromptViews(item, web_contents, show_context, done); 350 new DownloadDangerPromptViews(item, web_contents, show_context, done);
351 351
352 // TODO(gbillock): Use PopupManager here.
352 WebContentsModalDialogManager* web_contents_modal_dialog_manager = 353 WebContentsModalDialogManager* web_contents_modal_dialog_manager =
353 WebContentsModalDialogManager::FromWebContents(web_contents); 354 WebContentsModalDialogManager::FromWebContents(web_contents);
354 WebContentsModalDialogManagerDelegate* modal_delegate = 355 WebContentsModalDialogManagerDelegate* modal_delegate =
355 web_contents_modal_dialog_manager->delegate(); 356 web_contents_modal_dialog_manager->delegate();
356 CHECK(modal_delegate); 357 CHECK(modal_delegate);
357 views::Widget* dialog = views::Widget::CreateWindowAsFramelessChild( 358 views::Widget* dialog = views::Widget::CreateWindowAsFramelessChild(
358 download_danger_prompt, 359 download_danger_prompt,
359 modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); 360 modal_delegate->GetWebContentsModalDialogHost()->GetHostView());
360 web_contents_modal_dialog_manager->ShowModalDialog( 361 web_contents_modal_dialog_manager->ShowModalDialog(
361 dialog->GetNativeView()); 362 dialog->GetNativeView());
362 363
363 return download_danger_prompt; 364 return download_danger_prompt;
364 } 365 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698