OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/webui/ntp/app_launcher_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "apps/metrics_names.h" | 9 #include "apps/metrics_names.h" |
10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
(...skipping 362 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
373 for (std::set<std::string>::iterator it = visible_apps_.begin(); | 373 for (std::set<std::string>::iterator it = visible_apps_.begin(); |
374 it != visible_apps_.end(); ++it) { | 374 it != visible_apps_.end(); ++it) { |
375 const Extension* extension = extension_service_->GetInstalledExtension(*it); | 375 const Extension* extension = extension_service_->GetInstalledExtension(*it); |
376 if (extension && ShouldDisplayInNewTabPage(extension, prefs)) { | 376 if (extension && ShouldDisplayInNewTabPage(extension, prefs)) { |
377 base::DictionaryValue* app_info = GetAppInfo(extension); | 377 base::DictionaryValue* app_info = GetAppInfo(extension); |
378 list->Append(app_info); | 378 list->Append(app_info); |
379 } | 379 } |
380 } | 380 } |
381 | 381 |
382 dictionary->Set("apps", list); | 382 dictionary->Set("apps", list); |
383 | 383 |
Dan Beam
2014/05/23 19:20:51
can you just remove from here
jackhou1
2014/05/25 03:44:53
Done.
| |
384 // TODO(estade): remove these settings when the old NTP is removed. The new | 384 // TODO(estade): remove these settings when the old NTP is removed. The new |
385 // NTP does it in js. | 385 // NTP does it in js. |
386 #if defined(OS_MACOSX) | 386 #if defined(OS_MACOSX) |
387 // App windows are not yet implemented on mac. | 387 // App windows are not yet implemented on mac. |
388 dictionary->SetBoolean("disableAppWindowLaunch", true); | 388 dictionary->SetBoolean("disableAppWindowLaunch", true); |
389 dictionary->SetBoolean("disableCreateAppShortcut", true); | |
390 #endif | 389 #endif |
391 | 390 |
392 #if defined(OS_CHROMEOS) | 391 #if defined(OS_CHROMEOS) |
393 // Making shortcut does not make sense on ChromeOS because it does not have | 392 // Making shortcut does not make sense on ChromeOS because it does not have |
394 // a desktop. | 393 // a desktop. |
395 dictionary->SetBoolean("disableCreateAppShortcut", true); | 394 dictionary->SetBoolean("disableCreateAppShortcut", true); |
396 #endif | 395 #endif |
Dan Beam
2014/05/23 19:20:51
to here?
| |
397 | 396 |
398 const base::ListValue* app_page_names = | 397 const base::ListValue* app_page_names = |
399 prefs->GetList(prefs::kNtpAppPageNames); | 398 prefs->GetList(prefs::kNtpAppPageNames); |
400 if (!app_page_names || !app_page_names->GetSize()) { | 399 if (!app_page_names || !app_page_names->GetSize()) { |
401 ListPrefUpdate update(prefs, prefs::kNtpAppPageNames); | 400 ListPrefUpdate update(prefs, prefs::kNtpAppPageNames); |
402 base::ListValue* list = update.Get(); | 401 base::ListValue* list = update.Get(); |
403 list->Set(0, new base::StringValue( | 402 list->Set(0, new base::StringValue( |
404 l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME))); | 403 l10n_util::GetStringUTF16(IDS_APP_DEFAULT_PAGE_NAME))); |
405 dictionary->Set("appPageNames", | 404 dictionary->Set("appPageNames", |
406 static_cast<base::ListValue*>(list->DeepCopy())); | 405 static_cast<base::ListValue*>(list->DeepCopy())); |
(...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
851 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { | 850 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { |
852 if (!extension_uninstall_dialog_.get()) { | 851 if (!extension_uninstall_dialog_.get()) { |
853 Browser* browser = chrome::FindBrowserWithWebContents( | 852 Browser* browser = chrome::FindBrowserWithWebContents( |
854 web_ui()->GetWebContents()); | 853 web_ui()->GetWebContents()); |
855 extension_uninstall_dialog_.reset( | 854 extension_uninstall_dialog_.reset( |
856 ExtensionUninstallDialog::Create(extension_service_->profile(), | 855 ExtensionUninstallDialog::Create(extension_service_->profile(), |
857 browser, this)); | 856 browser, this)); |
858 } | 857 } |
859 return extension_uninstall_dialog_.get(); | 858 return extension_uninstall_dialog_.get(); |
860 } | 859 } |
OLD | NEW |