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

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

Issue 2640633002: Convert PlatformVerificationDialog to use the new navigation callbacks. (Closed)
Patch Set: closer to original Created 3 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 | « chrome/browser/chromeos/attestation/platform_verification_dialog.h ('k') | 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 "chrome/browser/chromeos/attestation/platform_verification_dialog.h" 5 #include "chrome/browser/chromeos/attestation/platform_verification_dialog.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser_finder.h" 11 #include "chrome/browser/ui/browser_finder.h"
12 #include "chrome/browser/ui/browser_navigator.h" 12 #include "chrome/browser/ui/browser_navigator.h"
13 #include "chrome/browser/ui/browser_window.h" 13 #include "chrome/browser/ui/browser_window.h"
14 #include "chrome/browser/ui/singleton_tabs.h" 14 #include "chrome/browser/ui/singleton_tabs.h"
15 #include "chrome/common/url_constants.h" 15 #include "chrome/common/url_constants.h"
16 #include "chrome/grit/generated_resources.h" 16 #include "chrome/grit/generated_resources.h"
17 #include "components/constrained_window/constrained_window_views.h" 17 #include "components/constrained_window/constrained_window_views.h"
18 #include "components/strings/grit/components_strings.h" 18 #include "components/strings/grit/components_strings.h"
19 #include "content/public/browser/navigation_handle.h"
19 #include "content/public/browser/web_contents.h" 20 #include "content/public/browser/web_contents.h"
20 #include "extensions/browser/extension_registry.h" 21 #include "extensions/browser/extension_registry.h"
21 #include "extensions/common/extension.h" 22 #include "extensions/common/extension.h"
22 #include "ui/aura/window.h" 23 #include "ui/aura/window.h"
23 #include "ui/base/l10n/l10n_util.h" 24 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/page_transition_types.h" 25 #include "ui/base/page_transition_types.h"
25 #include "ui/views/border.h" 26 #include "ui/views/border.h"
26 #include "ui/views/controls/styled_label.h" 27 #include "ui/views/controls/styled_label.h"
27 #include "ui/views/layout/fill_layout.h" 28 #include "ui/views/layout/fill_layout.h"
28 #include "ui/views/layout/layout_constants.h" 29 #include "ui/views/layout/layout_constants.h"
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 Profile::FromBrowserContext(web_contents()->GetBrowserContext()); 143 Profile::FromBrowserContext(web_contents()->GetBrowserContext());
143 chrome::NavigateParams params( 144 chrome::NavigateParams params(
144 profile, learn_more_url, ui::PAGE_TRANSITION_LINK); 145 profile, learn_more_url, ui::PAGE_TRANSITION_LINK);
145 params.disposition = WindowOpenDisposition::SINGLETON_TAB; 146 params.disposition = WindowOpenDisposition::SINGLETON_TAB;
146 chrome::Navigate(&params); 147 chrome::Navigate(&params);
147 } else { 148 } else {
148 chrome::ShowSingletonTab(browser, learn_more_url); 149 chrome::ShowSingletonTab(browser, learn_more_url);
149 } 150 }
150 } 151 }
151 152
152 void PlatformVerificationDialog::DidStartNavigationToPendingEntry( 153 void PlatformVerificationDialog::DidStartNavigation(
153 const GURL& url, 154 content::NavigationHandle* navigation_handle) {
154 content::ReloadType reload_type) { 155 if (!navigation_handle->IsInMainFrame() || navigation_handle->IsSamePage())
156 return;
157
155 views::Widget* widget = GetWidget(); 158 views::Widget* widget = GetWidget();
156 if (widget) 159 if (widget)
157 widget->Close(); 160 widget->Close();
158 } 161 }
159 162
160 } // namespace attestation 163 } // namespace attestation
161 } // namespace chromeos 164 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/attestation/platform_verification_dialog.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698