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

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

Issue 2983533002: Revert of Provide WebContents::CreateParams to tab helpers. (Closed)
Patch Set: Created 3 years, 5 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
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 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.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <algorithm> 9 #include <algorithm>
10 #include <string> 10 #include <string>
(...skipping 1677 matching lines...) Expand 10 before | Expand all | Expand 10 after
1688 // If a BackgroundContents is created, suppress the normal WebContents. 1688 // If a BackgroundContents is created, suppress the normal WebContents.
1689 return !MaybeCreateBackgroundContents( 1689 return !MaybeCreateBackgroundContents(
1690 source_site_instance, opener_url, route_id, main_frame_route_id, 1690 source_site_instance, opener_url, route_id, main_frame_route_id,
1691 main_frame_widget_route_id, frame_name, target_url, partition_id, 1691 main_frame_widget_route_id, frame_name, target_url, partition_id,
1692 session_storage_namespace); 1692 session_storage_namespace);
1693 } 1693 }
1694 1694
1695 return true; 1695 return true;
1696 } 1696 }
1697 1697
1698 void Browser::WebContentsCreated( 1698 void Browser::WebContentsCreated(WebContents* source_contents,
1699 WebContents* source_contents, 1699 int opener_render_process_id,
1700 int opener_render_process_id, 1700 int opener_render_frame_id,
1701 int opener_render_frame_id, 1701 const std::string& frame_name,
1702 const std::string& frame_name, 1702 const GURL& target_url,
1703 const GURL& target_url, 1703 WebContents* new_contents) {
1704 WebContents* new_contents,
1705 const base::Optional<WebContents::CreateParams>& create_params) {
1706 // Adopt the WebContents now, so all observers are in place, as the network 1704 // Adopt the WebContents now, so all observers are in place, as the network
1707 // requests for its initial navigation will start immediately. The WebContents 1705 // requests for its initial navigation will start immediately. The WebContents
1708 // will later be inserted into this browser using Browser::Navigate via 1706 // will later be inserted into this browser using Browser::Navigate via
1709 // AddNewContents. 1707 // AddNewContents.
1710 TabHelpers::AttachTabHelpers(new_contents, create_params); 1708 TabHelpers::AttachTabHelpers(new_contents);
1711 1709
1712 // Make the tab show up in the task manager. 1710 // Make the tab show up in the task manager.
1713 task_manager::WebContentsTags::CreateForTabContents(new_contents); 1711 task_manager::WebContentsTags::CreateForTabContents(new_contents);
1714 } 1712 }
1715 1713
1716 void Browser::RendererUnresponsive( 1714 void Browser::RendererUnresponsive(
1717 WebContents* source, 1715 WebContents* source,
1718 const content::WebContentsUnresponsiveState& unresponsive_state) { 1716 const content::WebContentsUnresponsiveState& unresponsive_state) {
1719 // Ignore hangs if a tab is blocked. 1717 // Ignore hangs if a tab is blocked.
1720 int index = tab_strip_model_->GetIndexOfWebContents(source); 1718 int index = tab_strip_model_->GetIndexOfWebContents(source);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2628 // new window later, thus we need to navigate the window now. 2626 // new window later, thus we need to navigate the window now.
2629 if (contents) { 2627 if (contents) {
2630 contents->web_contents()->GetController().LoadURL( 2628 contents->web_contents()->GetController().LoadURL(
2631 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, 2629 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK,
2632 std::string()); // No extra headers. 2630 std::string()); // No extra headers.
2633 } 2631 }
2634 } 2632 }
2635 2633
2636 return contents != NULL; 2634 return contents != NULL;
2637 } 2635 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/browser.h ('k') | chrome/browser/ui/browser_navigator.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698