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

Side by Side Diff: content/browser/web_contents/web_contents_impl_unittest.cc

Issue 1714573002: Remove the ability of webpages to specify strings for the onbeforeunload dialog. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase again Created 4 years, 9 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 | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('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 (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 <stdint.h> 5 #include <stdint.h>
6 #include <utility> 6 #include <utility>
7 7
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/macros.h" 10 #include "base/macros.h"
(...skipping 3390 matching lines...) Expand 10 before | Expand all | Expand 10 after
3401 const std::string& accept_lang, 3401 const std::string& accept_lang,
3402 JavaScriptMessageType javascript_message_type, 3402 JavaScriptMessageType javascript_message_type,
3403 const base::string16& message_text, 3403 const base::string16& message_text,
3404 const base::string16& default_prompt_text, 3404 const base::string16& default_prompt_text,
3405 const DialogClosedCallback& callback, 3405 const DialogClosedCallback& callback,
3406 bool* did_suppress_message) override { 3406 bool* did_suppress_message) override {
3407 *did_suppress_message = true; 3407 *did_suppress_message = true;
3408 }; 3408 };
3409 3409
3410 void RunBeforeUnloadDialog(WebContents* web_contents, 3410 void RunBeforeUnloadDialog(WebContents* web_contents,
3411 const base::string16& message_text,
3412 bool is_reload, 3411 bool is_reload,
3413 const DialogClosedCallback& callback) override {} 3412 const DialogClosedCallback& callback) override {}
3414 3413
3415 bool HandleJavaScriptDialog(WebContents* web_contents, 3414 bool HandleJavaScriptDialog(WebContents* web_contents,
3416 bool accept, 3415 bool accept,
3417 const base::string16* prompt_override) override { 3416 const base::string16* prompt_override) override {
3418 return true; 3417 return true;
3419 } 3418 }
3420 3419
3421 void CancelActiveAndPendingDialogs(WebContents* web_contents) override {} 3420 void CancelActiveAndPendingDialogs(WebContents* web_contents) override {}
(...skipping 20 matching lines...) Expand all
3442 // An automatic navigation. 3441 // An automatic navigation.
3443 contents()->GetMainFrame()->SendNavigateWithModificationCallback( 3442 contents()->GetMainFrame()->SendNavigateWithModificationCallback(
3444 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture)); 3443 2, 0, true, GURL(url::kAboutBlankURL), base::Bind(SetAsNonUserGesture));
3445 3444
3446 EXPECT_EQ(1u, delegate->reset_count()); 3445 EXPECT_EQ(1u, delegate->reset_count());
3447 3446
3448 contents()->SetJavaScriptDialogManagerForTesting(nullptr); 3447 contents()->SetJavaScriptDialogManagerForTesting(nullptr);
3449 } 3448 }
3450 3449
3451 } // namespace content 3450 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/web_contents/web_contents_impl.cc ('k') | content/common/frame_messages.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698