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

Side by Side Diff: chrome/browser/tab_contents/tab_contents.cc

Issue 149261: Disimiss JS message boxes when an interstitial is showing (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
(...skipping 1911 matching lines...) Expand 10 before | Expand all | Expand 10 after
1922 void TabContents::RunJavaScriptMessage( 1922 void TabContents::RunJavaScriptMessage(
1923 const std::wstring& message, 1923 const std::wstring& message,
1924 const std::wstring& default_prompt, 1924 const std::wstring& default_prompt,
1925 const GURL& frame_url, 1925 const GURL& frame_url,
1926 const int flags, 1926 const int flags,
1927 IPC::Message* reply_msg, 1927 IPC::Message* reply_msg,
1928 bool* did_suppress_message) { 1928 bool* did_suppress_message) {
1929 // Suppress javascript messages when requested and when inside a constrained 1929 // Suppress javascript messages when requested and when inside a constrained
1930 // popup window (because that activates them and breaks them out of the 1930 // popup window (because that activates them and breaks them out of the
1931 // constrained window jail). 1931 // constrained window jail).
1932 bool suppress_this_message = suppress_javascript_messages_; 1932 // Also suppress messages when showing an interstitial. The interstitial is
1933 // shown over the previous page, we don't want the hidden page dialogs to
1934 // interfere with the interstitial.
1935 bool suppress_this_message = suppress_javascript_messages_ ||
1936 showing_interstitial_page();
1933 if (delegate()) 1937 if (delegate())
1934 suppress_this_message |= 1938 suppress_this_message |=
1935 (delegate()->GetConstrainingContents(this) != this); 1939 (delegate()->GetConstrainingContents(this) != this);
1936 1940
1937 *did_suppress_message = suppress_this_message; 1941 *did_suppress_message = suppress_this_message;
1938 1942
1939 if (!suppress_this_message) { 1943 if (!suppress_this_message) {
1940 base::TimeDelta time_since_last_message( 1944 base::TimeDelta time_since_last_message(
1941 base::TimeTicks::Now() - last_javascript_message_dismissal_); 1945 base::TimeTicks::Now() - last_javascript_message_dismissal_);
1942 bool show_suppress_checkbox = false; 1946 bool show_suppress_checkbox = false;
(...skipping 412 matching lines...) Expand 10 before | Expand all | Expand 10 after
2355 NavigationController::LoadCommittedDetails& committed_details = 2359 NavigationController::LoadCommittedDetails& committed_details =
2356 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); 2360 *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
2357 ExpireInfoBars(committed_details); 2361 ExpireInfoBars(committed_details);
2358 break; 2362 break;
2359 } 2363 }
2360 2364
2361 default: 2365 default:
2362 NOTREACHED(); 2366 NOTREACHED();
2363 } 2367 }
2364 } 2368 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698