| OLD | NEW |
| 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 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 #endif | 762 #endif |
| 763 | 763 |
| 764 void TabContents::AddNewContents(TabContents* new_contents, | 764 void TabContents::AddNewContents(TabContents* new_contents, |
| 765 WindowOpenDisposition disposition, | 765 WindowOpenDisposition disposition, |
| 766 const gfx::Rect& initial_pos, | 766 const gfx::Rect& initial_pos, |
| 767 bool user_gesture, | 767 bool user_gesture, |
| 768 const GURL& creator_url) { | 768 const GURL& creator_url) { |
| 769 if (!delegate_) | 769 if (!delegate_) |
| 770 return; | 770 return; |
| 771 | 771 |
| 772 #if defined(OS_WIN) | 772 #if defined(OS_WIN) || defined(OS_LINUX) |
| 773 bool constrain_popup = false; | |
| 774 if ((disposition == NEW_POPUP) && !user_gesture && | 773 if ((disposition == NEW_POPUP) && !user_gesture && |
| 775 !CommandLine::ForCurrentProcess()->HasSwitch( | 774 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 776 switches::kDisablePopupBlocking)) { | 775 switches::kDisablePopupBlocking)) { |
| 777 // Unrequested popups from normal pages are constrained unless they're in | 776 // Unrequested popups from normal pages are constrained unless they're in |
| 778 // the whitelist. The popup owner will handle checking this. | 777 // the whitelist. The popup owner will handle checking this. |
| 779 delegate_->GetConstrainingContents(this)->AddPopup(new_contents, | 778 delegate_->GetConstrainingContents(this)->AddPopup(new_contents, |
| 780 initial_pos, | 779 initial_pos, |
| 781 creator_url.is_valid() ? creator_url.host() : std::string()); | 780 creator_url.is_valid() ? creator_url.host() : std::string()); |
| 782 } else { | 781 } else { |
| 783 new_contents->DisassociateFromPopupCount(); | 782 new_contents->DisassociateFromPopupCount(); |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1065 NotificationType type = is_loading ? NotificationType::LOAD_START : | 1064 NotificationType type = is_loading ? NotificationType::LOAD_START : |
| 1066 NotificationType::LOAD_STOP; | 1065 NotificationType::LOAD_STOP; |
| 1067 NotificationDetails det = NotificationService::NoDetails(); | 1066 NotificationDetails det = NotificationService::NoDetails(); |
| 1068 if (details) | 1067 if (details) |
| 1069 det = Details<LoadNotificationDetails>(details); | 1068 det = Details<LoadNotificationDetails>(details); |
| 1070 NotificationService::current()->Notify(type, | 1069 NotificationService::current()->Notify(type, |
| 1071 Source<NavigationController>(&controller_), | 1070 Source<NavigationController>(&controller_), |
| 1072 det); | 1071 det); |
| 1073 } | 1072 } |
| 1074 | 1073 |
| 1075 #if defined(OS_WIN) | 1074 #if defined(OS_WIN) || defined(OS_LINUX) |
| 1076 void TabContents::CreateBlockedPopupContainerIfNecessary() { | 1075 void TabContents::CreateBlockedPopupContainerIfNecessary() { |
| 1077 if (blocked_popups_) | 1076 if (blocked_popups_) |
| 1078 return; | 1077 return; |
| 1079 | 1078 |
| 1080 blocked_popups_ = BlockedPopupContainer::Create(this, profile()); | 1079 blocked_popups_ = BlockedPopupContainer::Create(this, profile()); |
| 1081 } | 1080 } |
| 1082 | 1081 |
| 1083 void TabContents::AddPopup(TabContents* new_contents, | 1082 void TabContents::AddPopup(TabContents* new_contents, |
| 1084 const gfx::Rect& initial_pos, | 1083 const gfx::Rect& initial_pos, |
| 1085 const std::string& host) { | 1084 const std::string& host) { |
| (...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2329 NavigationController::LoadCommittedDetails& committed_details = | 2328 NavigationController::LoadCommittedDetails& committed_details = |
| 2330 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2329 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2331 ExpireInfoBars(committed_details); | 2330 ExpireInfoBars(committed_details); |
| 2332 break; | 2331 break; |
| 2333 } | 2332 } |
| 2334 | 2333 |
| 2335 default: | 2334 default: |
| 2336 NOTREACHED(); | 2335 NOTREACHED(); |
| 2337 } | 2336 } |
| 2338 } | 2337 } |
| OLD | NEW |