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

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

Issue 1970: Prevent constrained popup windows from trying to become real... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 12 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | 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 (c) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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/web_contents.h" 5 #include "chrome/browser/web_contents.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/file_version_info.h" 8 #include "base/file_version_info.h"
9 #include "chrome/app/locales/locale_settings.h" 9 #include "chrome/app/locales/locale_settings.h"
10 #include "chrome/browser/bookmarks/bookmark_model.h" 10 #include "chrome/browser/bookmarks/bookmark_model.h"
(...skipping 1884 matching lines...) Expand 10 before | Expand all | Expand 10 after
1895 select_file_dialog_ = SelectFileDialog::Create(this); 1895 select_file_dialog_ = SelectFileDialog::Create(this);
1896 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE, L"", 1896 select_file_dialog_->SelectFile(SelectFileDialog::SELECT_OPEN_FILE, L"",
1897 default_file, toplevel_hwnd, NULL); 1897 default_file, toplevel_hwnd, NULL);
1898 } 1898 }
1899 1899
1900 void WebContents::RunJavaScriptMessage( 1900 void WebContents::RunJavaScriptMessage(
1901 const std::wstring& message, 1901 const std::wstring& message,
1902 const std::wstring& default_prompt, 1902 const std::wstring& default_prompt,
1903 const int flags, 1903 const int flags,
1904 IPC::Message* reply_msg) { 1904 IPC::Message* reply_msg) {
1905 if (!suppress_javascript_messages_) { 1905 // Suppress javascript messages when requested and when inside a constrained
1906 // popup window (because that activates them and breaks them out of the
1907 // constrained window jail).
1908 bool suppress_this_message = suppress_javascript_messages_;
1909 if (delegate())
1910 suppress_this_message |= delegate()->IsPopup(this);
1911
1912 if (!suppress_this_message) {
1906 TimeDelta time_since_last_message( 1913 TimeDelta time_since_last_message(
1907 TimeTicks::Now() - last_javascript_message_dismissal_); 1914 TimeTicks::Now() - last_javascript_message_dismissal_);
1908 bool show_suppress_checkbox = false; 1915 bool show_suppress_checkbox = false;
1909 // Show a checkbox offering to suppress further messages if this message is 1916 // Show a checkbox offering to suppress further messages if this message is
1910 // being displayed within kJavascriptMessageExpectedDelay of the last one. 1917 // being displayed within kJavascriptMessageExpectedDelay of the last one.
1911 if (time_since_last_message < 1918 if (time_since_last_message <
1912 TimeDelta::FromMilliseconds(kJavascriptMessageExpectedDelay)) 1919 TimeDelta::FromMilliseconds(kJavascriptMessageExpectedDelay))
1913 show_suppress_checkbox = true; 1920 show_suppress_checkbox = true;
1914 1921
1915 JavascriptMessageBoxHandler::RunJavascriptMessageBox(this, 1922 JavascriptMessageBoxHandler::RunJavascriptMessageBox(this,
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after
2582 } 2589 }
2583 2590
2584 BOOL WebContents::EnumPluginWindowsCallback(HWND window, LPARAM) { 2591 BOOL WebContents::EnumPluginWindowsCallback(HWND window, LPARAM) {
2585 if (WebPluginDelegateImpl::IsPluginDelegateWindow(window)) { 2592 if (WebPluginDelegateImpl::IsPluginDelegateWindow(window)) {
2586 ::ShowWindow(window, SW_HIDE); 2593 ::ShowWindow(window, SW_HIDE);
2587 SetParent(window, NULL); 2594 SetParent(window, NULL);
2588 } 2595 }
2589 2596
2590 return TRUE; 2597 return TRUE;
2591 } 2598 }
2592
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698