| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
| 8 #include <shellapi.h> | 8 #include <shellapi.h> |
| 9 #include <windows.h> | 9 #include <windows.h> |
| 10 #endif // OS_WIN | 10 #endif // OS_WIN |
| (...skipping 524 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 535 GURL url; | 535 GURL url; |
| 536 if (!url_input.is_empty()) { | 536 if (!url_input.is_empty()) { |
| 537 if (extension) | 537 if (extension) |
| 538 DCHECK(extension->web_extent().ContainsURL(url_input)); | 538 DCHECK(extension->web_extent().ContainsURL(url_input)); |
| 539 url = url_input; | 539 url = url_input; |
| 540 } else { | 540 } else { |
| 541 DCHECK(extension); | 541 DCHECK(extension); |
| 542 url = extension->GetFullLaunchURL(); | 542 url = extension->GetFullLaunchURL(); |
| 543 } | 543 } |
| 544 | 544 |
| 545 // TODO(erikkay) this can't be correct for extensions | 545 std::string app_name; |
| 546 std::string app_name = web_app::GenerateApplicationNameFromURL(url); | 546 if (extension) |
| 547 app_name = |
| 548 web_app::GenerateApplicationNameFromExtensionId(extension->id()); |
| 549 else |
| 550 app_name = web_app::GenerateApplicationNameFromURL(url); |
| 551 |
| 547 RegisterAppPrefs(app_name); | 552 RegisterAppPrefs(app_name); |
| 548 | 553 |
| 549 bool as_panel = extension && (container == extension_misc::LAUNCH_PANEL); | 554 bool as_panel = extension && (container == extension_misc::LAUNCH_PANEL); |
| 550 | 555 |
| 551 gfx::Size window_size; | 556 gfx::Size window_size; |
| 552 if (extension) | 557 if (extension) |
| 553 window_size.SetSize(extension->launch_width(), | 558 window_size.SetSize(extension->launch_width(), |
| 554 extension->launch_height()); | 559 extension->launch_height()); |
| 555 | 560 |
| 556 Browser* browser = Browser::CreateForApp(app_name, window_size, profile, | 561 Browser* browser = Browser::CreateForApp(app_name, window_size, profile, |
| (...skipping 3655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4212 // The page transition below is only for the purpose of inserting the tab. | 4217 // The page transition below is only for the purpose of inserting the tab. |
| 4213 browser->AddTab(contents_dupe, PageTransition::LINK); | 4218 browser->AddTab(contents_dupe, PageTransition::LINK); |
| 4214 } | 4219 } |
| 4215 | 4220 |
| 4216 if (profile_->HasSessionService()) { | 4221 if (profile_->HasSessionService()) { |
| 4217 SessionService* session_service = profile_->GetSessionService(); | 4222 SessionService* session_service = profile_->GetSessionService(); |
| 4218 if (session_service) | 4223 if (session_service) |
| 4219 session_service->TabRestored(&new_contents->controller(), pinned); | 4224 session_service->TabRestored(&new_contents->controller(), pinned); |
| 4220 } | 4225 } |
| 4221 } | 4226 } |
| OLD | NEW |