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

Side by Side Diff: chrome/browser/extensions/extension_host.cc

Issue 6627063: Ignore JavaScript messages (alert/confirm/prompt) during unload handlers. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Added a browsertest Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/extensions/extension_host.h" 5 #include "chrome/browser/extensions/extension_host.h"
6 6
7 #include <list> 7 #include <list>
8 8
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 413 matching lines...) Expand 10 before | Expand all | Expand 10 after
424 NotificationType::EXTENSION_POPUP_VIEW_READY, 424 NotificationType::EXTENSION_POPUP_VIEW_READY,
425 Source<Profile>(profile_), 425 Source<Profile>(profile_),
426 Details<ExtensionHost>(this)); 426 Details<ExtensionHost>(this));
427 } 427 }
428 } 428 }
429 429
430 void ExtensionHost::RunJavaScriptMessage(const std::wstring& message, 430 void ExtensionHost::RunJavaScriptMessage(const std::wstring& message,
431 const std::wstring& default_prompt, 431 const std::wstring& default_prompt,
432 const GURL& frame_url, 432 const GURL& frame_url,
433 const int flags, 433 const int flags,
434 const bool unload_handler_being_run,
434 IPC::Message* reply_msg, 435 IPC::Message* reply_msg,
435 bool* did_suppress_message) { 436 bool* did_suppress_message) {
436 base::TimeDelta time_since_last_message( 437 base::TimeDelta time_since_last_message(
437 base::TimeTicks::Now() - last_javascript_message_dismissal_); 438 base::TimeTicks::Now() - last_javascript_message_dismissal_);
438 439
439 *did_suppress_message = suppress_javascript_messages_; 440 *did_suppress_message = suppress_javascript_messages_;
440 if (!suppress_javascript_messages_) { 441 if (!suppress_javascript_messages_) {
441 bool show_suppress_checkbox = false; 442 bool show_suppress_checkbox = false;
442 // Show a checkbox offering to suppress further messages if this message is 443 // Show a checkbox offering to suppress further messages if this message is
443 // being displayed within kJavascriptMessageExpectedDelay of the last one. 444 // being displayed within kJavascriptMessageExpectedDelay of the last one.
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
835 } 836 }
836 return window_id; 837 return window_id;
837 } 838 }
838 839
839 void ExtensionHost::OnRunFileChooser( 840 void ExtensionHost::OnRunFileChooser(
840 const ViewHostMsg_RunFileChooser_Params& params) { 841 const ViewHostMsg_RunFileChooser_Params& params) {
841 if (file_select_helper_.get() == NULL) 842 if (file_select_helper_.get() == NULL)
842 file_select_helper_.reset(new FileSelectHelper(profile())); 843 file_select_helper_.reset(new FileSelectHelper(profile()));
843 file_select_helper_->RunFileChooser(render_view_host_, params); 844 file_select_helper_->RunFileChooser(render_view_host_, params);
844 } 845 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_host.h ('k') | chrome/browser/prerender/prerender_contents.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698