| OLD | NEW |
| 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/tab_contents/tab_contents.h" | 5 #include "chrome/browser/tab_contents/tab_contents.h" |
| 6 | 6 |
| 7 #include "base/file_version_info.h" | 7 #include "base/file_version_info.h" |
| 8 #include "base/process_util.h" | 8 #include "base/process_util.h" |
| 9 #include "base/string16.h" | 9 #include "base/string16.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 17 matching lines...) Expand all Loading... |
| 28 #include "chrome/browser/password_manager/password_manager.h" | 28 #include "chrome/browser/password_manager/password_manager.h" |
| 29 #include "chrome/browser/plugin_installer.h" | 29 #include "chrome/browser/plugin_installer.h" |
| 30 #include "chrome/browser/renderer_host/render_widget_host_view.h" | 30 #include "chrome/browser/renderer_host/render_widget_host_view.h" |
| 31 #include "chrome/browser/renderer_host/web_cache_manager.h" | 31 #include "chrome/browser/renderer_host/web_cache_manager.h" |
| 32 #include "chrome/browser/tab_contents/navigation_entry.h" | 32 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 33 #include "chrome/browser/tab_contents/tab_contents_delegate.h" | 33 #include "chrome/browser/tab_contents/tab_contents_delegate.h" |
| 34 #include "chrome/browser/tab_contents/tab_contents_view.h" | 34 #include "chrome/browser/tab_contents/tab_contents_view.h" |
| 35 #include "chrome/browser/tab_contents/web_contents.h" | 35 #include "chrome/browser/tab_contents/web_contents.h" |
| 36 #include "chrome/browser/search_engines/template_url_fetcher.h" | 36 #include "chrome/browser/search_engines/template_url_fetcher.h" |
| 37 #include "chrome/browser/search_engines/template_url_model.h" | 37 #include "chrome/browser/search_engines/template_url_model.h" |
| 38 #include "chrome/common/chrome_switches.h" |
| 38 #include "chrome/common/l10n_util.h" | 39 #include "chrome/common/l10n_util.h" |
| 39 #include "chrome/common/notification_service.h" | 40 #include "chrome/common/notification_service.h" |
| 40 #include "chrome/common/pref_names.h" | 41 #include "chrome/common/pref_names.h" |
| 41 #include "chrome/common/pref_service.h" | 42 #include "chrome/common/pref_service.h" |
| 42 #include "chrome/common/render_messages.h" | 43 #include "chrome/common/render_messages.h" |
| 43 #include "chrome/common/resource_bundle.h" | 44 #include "chrome/common/resource_bundle.h" |
| 44 #include "chrome/common/url_constants.h" | 45 #include "chrome/common/url_constants.h" |
| 45 //#include "grit/generated_resources.h" | 46 //#include "grit/generated_resources.h" |
| 46 #include "grit/locale_settings.h" | 47 #include "grit/locale_settings.h" |
| 47 #include "net/base/mime_util.h" | 48 #include "net/base/mime_util.h" |
| (...skipping 731 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 779 #endif | 780 #endif |
| 780 | 781 |
| 781 void TabContents::AddNewContents(TabContents* new_contents, | 782 void TabContents::AddNewContents(TabContents* new_contents, |
| 782 WindowOpenDisposition disposition, | 783 WindowOpenDisposition disposition, |
| 783 const gfx::Rect& initial_pos, | 784 const gfx::Rect& initial_pos, |
| 784 bool user_gesture) { | 785 bool user_gesture) { |
| 785 if (!delegate_) | 786 if (!delegate_) |
| 786 return; | 787 return; |
| 787 | 788 |
| 788 #if defined(OS_WIN) | 789 #if defined(OS_WIN) |
| 789 if ((disposition == NEW_POPUP) && !user_gesture) { | 790 if ((disposition == NEW_POPUP) && !user_gesture && |
| 791 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 792 switches::kDisablePopupBlocking)) { |
| 790 // Unrequested popups from normal pages are constrained. | 793 // Unrequested popups from normal pages are constrained. |
| 791 TabContents* popup_owner = this; | 794 TabContents* popup_owner = this; |
| 792 TabContents* our_owner = delegate_->GetConstrainingContents(this); | 795 TabContents* our_owner = delegate_->GetConstrainingContents(this); |
| 793 if (our_owner) | 796 if (our_owner) |
| 794 popup_owner = our_owner; | 797 popup_owner = our_owner; |
| 795 popup_owner->AddConstrainedPopup(new_contents, initial_pos); | 798 popup_owner->AddConstrainedPopup(new_contents, initial_pos); |
| 796 } else { | 799 } else { |
| 797 new_contents->DisassociateFromPopupCount(); | 800 new_contents->DisassociateFromPopupCount(); |
| 798 | 801 |
| 799 delegate_->AddNewContents(this, new_contents, disposition, initial_pos, | 802 delegate_->AddNewContents(this, new_contents, disposition, initial_pos, |
| (...skipping 1639 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2439 NavigationController::LoadCommittedDetails& committed_details = | 2442 NavigationController::LoadCommittedDetails& committed_details = |
| 2440 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); | 2443 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); |
| 2441 ExpireInfoBars(committed_details); | 2444 ExpireInfoBars(committed_details); |
| 2442 break; | 2445 break; |
| 2443 } | 2446 } |
| 2444 | 2447 |
| 2445 default: | 2448 default: |
| 2446 NOTREACHED(); | 2449 NOTREACHED(); |
| 2447 } | 2450 } |
| 2448 } | 2451 } |
| OLD | NEW |