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/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
(...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
179 list->Append(app_info); | 179 list->Append(app_info); |
180 } | 180 } |
181 } | 181 } |
182 dictionary->Set("apps", list); | 182 dictionary->Set("apps", list); |
183 | 183 |
184 #if defined(OS_MACOSX) | 184 #if defined(OS_MACOSX) |
185 // App windows are not yet implemented on mac. | 185 // App windows are not yet implemented on mac. |
186 dictionary->SetBoolean("disableAppWindowLaunch", true); | 186 dictionary->SetBoolean("disableAppWindowLaunch", true); |
187 dictionary->SetBoolean("disableCreateAppShortcut", true); | 187 dictionary->SetBoolean("disableCreateAppShortcut", true); |
188 #endif | 188 #endif |
| 189 |
| 190 // We always show the launcher on Chrome OS. On Desktop Chrome, only show it |
| 191 // if we've installed our default apps. |
| 192 #if defined(OS_CHROMEOS) |
| 193 dictionary->SetBoolean("showLauncher", true); |
| 194 #else |
| 195 dictionary->SetBoolean( |
| 196 "showLauncher", |
| 197 extensions_service_->default_apps()->GetDefaultAppsInstalled()); |
| 198 #endif |
189 } | 199 } |
190 | 200 |
191 void AppLauncherHandler::HandleGetApps(const ListValue* args) { | 201 void AppLauncherHandler::HandleGetApps(const ListValue* args) { |
192 DictionaryValue dictionary; | 202 DictionaryValue dictionary; |
193 FillAppDictionary(&dictionary); | 203 FillAppDictionary(&dictionary); |
194 | 204 |
195 // Tell the client whether to show the promo for this view. We don't do this | 205 // Tell the client whether to show the promo for this view. We don't do this |
196 // in the case of PREF_CHANGED because: | 206 // in the case of PREF_CHANGED because: |
197 // | 207 // |
198 // a) At that point in time, depending on the pref that changed, it can look | 208 // a) At that point in time, depending on the pref that changed, it can look |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 // We make this check for the case of minimized windows, unit tests, etc. | 411 // We make this check for the case of minimized windows, unit tests, etc. |
402 if (platform_util::IsVisible(dom_ui_->tab_contents()->GetNativeView()) && | 412 if (platform_util::IsVisible(dom_ui_->tab_contents()->GetNativeView()) && |
403 Animation::ShouldRenderRichAnimation()) { | 413 Animation::ShouldRenderRichAnimation()) { |
404 #if defined(OS_WIN) | 414 #if defined(OS_WIN) |
405 AppLaunchedAnimation::Show(extension, rect); | 415 AppLaunchedAnimation::Show(extension, rect); |
406 #else | 416 #else |
407 NOTIMPLEMENTED(); | 417 NOTIMPLEMENTED(); |
408 #endif | 418 #endif |
409 } | 419 } |
410 } | 420 } |
OLD | NEW |