| OLD | NEW |
| 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 "chrome/browser/chrome_content_browser_client.h" | 5 #include "chrome/browser/chrome_content_browser_client.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 #include <utility> | 8 #include <utility> |
| 9 #include <vector> | 9 #include <vector> |
| 10 | 10 |
| (...skipping 554 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 565 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); | 565 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::IO)); |
| 566 g_io_thread_application_locale.Get() = locale; | 566 g_io_thread_application_locale.Get() = locale; |
| 567 } | 567 } |
| 568 | 568 |
| 569 void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) { | 569 void HandleBlockedPopupOnUIThread(const BlockedWindowParams& params) { |
| 570 WebContents* tab = tab_util::GetWebContentsByID(params.render_process_id(), | 570 WebContents* tab = tab_util::GetWebContentsByID(params.render_process_id(), |
| 571 params.opener_id()); | 571 params.opener_id()); |
| 572 if (!tab) | 572 if (!tab) |
| 573 return; | 573 return; |
| 574 | 574 |
| 575 prerender::PrerenderContents* prerender_contents = |
| 576 prerender::PrerenderContents::FromWebContents(tab); |
| 577 if (prerender_contents) { |
| 578 prerender_contents->Destroy(prerender::FINAL_STATUS_CREATE_NEW_WINDOW); |
| 579 return; |
| 580 } |
| 581 |
| 575 PopupBlockerTabHelper* popup_helper = | 582 PopupBlockerTabHelper* popup_helper = |
| 576 PopupBlockerTabHelper::FromWebContents(tab); | 583 PopupBlockerTabHelper::FromWebContents(tab); |
| 577 if (!popup_helper) | 584 if (!popup_helper) |
| 578 return; | 585 return; |
| 579 popup_helper->AddBlockedPopup(params); | 586 popup_helper->AddBlockedPopup(params); |
| 580 } | 587 } |
| 581 | 588 |
| 582 #if defined(OS_ANDROID) | 589 #if defined(OS_ANDROID) |
| 583 | 590 |
| 584 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { | 591 void HandleSingleTabModeBlockOnUIThread(const BlockedWindowParams& params) { |
| (...skipping 1491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2076 | 2083 |
| 2077 return true; | 2084 return true; |
| 2078 } | 2085 } |
| 2079 | 2086 |
| 2080 // No new browser window (popup or tab) in app mode. | 2087 // No new browser window (popup or tab) in app mode. |
| 2081 if (container_type == WINDOW_CONTAINER_TYPE_NORMAL && | 2088 if (container_type == WINDOW_CONTAINER_TYPE_NORMAL && |
| 2082 chrome::IsRunningInForcedAppMode()) { | 2089 chrome::IsRunningInForcedAppMode()) { |
| 2083 return false; | 2090 return false; |
| 2084 } | 2091 } |
| 2085 | 2092 |
| 2086 if (g_browser_process->prerender_tracker() && | |
| 2087 g_browser_process->prerender_tracker()->TryCancelOnIOThread( | |
| 2088 render_process_id, | |
| 2089 opener_id, | |
| 2090 prerender::FINAL_STATUS_CREATE_NEW_WINDOW)) { | |
| 2091 return false; | |
| 2092 } | |
| 2093 | |
| 2094 if (is_guest) | 2093 if (is_guest) |
| 2095 return true; | 2094 return true; |
| 2096 | 2095 |
| 2097 HostContentSettingsMap* content_settings = | 2096 HostContentSettingsMap* content_settings = |
| 2098 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); | 2097 ProfileIOData::FromResourceContext(context)->GetHostContentSettingsMap(); |
| 2099 BlockedWindowParams blocked_params(target_url, | 2098 BlockedWindowParams blocked_params(target_url, |
| 2100 referrer, | 2099 referrer, |
| 2101 disposition, | 2100 disposition, |
| 2102 features, | 2101 features, |
| 2103 user_gesture, | 2102 user_gesture, |
| (...skipping 551 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2655 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on | 2654 // releases of Chrome. Permitting "Unknown" allows these APIs to be used on |
| 2656 // Chromium builds as well. | 2655 // Chromium builds as well. |
| 2657 return channel <= chrome::VersionInfo::CHANNEL_DEV; | 2656 return channel <= chrome::VersionInfo::CHANNEL_DEV; |
| 2658 #else | 2657 #else |
| 2659 return false; | 2658 return false; |
| 2660 #endif | 2659 #endif |
| 2661 } | 2660 } |
| 2662 | 2661 |
| 2663 | 2662 |
| 2664 } // namespace chrome | 2663 } // namespace chrome |
| OLD | NEW |