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

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

Issue 2894973002: Provide WebContents::CreateParams to tab helpers. (Closed)
Patch Set: rebase Created 3 years, 7 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(WebContents* source_contents, 1698 void Browser::WebContentsCreated(
1699 int opener_render_process_id, 1699 WebContents* source_contents,
1700 int opener_render_frame_id, 1700 int opener_render_process_id,
1701 const std::string& frame_name, 1701 int opener_render_frame_id,
1702 const GURL& target_url, 1702 const std::string& frame_name,
1703 WebContents* new_contents) { 1703 const GURL& target_url,
1704 WebContents* new_contents,
1705 const base::Optional<WebContents::CreateParams>& create_params) {
1704 // Adopt the WebContents now, so all observers are in place, as the network 1706 // Adopt the WebContents now, so all observers are in place, as the network
1705 // requests for its initial navigation will start immediately. The WebContents 1707 // requests for its initial navigation will start immediately. The WebContents
1706 // will later be inserted into this browser using Browser::Navigate via 1708 // will later be inserted into this browser using Browser::Navigate via
1707 // AddNewContents. 1709 // AddNewContents.
1708 TabHelpers::AttachTabHelpers(new_contents); 1710 TabHelpers::AttachTabHelpers(new_contents, create_params);
1709 1711
1710 // Make the tab show up in the task manager. 1712 // Make the tab show up in the task manager.
1711 task_manager::WebContentsTags::CreateForTabContents(new_contents); 1713 task_manager::WebContentsTags::CreateForTabContents(new_contents);
1712 } 1714 }
1713 1715
1714 void Browser::RendererUnresponsive( 1716 void Browser::RendererUnresponsive(
1715 WebContents* source, 1717 WebContents* source,
1716 const content::WebContentsUnresponsiveState& unresponsive_state) { 1718 const content::WebContentsUnresponsiveState& unresponsive_state) {
1717 // Ignore hangs if a tab is blocked. 1719 // Ignore hangs if a tab is blocked.
1718 int index = tab_strip_model_->GetIndexOfWebContents(source); 1720 int index = tab_strip_model_->GetIndexOfWebContents(source);
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after
2626 // new window later, thus we need to navigate the window now. 2628 // new window later, thus we need to navigate the window now.
2627 if (contents) { 2629 if (contents) {
2628 contents->web_contents()->GetController().LoadURL( 2630 contents->web_contents()->GetController().LoadURL(
2629 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK, 2631 target_url, content::Referrer(), ui::PAGE_TRANSITION_LINK,
2630 std::string()); // No extra headers. 2632 std::string()); // No extra headers.
2631 } 2633 }
2632 } 2634 }
2633 2635
2634 return contents != NULL; 2636 return contents != NULL;
2635 } 2637 }
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