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/animation.h" | 7 #include "app/animation.h" |
8 #include "base/string_number_conversions.h" | 8 #include "base/string_number_conversions.h" |
9 #include "base/string_util.h" | 9 #include "base/string_util.h" |
10 #include "base/utf_string_conversions.h" | 10 #include "base/utf_string_conversions.h" |
(...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
146 } | 146 } |
147 dictionary->Set("apps", list); | 147 dictionary->Set("apps", list); |
148 | 148 |
149 DefaultApps* default_apps = extensions_service_->default_apps(); | 149 DefaultApps* default_apps = extensions_service_->default_apps(); |
150 if (default_apps->ShouldShowPromo(extensions_service_->GetAppIds())) { | 150 if (default_apps->ShouldShowPromo(extensions_service_->GetAppIds())) { |
151 dictionary->SetBoolean("showPromo", true); | 151 dictionary->SetBoolean("showPromo", true); |
152 default_apps->DidShowPromo(); | 152 default_apps->DidShowPromo(); |
153 } else { | 153 } else { |
154 dictionary->SetBoolean("showPromo", false); | 154 dictionary->SetBoolean("showPromo", false); |
155 } | 155 } |
| 156 |
| 157 bool showLauncher = |
| 158 CommandLine::ForCurrentProcess()->HasSwitch(switches::kEnableAppLauncher); |
| 159 dictionary->SetBoolean("showLauncher", showLauncher); |
156 } | 160 } |
157 | 161 |
158 void AppLauncherHandler::HandleGetApps(const ListValue* args) { | 162 void AppLauncherHandler::HandleGetApps(const ListValue* args) { |
159 DictionaryValue dictionary; | 163 DictionaryValue dictionary; |
160 FillAppDictionary(&dictionary); | 164 FillAppDictionary(&dictionary); |
161 dom_ui_->CallJavascriptFunction(L"getAppsCallback", dictionary); | 165 dom_ui_->CallJavascriptFunction(L"getAppsCallback", dictionary); |
162 | 166 |
163 // First time we get here we set up the observer so that we can tell update | 167 // First time we get here we set up the observer so that we can tell update |
164 // the apps as they change. | 168 // the apps as they change. |
165 if (registrar_.IsEmpty()) { | 169 if (registrar_.IsEmpty()) { |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
284 return; | 288 return; |
285 | 289 |
286 extensions_service_->UninstallExtension(extension_id_prompting_, | 290 extensions_service_->UninstallExtension(extension_id_prompting_, |
287 false /* external_uninstall */); | 291 false /* external_uninstall */); |
288 extension_id_prompting_ = ""; | 292 extension_id_prompting_ = ""; |
289 } | 293 } |
290 | 294 |
291 void AppLauncherHandler::InstallUIAbort() { | 295 void AppLauncherHandler::InstallUIAbort() { |
292 extension_id_prompting_ = ""; | 296 extension_id_prompting_ = ""; |
293 } | 297 } |
OLD | NEW |