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/dom_ui/app_launcher_handler.h" | 5 #include "chrome/browser/dom_ui/app_launcher_handler.h" |
6 | 6 |
7 #include "app/resource_bundle.h" | 7 #include "app/resource_bundle.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "base/values.h" | 10 #include "base/values.h" |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 NOTREACHED(); | 118 NOTREACHED(); |
119 return; | 119 return; |
120 } | 120 } |
121 | 121 |
122 Profile* profile = extensions_service_->profile(); | 122 Profile* profile = extensions_service_->profile(); |
123 if (launch_container.empty()) { | 123 if (launch_container.empty()) { |
124 Browser::OpenApplication(profile, extension_id); | 124 Browser::OpenApplication(profile, extension_id); |
125 return; | 125 return; |
126 } | 126 } |
127 | 127 |
| 128 // Override the default launch container. |
128 Extension* extension = | 129 Extension* extension = |
129 extensions_service_->GetExtensionById(extension_id, false); | 130 extensions_service_->GetExtensionById(extension_id, false); |
130 DCHECK(extension); | 131 DCHECK(extension); |
131 | 132 |
| 133 Extension::LaunchContainer container; |
132 if (launch_container == "tab") | 134 if (launch_container == "tab") |
133 Browser::OpenApplicationTab(profile, extension); | 135 container = Extension::LAUNCH_TAB; |
134 else if (launch_container == "panel") | 136 else if (launch_container == "panel") |
135 Browser::OpenApplicationWindow(profile, extension, GURL(), true); | 137 container = Extension::LAUNCH_PANEL; |
136 else if (launch_container == "window") | 138 else if (launch_container == "window") |
137 Browser::OpenApplicationWindow(profile, extension, GURL(), false); | 139 container = Extension::LAUNCH_WINDOW; |
138 else | 140 else |
139 NOTREACHED() << "Unexpected launch container: " << launch_container << "."; | 141 NOTREACHED() << "Unexpected launch container: " << launch_container << "."; |
| 142 |
| 143 Browser::OpenApplication(profile, extension, container); |
140 } | 144 } |
OLD | NEW |