Commit d3cd77b4 authored by groby@chromium.org's avatar groby@chromium.org

[Views, WebIntents] Hide suggestion label if none are available.

BUG=127996
TEST=none


Review URL: https://chromiumcodereview.appspot.com/10387142

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@137589 0039d316-1c4b-4281-b951-d872f2087c98
parent 28962019
...@@ -951,13 +951,12 @@ void WebIntentPickerViews::OnInlineDispositionWebContentsLoaded( ...@@ -951,13 +951,12 @@ void WebIntentPickerViews::OnInlineDispositionWebContentsLoaded(
} }
void WebIntentPickerViews::OnModelChanged(WebIntentPickerModel* model) { void WebIntentPickerViews::OnModelChanged(WebIntentPickerModel* model) {
if (model->GetInstalledServiceCount() == 0) { suggestions_label_->SetText(l10n_util::GetStringUTF16(
suggestions_label_->SetText(l10n_util::GetStringUTF16( model->GetInstalledServiceCount() ?
IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED)); IDS_INTENT_PICKER_GET_MORE_SERVICES :
} else { IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED));
suggestions_label_->SetText(
l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES)); suggestions_label_->SetVisible(model->GetSuggestedExtensionCount() > 0);
}
service_buttons_->Update(); service_buttons_->Update();
extensions_->Update(); extensions_->Update();
...@@ -1099,8 +1098,8 @@ void WebIntentPickerViews::InitContents() { ...@@ -1099,8 +1098,8 @@ void WebIntentPickerViews::InitContents() {
// Row with app suggestions label. // Row with app suggestions label.
grid_layout->StartRow(0, kIndentedFullWidthColumnSet); grid_layout->StartRow(0, kIndentedFullWidthColumnSet);
suggestions_label_ = new views::Label( suggestions_label_ = new views::Label();
l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES)); suggestions_label_->SetVisible(false);
suggestions_label_->SetMultiLine(true); suggestions_label_->SetMultiLine(true);
suggestions_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); suggestions_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT);
grid_layout->AddView(suggestions_label_); grid_layout->AddView(suggestions_label_);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment