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

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

Issue 10868072: Make TabContents ctor private; poke hole for existing callers. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: all green Created 8 years, 4 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 | Annotate | Revision Log
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/webui/chrome_web_contents_handler.h" 5 #include "chrome/browser/ui/webui/chrome_web_contents_handler.h"
6 6
7 #include "chrome/browser/profiles/profile.h" 7 #include "chrome/browser/profiles/profile.h"
8 #include "chrome/browser/ui/browser.h" 8 #include "chrome/browser/ui/browser.h"
9 #include "chrome/browser/ui/browser_finder.h" 9 #include "chrome/browser/ui/browser_finder.h"
10 #include "chrome/browser/ui/browser_navigator.h" 10 #include "chrome/browser/ui/browser_navigator.h"
(...skipping 64 matching lines...) Expand 10 before | Expand all | Expand 10 after
75 const gfx::Rect& initial_pos, 75 const gfx::Rect& initial_pos,
76 bool user_gesture) { 76 bool user_gesture) {
77 if (!context) 77 if (!context)
78 return; 78 return;
79 79
80 Profile* profile = Profile::FromBrowserContext(context); 80 Profile* profile = Profile::FromBrowserContext(context);
81 Browser* browser = browser::FindTabbedBrowser(profile, false); 81 Browser* browser = browser::FindTabbedBrowser(profile, false);
82 const bool browser_created = !browser; 82 const bool browser_created = !browser;
83 if (!browser) 83 if (!browser)
84 browser = new Browser(Browser::CreateParams(profile)); 84 browser = new Browser(Browser::CreateParams(profile));
85 TabContents* tab_contents = new TabContents(new_contents); 85 TabContents* tab_contents =
86 TabContents::Factory::CreateTabContents(new_contents);
86 chrome::NavigateParams params(browser, tab_contents); 87 chrome::NavigateParams params(browser, tab_contents);
87 // TODO(pinkerton): no way to get a TabContents for this. 88 // TODO(pinkerton): no way to get a TabContents for this.
88 // params.source_contents = source; 89 // params.source_contents = source;
89 params.disposition = disposition; 90 params.disposition = disposition;
90 params.window_bounds = initial_pos; 91 params.window_bounds = initial_pos;
91 params.window_action = chrome::NavigateParams::SHOW_WINDOW; 92 params.window_action = chrome::NavigateParams::SHOW_WINDOW;
92 params.user_gesture = true; 93 params.user_gesture = true;
93 chrome::Navigate(&params); 94 chrome::Navigate(&params);
94 95
95 // Close the browser if chrome::Navigate created a new one. 96 // Close the browser if chrome::Navigate created a new one.
96 if (browser_created && (browser != params.browser)) 97 if (browser_created && (browser != params.browser))
97 browser->window()->Close(); 98 browser->window()->Close();
98 } 99 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/external_tab_container_win.cc ('k') | chrome/browser/ui/webui/constrained_web_dialog_delegate_base.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698