Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2523)

Side by Side Diff: chrome/browser/ui/browser_navigator.cc

Issue 1843943003: Extension-created windows should share the creator's BrowingInstance. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Review comments Created 4 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/macros.h" 10 #include "base/macros.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
331 private: 331 private:
332 chrome::NavigateParams* params_; 332 chrome::NavigateParams* params_;
333 scoped_ptr<WebContents> target_contents_owner_; 333 scoped_ptr<WebContents> target_contents_owner_;
334 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner); 334 DISALLOW_COPY_AND_ASSIGN(ScopedTargetContentsOwner);
335 }; 335 };
336 336
337 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params, 337 content::WebContents* CreateTargetContents(const chrome::NavigateParams& params,
338 const GURL& url) { 338 const GURL& url) {
339 WebContents::CreateParams create_params( 339 WebContents::CreateParams create_params(
340 params.browser->profile(), 340 params.browser->profile(),
341 tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url)); 341 params.source_site_instance
342 ? params.source_site_instance
343 : tab_util::GetSiteInstanceForNewTab(params.browser->profile(), url));
342 if (params.source_contents) { 344 if (params.source_contents) {
343 create_params.initial_size = 345 create_params.initial_size =
344 params.source_contents->GetContainerBounds().size(); 346 params.source_contents->GetContainerBounds().size();
345 create_params.created_with_opener = params.created_with_opener; 347 create_params.created_with_opener = params.created_with_opener;
346 } 348 }
347 if (params.disposition == NEW_BACKGROUND_TAB) 349 if (params.disposition == NEW_BACKGROUND_TAB)
348 create_params.initially_hidden = true; 350 create_params.initially_hidden = true;
349 351
350 #if defined(USE_AURA) 352 #if defined(USE_AURA)
351 if (params.browser->window() && 353 if (params.browser->window() &&
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after
644 bool reverse_on_redirect = false; 646 bool reverse_on_redirect = false;
645 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary( 647 content::BrowserURLHandler::GetInstance()->RewriteURLIfNecessary(
646 &rewritten_url, browser_context, &reverse_on_redirect); 648 &rewritten_url, browser_context, &reverse_on_redirect);
647 649
648 // Some URLs are mapped to uber subpages. Do not allow them in incognito. 650 // Some URLs are mapped to uber subpages. Do not allow them in incognito.
649 return !(rewritten_url.scheme() == content::kChromeUIScheme && 651 return !(rewritten_url.scheme() == content::kChromeUIScheme &&
650 rewritten_url.host() == chrome::kChromeUIUberHost); 652 rewritten_url.host() == chrome::kChromeUIUberHost);
651 } 653 }
652 654
653 } // namespace chrome 655 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698