| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
| 6 | 6 |
| 7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 #include <shellapi.h> | 9 #include <shellapi.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| 11 | 11 |
| 12 #include <algorithm> | 12 #include <algorithm> |
| 13 #include <string> | 13 #include <string> |
| 14 | 14 |
| 15 #include "base/base_paths.h" | 15 #include "base/base_paths.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/logging.h" | 17 #include "base/logging.h" |
| 18 #include "base/metrics/histogram.h" | 18 #include "base/metrics/histogram.h" |
| 19 #include "base/path_service.h" | 19 #include "base/path_service.h" |
| 20 #include "base/string_number_conversions.h" | 20 #include "base/string_number_conversions.h" |
| 21 #include "base/stringprintf.h" |
| 21 #include "base/string_util.h" | 22 #include "base/string_util.h" |
| 22 #include "base/threading/thread.h" | 23 #include "base/threading/thread.h" |
| 23 #include "base/threading/thread_restrictions.h" | 24 #include "base/threading/thread_restrictions.h" |
| 24 #include "base/time.h" | 25 #include "base/time.h" |
| 25 #include "base/utf_string_conversions.h" | 26 #include "base/utf_string_conversions.h" |
| 26 #include "chrome/app/chrome_command_ids.h" | 27 #include "chrome/app/chrome_command_ids.h" |
| 27 #include "chrome/browser/autofill/autofill_manager.h" | 28 #include "chrome/browser/autofill/autofill_manager.h" |
| 28 #include "chrome/browser/background/background_contents_service.h" | 29 #include "chrome/browser/background/background_contents_service.h" |
| 29 #include "chrome/browser/bookmarks/bookmark_model.h" | 30 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 30 #include "chrome/browser/bookmarks/bookmark_utils.h" | 31 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 136 #include "content/browser/tab_contents/interstitial_page.h" | 137 #include "content/browser/tab_contents/interstitial_page.h" |
| 137 #include "content/browser/tab_contents/navigation_controller.h" | 138 #include "content/browser/tab_contents/navigation_controller.h" |
| 138 #include "content/browser/tab_contents/navigation_entry.h" | 139 #include "content/browser/tab_contents/navigation_entry.h" |
| 139 #include "content/browser/tab_contents/tab_contents_view.h" | 140 #include "content/browser/tab_contents/tab_contents_view.h" |
| 140 #include "content/browser/user_metrics.h" | 141 #include "content/browser/user_metrics.h" |
| 141 #include "content/common/content_restriction.h" | 142 #include "content/common/content_restriction.h" |
| 142 #include "content/common/content_switches.h" | 143 #include "content/common/content_switches.h" |
| 143 #include "content/common/notification_service.h" | 144 #include "content/common/notification_service.h" |
| 144 #include "content/common/page_transition_types.h" | 145 #include "content/common/page_transition_types.h" |
| 145 #include "content/common/page_zoom.h" | 146 #include "content/common/page_zoom.h" |
| 146 #include "content/common/view_messages.h" | |
| 147 #include "grit/chromium_strings.h" | 147 #include "grit/chromium_strings.h" |
| 148 #include "grit/generated_resources.h" | 148 #include "grit/generated_resources.h" |
| 149 #include "grit/locale_settings.h" | 149 #include "grit/locale_settings.h" |
| 150 #include "grit/theme_resources_standard.h" | 150 #include "grit/theme_resources_standard.h" |
| 151 #include "net/base/cookie_monster.h" | 151 #include "net/base/cookie_monster.h" |
| 152 #include "net/base/net_util.h" | 152 #include "net/base/net_util.h" |
| 153 #include "net/base/registry_controlled_domain.h" | 153 #include "net/base/registry_controlled_domain.h" |
| 154 #include "net/url_request/url_request_context.h" | 154 #include "net/url_request/url_request_context.h" |
| 155 #include "ui/base/animation/animation.h" | 155 #include "ui/base/animation/animation.h" |
| 156 #include "ui/base/l10n/l10n_util.h" | 156 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 3221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3378 !CommandLine::ForCurrentProcess()->HasSwitch( | 3378 !CommandLine::ForCurrentProcess()->HasSwitch( |
| 3379 switches::kDisablePopupBlocking)) { | 3379 switches::kDisablePopupBlocking)) { |
| 3380 // Unrequested popups from normal pages are constrained unless they're in | 3380 // Unrequested popups from normal pages are constrained unless they're in |
| 3381 // the whitelist. The popup owner will handle checking this. | 3381 // the whitelist. The popup owner will handle checking this. |
| 3382 GetConstrainingContentsWrapper(source_wrapper)-> | 3382 GetConstrainingContentsWrapper(source_wrapper)-> |
| 3383 blocked_content_tab_helper()-> | 3383 blocked_content_tab_helper()-> |
| 3384 AddPopup(new_wrapper, initial_pos, user_gesture); | 3384 AddPopup(new_wrapper, initial_pos, user_gesture); |
| 3385 return; | 3385 return; |
| 3386 } | 3386 } |
| 3387 | 3387 |
| 3388 RenderViewHost* view = new_contents->render_view_host(); | 3388 new_contents->render_view_host()->DisassociateFromPopupCount(); |
| 3389 view->Send(new ViewMsg_DisassociateFromPopupCount(view->routing_id())); | |
| 3390 } | 3389 } |
| 3391 | 3390 |
| 3392 browser::NavigateParams params(this, new_wrapper); | 3391 browser::NavigateParams params(this, new_wrapper); |
| 3393 params.source_contents = | 3392 params.source_contents = |
| 3394 source ? tabstrip_model()->GetTabContentsAt( | 3393 source ? tabstrip_model()->GetTabContentsAt( |
| 3395 tabstrip_model()->GetWrapperIndex(source)) | 3394 tabstrip_model()->GetWrapperIndex(source)) |
| 3396 : NULL; | 3395 : NULL; |
| 3397 params.disposition = disposition; | 3396 params.disposition = disposition; |
| 3398 params.window_bounds = initial_pos; | 3397 params.window_bounds = initial_pos; |
| 3399 params.window_action = browser::NavigateParams::SHOW_WINDOW; | 3398 params.window_action = browser::NavigateParams::SHOW_WINDOW; |
| (...skipping 1871 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 5271 } else if (is_type_tabbed()) { | 5270 } else if (is_type_tabbed()) { |
| 5272 GlobalErrorService* service = | 5271 GlobalErrorService* service = |
| 5273 GlobalErrorServiceFactory::GetForProfile(profile()); | 5272 GlobalErrorServiceFactory::GetForProfile(profile()); |
| 5274 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); | 5273 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); |
| 5275 if (error) { | 5274 if (error) { |
| 5276 error->ShowBubbleView(this); | 5275 error->ShowBubbleView(this); |
| 5277 did_show_bubble = true; | 5276 did_show_bubble = true; |
| 5278 } | 5277 } |
| 5279 } | 5278 } |
| 5280 } | 5279 } |
| OLD | NEW |