| 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/ui/browser_navigator.h" | 5 #include "chrome/browser/ui/browser_navigator.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 395 | 395 |
| 396 // The browser window may want to adjust the disposition. | 396 // The browser window may want to adjust the disposition. |
| 397 if (params->disposition == NEW_POPUP && | 397 if (params->disposition == NEW_POPUP && |
| 398 source_browser && | 398 source_browser && |
| 399 source_browser->window()) { | 399 source_browser->window()) { |
| 400 params->disposition = | 400 params->disposition = |
| 401 source_browser->window()->GetDispositionForPopupBounds( | 401 source_browser->window()->GetDispositionForPopupBounds( |
| 402 params->window_bounds); | 402 params->window_bounds); |
| 403 } | 403 } |
| 404 | 404 |
| 405 // Adjust disposition for the navigation happending in the sad page of the | |
| 406 // panel window. | |
| 407 if (params->source_contents && | |
| 408 params->source_contents->web_contents()->IsCrashed() && | |
| 409 params->disposition == CURRENT_TAB && | |
| 410 params->browser && | |
| 411 params->browser->is_type_panel()) { | |
| 412 params->disposition = NEW_FOREGROUND_TAB; | |
| 413 } | |
| 414 | |
| 415 params->browser = GetBrowserForDisposition(params); | 405 params->browser = GetBrowserForDisposition(params); |
| 416 | 406 |
| 417 if (!params->browser) | 407 if (!params->browser) |
| 418 return; | 408 return; |
| 419 | 409 |
| 420 // Navigate() must not return early after this point. | 410 // Navigate() must not return early after this point. |
| 421 | 411 |
| 422 if (GetSourceProfile(params) != params->browser->profile()) { | 412 if (GetSourceProfile(params) != params->browser->profile()) { |
| 423 // A tab is being opened from a link from a different profile, we must reset | 413 // A tab is being opened from a link from a different profile, we must reset |
| 424 // source information that may cause state to be shared. | 414 // source information that may cause state to be shared. |
| (...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 601 return !(url.scheme() == chrome::kChromeUIScheme && | 591 return !(url.scheme() == chrome::kChromeUIScheme && |
| 602 (url.host() == chrome::kChromeUISettingsHost || | 592 (url.host() == chrome::kChromeUISettingsHost || |
| 603 url.host() == chrome::kChromeUISettingsFrameHost || | 593 url.host() == chrome::kChromeUISettingsFrameHost || |
| 604 url.host() == chrome::kChromeUIExtensionsHost || | 594 url.host() == chrome::kChromeUIExtensionsHost || |
| 605 url.host() == chrome::kChromeUIBookmarksHost || | 595 url.host() == chrome::kChromeUIBookmarksHost || |
| 606 url.host() == chrome::kChromeUISyncPromoHost || | 596 url.host() == chrome::kChromeUISyncPromoHost || |
| 607 url.host() == chrome::kChromeUIUberHost)); | 597 url.host() == chrome::kChromeUIUberHost)); |
| 608 } | 598 } |
| 609 | 599 |
| 610 } // namespace chrome | 600 } // namespace chrome |
| OLD | NEW |