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

Unified Diff: chrome/browser/ui/webui/web_dialog_web_contents_delegate.cc

Issue 10696222: Make chrome::Navigate take in a Browser* that is never NULL. That function doesn't have a context, … (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: sync Created 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/webui/web_dialog_web_contents_delegate.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/web_dialog_web_contents_delegate.cc
===================================================================
--- chrome/browser/ui/webui/web_dialog_web_contents_delegate.cc (revision 146674)
+++ chrome/browser/ui/webui/web_dialog_web_contents_delegate.cc (working copy)
@@ -6,6 +6,7 @@
#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/browser.h"
+#include "chrome/browser/ui/browser_finder.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/tab_contents/tab_contents.h"
#include "chrome/browser/ui/tabs/tab_strip_model.h"
@@ -48,11 +49,8 @@
if (!profile)
return NULL;
- // Specify a NULL browser for navigation. This will cause Navigate()
- // to find a browser matching params.profile or create a new one.
- Browser* browser = NULL;
+ Browser* browser = browser::FindOrCreateTabbedBrowser(profile);
chrome::NavigateParams nav_params(browser, params.url, params.transition);
- nav_params.profile = profile;
nav_params.referrer = params.referrer;
if (source && source->IsCrashed() &&
params.disposition == CURRENT_TAB &&
@@ -88,13 +86,9 @@
if (!profile)
return NULL;
- // Specify a NULL browser for navigation. This will cause Navigate()
- // to find a browser matching params.profile or create a new one.
- Browser* browser = NULL;
-
+ Browser* browser = browser::FindOrCreateTabbedBrowser(profile);
TabContents* tab_contents = new TabContents(new_contents);
chrome::NavigateParams params(browser, tab_contents);
- params.profile = profile;
// TODO(pinkerton): no way to get a TabContents for this.
// params.source_contents = source;
params.disposition = disposition;
« no previous file with comments | « chrome/browser/ui/webui/web_dialog_web_contents_delegate.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698