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

Unified Diff: chrome/browser/ui/views/web_intent_picker_views.cc

Issue 10387142: [Views, WebIntents] Hide suggestion label if none are available. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Fix review issues Created 8 years, 7 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 | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/web_intent_picker_views.cc
diff --git a/chrome/browser/ui/views/web_intent_picker_views.cc b/chrome/browser/ui/views/web_intent_picker_views.cc
index 3ce1a084b0385797f9dd265e42c522a2fb8deafd..639910d51a4b0036f84d3c314779ac72a577cb90 100644
--- a/chrome/browser/ui/views/web_intent_picker_views.cc
+++ b/chrome/browser/ui/views/web_intent_picker_views.cc
@@ -951,13 +951,12 @@ void WebIntentPickerViews::OnInlineDispositionWebContentsLoaded(
}
void WebIntentPickerViews::OnModelChanged(WebIntentPickerModel* model) {
- if (model->GetInstalledServiceCount() == 0) {
- suggestions_label_->SetText(l10n_util::GetStringUTF16(
- IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED));
- } else {
- suggestions_label_->SetText(
- l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES));
- }
+ suggestions_label_->SetText(l10n_util::GetStringUTF16(
+ model->GetInstalledServiceCount() ?
+ IDS_INTENT_PICKER_GET_MORE_SERVICES :
+ IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED));
+
+ suggestions_label_->SetVisible(model->GetSuggestedExtensionCount() > 0);
service_buttons_->Update();
extensions_->Update();
@@ -1099,8 +1098,8 @@ void WebIntentPickerViews::InitContents() {
// Row with app suggestions label.
grid_layout->StartRow(0, kIndentedFullWidthColumnSet);
- suggestions_label_ = new views::Label(
- l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES));
+ suggestions_label_ = new views::Label();
+ suggestions_label_->SetVisible(false);
suggestions_label_->SetMultiLine(true);
suggestions_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
grid_layout->AddView(suggestions_label_);
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698