Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2306)

Unified Diff: chrome/browser/ui/app_list/search/webstore/webstore_result.cc

Issue 448543002: Allow installing paid apps from the launcher search results. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: partially clang format Created 6 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/app_list/search/webstore/webstore_result.cc
diff --git a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
index df9cfcf26f2e15e67254054301e6c530d3ee1da3..19dd22ed94492def6b1d8131121477d832790f88 100644
--- a/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
+++ b/chrome/browser/ui/app_list/search/webstore/webstore_result.cc
@@ -67,12 +67,14 @@ WebstoreResult::WebstoreResult(Profile* profile,
const std::string& app_id,
const std::string& localized_name,
const GURL& icon_url,
+ bool is_paid,
extensions::Manifest::Type item_type,
AppListControllerDelegate* controller)
: profile_(profile),
app_id_(app_id),
localized_name_(localized_name),
icon_url_(icon_url),
+ is_paid_(is_paid),
item_type_(item_type),
controller_(controller),
install_tracker_(NULL),
@@ -117,6 +119,13 @@ void WebstoreResult::Open(int event_flags) {
}
void WebstoreResult::InvokeAction(int action_index, int event_flags) {
+ if (is_paid_) {
+ // Paid apps cannot be installed directly from the launcher. Instead, open
+ // the webstore page for the app.
+ Open(event_flags);
+ return;
+ }
+
StartInstall(action_index == kLaunchEphemeralAppAction);
}
@@ -125,6 +134,7 @@ scoped_ptr<ChromeSearchResult> WebstoreResult::Duplicate() {
app_id_,
localized_name_,
icon_url_,
+ is_paid_,
item_type_,
controller_)).Pass();
}
@@ -160,9 +170,9 @@ void WebstoreResult::UpdateActions() {
l10n_util::GetStringUTF16(IDS_WEBSTORE_RESULT_INSTALL),
l10n_util::GetStringUTF16(
IDS_EXTENSION_INLINE_INSTALL_PROMPT_TITLE)));
-
- if (item_type_ == extensions::Manifest::TYPE_PLATFORM_APP ||
- item_type_ == extensions::Manifest::TYPE_HOSTED_APP) {
+ if ((item_type_ == extensions::Manifest::TYPE_PLATFORM_APP ||
+ item_type_ == extensions::Manifest::TYPE_HOSTED_APP) &&
+ !is_paid_) {
actions.push_back(Action(
l10n_util::GetStringUTF16(IDS_WEBSTORE_RESULT_LAUNCH),
l10n_util::GetStringUTF16(IDS_WEBSTORE_RESULT_LAUNCH_APP_TOOLTIP)));
« no previous file with comments | « chrome/browser/ui/app_list/search/webstore/webstore_result.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698