Index: chrome/browser/browser.cc |
=================================================================== |
--- chrome/browser/browser.cc (revision 9030) |
+++ chrome/browser/browser.cc (working copy) |
@@ -309,17 +309,13 @@ |
} |
// static |
-void Browser::OpenWebApplication(Profile* profile, WebApp* app) { |
-#if defined(OS_WIN) |
- const std::wstring& app_name = |
- app->name().empty() ? ComputeApplicationNameFromURL(app->url()) : |
- app->name(); |
+void Browser::OpenApplicationWindow(Profile* profile, const GURL& url) { |
+ const std::wstring& app_name = ComputeApplicationNameFromURL(url); |
brettw
2009/02/02 06:26:46
While not wrong, I think this is better as a std::
|
RegisterAppPrefs(app_name); |
Browser* browser = Browser::CreateForApp(app_name, profile); |
- browser->AddWebApplicationTab(profile, app, false); |
+ browser->AddTabWithURL(url, GURL(), PageTransition::START_PAGE, true, NULL); |
browser->window()->Show(); |
-#endif |
} |
/////////////////////////////////////////////////////////////////////////////// |
@@ -489,32 +485,6 @@ |
return contents; |
} |
-#if defined(OS_WIN) |
- |
-TabContents* Browser::AddWebApplicationTab(Profile* profile, |
- WebApp* web_app, |
- bool lazy) { |
- DCHECK(web_app); |
- |
- // TODO(acw): Do we need an "application launched" transition type? |
- // TODO(creis): Should we reuse the current instance (ie. process) here? |
- TabContents* contents = |
- CreateTabContentsForURL(web_app->url(), GURL(), profile, |
- PageTransition::LINK, lazy, NULL); |
- WebContents* web_contents = contents->AsWebContents(); |
- if (web_contents) |
- web_contents->SetWebApp(web_app); |
- |
- if (lazy) { |
- contents->controller()->LoadURLLazily( |
- web_app->url(), GURL(), PageTransition::LINK, web_app->name(), NULL); |
- } |
- tabstrip_model_.AddTabContents(contents, -1, PageTransition::LINK, !lazy); |
- return contents; |
-} |
- |
-#endif |
- |
TabContents* Browser::AddTabWithNavigationController( |
NavigationController* ctrl, PageTransition::Type type) { |
TabContents* tc = ctrl->active_contents(); |
@@ -1832,19 +1802,12 @@ |
} |
void Browser::ConvertContentsToApplication(TabContents* contents) { |
- WebContents* web_contents = contents->AsWebContents(); |
- if (!web_contents || !web_contents->web_app()) { |
- NOTREACHED(); |
- return; |
- } |
- |
int index = tabstrip_model_.GetIndexOfTabContents(contents); |
if (index < 0) |
return; |
- WebApp* app = web_contents->web_app(); |
- const std::wstring& app_name = app->name().empty() ? |
- ComputeApplicationNameFromURL(app->url()) : app->name(); |
+ const GURL& url = contents->controller()->GetActiveEntry()->url(); |
+ const std::wstring& app_name = ComputeApplicationNameFromURL(url); |
brettw
2009/02/02 06:26:46
Same string comment.
|
RegisterAppPrefs(app_name); |
tabstrip_model_.DetachTabContentsAt(index); |
@@ -2448,6 +2411,8 @@ |
window_->Close(); |
} |
+#endif // OS_WIN |
+ |
// static |
std::wstring Browser::ComputeApplicationNameFromURL(const GURL& url) { |
std::string t; |
@@ -2479,5 +2444,3 @@ |
prefs->RegisterDictionaryPref(window_pref.c_str()); |
} |
- |
-#endif // OS_WIN |