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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
52 #include "webkit/glue/window_open_disposition.h" | 52 #include "webkit/glue/window_open_disposition.h" |
53 | 53 |
54 namespace { | 54 namespace { |
55 | 55 |
56 // The URL prefixes used by the NTP to signal when the web store or an app | 56 // The URL prefixes used by the NTP to signal when the web store or an app |
57 // has launched so we can record the proper histogram. | 57 // has launched so we can record the proper histogram. |
58 const char* kPingLaunchAppByID = "record-app-launch-by-id"; | 58 const char* kPingLaunchAppByID = "record-app-launch-by-id"; |
59 const char* kPingLaunchWebStore = "record-webstore-launch"; | 59 const char* kPingLaunchWebStore = "record-webstore-launch"; |
60 const char* kPingLaunchAppByURL = "record-app-launch-by-url"; | 60 const char* kPingLaunchAppByURL = "record-app-launch-by-url"; |
61 | 61 |
62 const UnescapeRule::Type kUnescapeRules = | 62 const net::UnescapeRule::Type kUnescapeRules = |
63 UnescapeRule::NORMAL | UnescapeRule::URL_SPECIAL_CHARS; | 63 net::UnescapeRule::NORMAL | net::UnescapeRule::URL_SPECIAL_CHARS; |
64 | 64 |
65 extension_misc::AppLaunchBucket ParseLaunchSource( | 65 extension_misc::AppLaunchBucket ParseLaunchSource( |
66 const std::string& launch_source) { | 66 const std::string& launch_source) { |
67 int bucket_num = extension_misc::APP_LAUNCH_BUCKET_INVALID; | 67 int bucket_num = extension_misc::APP_LAUNCH_BUCKET_INVALID; |
68 base::StringToInt(launch_source, &bucket_num); | 68 base::StringToInt(launch_source, &bucket_num); |
69 extension_misc::AppLaunchBucket bucket = | 69 extension_misc::AppLaunchBucket bucket = |
70 static_cast<extension_misc::AppLaunchBucket>(bucket_num); | 70 static_cast<extension_misc::AppLaunchBucket>(bucket_num); |
71 CHECK(bucket < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); | 71 CHECK(bucket < extension_misc::APP_LAUNCH_BUCKET_BOUNDARY); |
72 return bucket; | 72 return bucket; |
73 } | 73 } |
(...skipping 975 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1049 | 1049 |
1050 void AppLauncherHandler::UninstallDefaultApps() { | 1050 void AppLauncherHandler::UninstallDefaultApps() { |
1051 AppsPromo* apps_promo = extension_service_->apps_promo(); | 1051 AppsPromo* apps_promo = extension_service_->apps_promo(); |
1052 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); | 1052 const ExtensionIdSet& app_ids = apps_promo->old_default_apps(); |
1053 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); | 1053 for (ExtensionIdSet::const_iterator iter = app_ids.begin(); |
1054 iter != app_ids.end(); ++iter) { | 1054 iter != app_ids.end(); ++iter) { |
1055 if (extension_service_->GetExtensionById(*iter, true)) | 1055 if (extension_service_->GetExtensionById(*iter, true)) |
1056 extension_service_->UninstallExtension(*iter, false, NULL); | 1056 extension_service_->UninstallExtension(*iter, false, NULL); |
1057 } | 1057 } |
1058 } | 1058 } |
OLD | NEW |