| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/auto_reset.h" | 10 #include "base/auto_reset.h" |
| (...skipping 701 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 712 } | 712 } |
| 713 | 713 |
| 714 void AppLauncherHandler::HandleRecordAppLaunchByURL( | 714 void AppLauncherHandler::HandleRecordAppLaunchByURL( |
| 715 const base::ListValue* args) { | 715 const base::ListValue* args) { |
| 716 std::string url; | 716 std::string url; |
| 717 CHECK(args->GetString(0, &url)); | 717 CHECK(args->GetString(0, &url)); |
| 718 double source; | 718 double source; |
| 719 CHECK(args->GetDouble(1, &source)); | 719 CHECK(args->GetDouble(1, &source)); |
| 720 | 720 |
| 721 extension_misc::AppLaunchBucket bucket = | 721 extension_misc::AppLaunchBucket bucket = |
| 722 static_cast<extension_misc::AppLaunchBucket>(source); | 722 static_cast<extension_misc::AppLaunchBucket>(static_cast<int>(source)); |
| 723 CHECK(source < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 723 CHECK(source < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
| 724 | 724 |
| 725 RecordAppLaunchByURL(web_ui_->GetProfile(), url, bucket); | 725 RecordAppLaunchByURL(web_ui_->GetProfile(), url, bucket); |
| 726 } | 726 } |
| 727 | 727 |
| 728 void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle, | 728 void AppLauncherHandler::OnFaviconForApp(FaviconService::Handle handle, |
| 729 history::FaviconData data) { | 729 history::FaviconData data) { |
| 730 scoped_ptr<WebApplicationInfo> web_app( | 730 scoped_ptr<WebApplicationInfo> web_app( |
| 731 favicon_consumer_.GetClientDataForCurrentRequest()); | 731 favicon_consumer_.GetClientDataForCurrentRequest()); |
| 732 CHECK(!web_app->icons.empty()); | 732 CHECK(!web_app->icons.empty()); |
| (...skipping 168 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 901 | 901 |
| 902 void AppLauncherHandler::UninstallDefaultApps() { | 902 void AppLauncherHandler::UninstallDefaultApps() { |
| 903 AppsPromo* apps_promo = extension_service_->apps_promo(); | 903 AppsPromo* apps_promo = extension_service_->apps_promo(); |
| 904 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 904 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
| 905 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); | 905 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); |
| 906 iter != app_ids.end(); ++iter) { | 906 iter != app_ids.end(); ++iter) { |
| 907 if (extension_service_->GetExtensionById(*iter, true)) | 907 if (extension_service_->GetExtensionById(*iter, true)) |
| 908 extension_service_->UninstallExtension(*iter, false, NULL); | 908 extension_service_->UninstallExtension(*iter, false, NULL); |
| 909 } | 909 } |
| 910 } | 910 } |
| OLD | NEW |