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 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 | 465 |
466 if (params->disposition != CURRENT_TAB) { | 466 if (params->disposition != CURRENT_TAB) { |
467 WebContents* source_contents = params->source_contents ? | 467 WebContents* source_contents = params->source_contents ? |
468 params->source_contents->web_contents() : NULL; | 468 params->source_contents->web_contents() : NULL; |
469 params->target_contents = | 469 params->target_contents = |
470 chrome::TabContentsFactory( | 470 chrome::TabContentsFactory( |
471 params->browser->profile(), | 471 params->browser->profile(), |
472 tab_util::GetSiteInstanceForNewTab( | 472 tab_util::GetSiteInstanceForNewTab( |
473 params->browser->profile(), url), | 473 params->browser->profile(), url), |
474 MSG_ROUTING_NONE, | 474 MSG_ROUTING_NONE, |
475 source_contents, | 475 source_contents); |
476 NULL); | |
477 // This function takes ownership of |params->target_contents| until it | 476 // This function takes ownership of |params->target_contents| until it |
478 // is added to a TabStripModel. | 477 // is added to a TabStripModel. |
479 target_contents_owner.TakeOwnership(); | 478 target_contents_owner.TakeOwnership(); |
480 params->target_contents->extension_tab_helper()-> | 479 params->target_contents->extension_tab_helper()-> |
481 SetExtensionAppById(params->extension_app_id); | 480 SetExtensionAppById(params->extension_app_id); |
482 // TODO(sky): figure out why this is needed. Without it we seem to get | 481 // TODO(sky): figure out why this is needed. Without it we seem to get |
483 // failures in startup tests. | 482 // failures in startup tests. |
484 // By default, content believes it is not hidden. When adding contents | 483 // By default, content believes it is not hidden. When adding contents |
485 // in the background, tell it that it's hidden. | 484 // in the background, tell it that it's hidden. |
486 if ((params->tabstrip_add_types & TabStripModel::ADD_ACTIVE) == 0) { | 485 if ((params->tabstrip_add_types & TabStripModel::ADD_ACTIVE) == 0) { |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 return !(url.scheme() == chrome::kChromeUIScheme && | 583 return !(url.scheme() == chrome::kChromeUIScheme && |
585 (url.host() == chrome::kChromeUISettingsHost || | 584 (url.host() == chrome::kChromeUISettingsHost || |
586 url.host() == chrome::kChromeUISettingsFrameHost || | 585 url.host() == chrome::kChromeUISettingsFrameHost || |
587 url.host() == chrome::kChromeUIExtensionsHost || | 586 url.host() == chrome::kChromeUIExtensionsHost || |
588 url.host() == chrome::kChromeUIBookmarksHost || | 587 url.host() == chrome::kChromeUIBookmarksHost || |
589 url.host() == chrome::kChromeUISyncPromoHost || | 588 url.host() == chrome::kChromeUISyncPromoHost || |
590 url.host() == chrome::kChromeUIUberHost)); | 589 url.host() == chrome::kChromeUIUberHost)); |
591 } | 590 } |
592 | 591 |
593 } // namespace chrome | 592 } // namespace chrome |
OLD | NEW |