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

Side by Side Diff: chrome/browser/safe_browsing/srt_global_error_win.cc

Issue 2248873002: Convert WindowOpenDisposition to an enum class. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase. Created 4 years, 3 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/safe_browsing/srt_global_error_win.h" 5 #include "chrome/browser/safe_browsing/srt_global_error_win.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/callback.h" 9 #include "base/callback.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 base::Unretained(this)), 239 base::Unretained(this)),
240 base::Bind(&SRTGlobalError::FallbackToDownloadPage, 240 base::Bind(&SRTGlobalError::FallbackToDownloadPage,
241 base::Unretained(this)))); 241 base::Unretained(this))));
242 } 242 }
243 243
244 void SRTGlobalError::FallbackToDownloadPage() { 244 void SRTGlobalError::FallbackToDownloadPage() {
245 RecordSRTPromptHistogram(SRT_PROMPT_FALLBACK); 245 RecordSRTPromptHistogram(SRT_PROMPT_FALLBACK);
246 246
247 Browser* browser = chrome::FindLastActive(); 247 Browser* browser = chrome::FindLastActive();
248 if (browser) { 248 if (browser) {
249 browser->OpenURL(content::OpenURLParams( 249 browser->OpenURL(
250 GURL(kSRTDownloadURL), content::Referrer(), NEW_FOREGROUND_TAB, 250 content::OpenURLParams(GURL(kSRTDownloadURL), content::Referrer(),
251 ui::PAGE_TRANSITION_LINK, false)); 251 WindowOpenDisposition::NEW_FOREGROUND_TAB,
252 ui::PAGE_TRANSITION_LINK, false));
252 } 253 }
253 254
254 BrowserThread::PostBlockingPoolTask( 255 BrowserThread::PostBlockingPoolTask(
255 FROM_HERE, base::Bind(&DeleteFilesFromBlockingPool, downloaded_path_)); 256 FROM_HERE, base::Bind(&DeleteFilesFromBlockingPool, downloaded_path_));
256 OnUserinteractionDone(); 257 OnUserinteractionDone();
257 } 258 }
258 259
259 void SRTGlobalError::OnUserinteractionStarted( 260 void SRTGlobalError::OnUserinteractionStarted(
260 SRTPromptHistogramValue histogram_value) { 261 SRTPromptHistogramValue histogram_value) {
261 // This is for cases where the UI doesn't go away quickly enough and user 262 // This is for cases where the UI doesn't go away quickly enough and user
(...skipping 11 matching lines...) Expand all
273 void SRTGlobalError::OnUserinteractionDone() { 274 void SRTGlobalError::OnUserinteractionDone() {
274 DCHECK(interacted_); 275 DCHECK(interacted_);
275 // Once the user interacted with the bubble, we can forget about any pending 276 // Once the user interacted with the bubble, we can forget about any pending
276 // prompt. 277 // prompt.
277 g_browser_process->local_state()->SetBoolean(prefs::kSwReporterPendingPrompt, 278 g_browser_process->local_state()->SetBoolean(prefs::kSwReporterPendingPrompt,
278 false); 279 false);
279 delete this; 280 delete this;
280 } 281 }
281 282
282 } // namespace safe_browsing 283 } // namespace safe_browsing
OLDNEW
« no previous file with comments | « chrome/browser/safe_browsing/safe_browsing_service_browsertest.cc ('k') | chrome/browser/search/hotword_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698