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

Side by Side Diff: chrome/browser/chromeos/attestation/platform_verification_dialog.cc

Issue 319013002: Reland Fix Views web-modal dialog widget creation. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Revert MediaGalleriesScanResultDialogViews::AcceptDialogForTesting. 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
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc » ('j') | 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 "chrome/browser/chromeos/attestation/platform_verification_dialog.h" 5 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after
46 const extensions::Extension* extension = 46 const extensions::Extension* extension =
47 extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())-> 47 extensions::ExtensionRegistry::Get(web_contents->GetBrowserContext())->
48 enabled_extensions().GetExtensionOrAppByURL(url); 48 enabled_extensions().GetExtensionOrAppByURL(url);
49 std::string origin = extension ? extension->name() : url.GetOrigin().spec(); 49 std::string origin = extension ? extension->name() : url.GetOrigin().spec();
50 50
51 PlatformVerificationDialog* dialog = new PlatformVerificationDialog( 51 PlatformVerificationDialog* dialog = new PlatformVerificationDialog(
52 web_contents, 52 web_contents,
53 base::UTF8ToUTF16(origin), 53 base::UTF8ToUTF16(origin),
54 callback); 54 callback);
55 55
56 // Sets up the dialog widget and shows it. 56 web_modal::WebContentsModalDialogManager* manager =
57 web_modal::WebContentsModalDialogManager* web_contents_modal_dialog_manager =
58 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents); 57 web_modal::WebContentsModalDialogManager::FromWebContents(web_contents);
59 web_modal::WebContentsModalDialogManagerDelegate* modal_delegate = 58 const gfx::NativeWindow parent =
60 web_contents_modal_dialog_manager->delegate(); 59 manager->delegate()->GetWebContentsModalDialogHost()->GetHostView();
61 views::Widget* widget = views::Widget::CreateWindowAsFramelessChild( 60 views::Widget* widget = CreateDialogWidget(dialog, NULL, parent);
62 dialog, modal_delegate->GetWebContentsModalDialogHost()->GetHostView()); 61 manager->ShowModalDialog(widget->GetNativeView());
63 web_contents_modal_dialog_manager->ShowModalDialog(
64 widget->GetNativeView());
65 widget->Show(); 62 widget->Show();
66 } 63 }
67 64
68 PlatformVerificationDialog::~PlatformVerificationDialog() { 65 PlatformVerificationDialog::~PlatformVerificationDialog() {
69 } 66 }
70 67
71 PlatformVerificationDialog::PlatformVerificationDialog( 68 PlatformVerificationDialog::PlatformVerificationDialog(
72 content::WebContents* web_contents, 69 content::WebContents* web_contents,
73 const base::string16& domain, 70 const base::string16& domain,
74 const PlatformVerificationFlow::Delegate::ConsentCallback& callback) 71 const PlatformVerificationFlow::Delegate::ConsentCallback& callback)
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
143 profile, learn_more_url, content::PAGE_TRANSITION_LINK); 140 profile, learn_more_url, content::PAGE_TRANSITION_LINK);
144 params.disposition = SINGLETON_TAB; 141 params.disposition = SINGLETON_TAB;
145 chrome::Navigate(&params); 142 chrome::Navigate(&params);
146 } else { 143 } else {
147 chrome::ShowSingletonTab(browser, learn_more_url); 144 chrome::ShowSingletonTab(browser, learn_more_url);
148 } 145 }
149 } 146 }
150 147
151 } // namespace attestation 148 } // namespace attestation
152 } // namespace chromeos 149 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chromeos/login/ui/captive_portal_window_proxy.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698