OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 <algorithm> | 5 #include <algorithm> |
6 #include <vector> | 6 #include <vector> |
7 | 7 |
8 #include "base/memory/scoped_vector.h" | 8 #include "base/memory/scoped_vector.h" |
9 #include "base/time.h" | 9 #include "base/time.h" |
10 #include "chrome/browser/tab_contents/tab_util.h" | 10 #include "chrome/browser/tab_contents/tab_util.h" |
(...skipping 933 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
944 // Inline web contents row. | 944 // Inline web contents row. |
945 grid_layout->StartRow(0, 1); | 945 grid_layout->StartRow(0, 1); |
946 grid_layout->AddView(webview_, 1, 1, GridLayout::CENTER, | 946 grid_layout->AddView(webview_, 1, 1, GridLayout::CENTER, |
947 GridLayout::CENTER, kDialogMinWidth, 140); | 947 GridLayout::CENTER, kDialogMinWidth, 140); |
948 contents_->Layout(); | 948 contents_->Layout(); |
949 SizeToContents(); | 949 SizeToContents(); |
950 displaying_web_contents_ = true; | 950 displaying_web_contents_ = true; |
951 } | 951 } |
952 | 952 |
953 void WebIntentPickerViews::OnModelChanged(WebIntentPickerModel* model) { | 953 void WebIntentPickerViews::OnModelChanged(WebIntentPickerModel* model) { |
954 if (model->GetInstalledServiceCount() == 0) { | 954 if (model->GetInstalledServiceCount() == 0) { |
Peter Kasting
2012/05/16 22:09:27
Nit: While here, shorter:
suggestions_label_->S
groby-ooo-7-16
2012/05/16 23:03:07
Done.
| |
955 suggestions_label_->SetText(l10n_util::GetStringUTF16( | 955 suggestions_label_->SetText(l10n_util::GetStringUTF16( |
956 IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED)); | 956 IDS_INTENT_PICKER_GET_MORE_SERVICES_NONE_INSTALLED)); |
957 } else { | 957 } else { |
958 suggestions_label_->SetText( | 958 suggestions_label_->SetText( |
959 l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES)); | 959 l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES)); |
960 } | 960 } |
961 | 961 |
962 if (model->GetSuggestedExtensionCount() == 0) | |
Peter Kasting
2012/05/16 22:09:27
Nit: Simpler:
suggestions_label_->SetVisible(mo
groby-ooo-7-16
2012/05/16 23:03:07
Done.
| |
963 suggestions_label_->SetVisible(false); | |
964 else | |
965 suggestions_label_->SetVisible(true); | |
966 | |
962 service_buttons_->Update(); | 967 service_buttons_->Update(); |
963 extensions_->Update(); | 968 extensions_->Update(); |
964 contents_->Layout(); | 969 contents_->Layout(); |
965 SizeToContents(); | 970 SizeToContents(); |
966 } | 971 } |
967 | 972 |
968 void WebIntentPickerViews::OnFaviconChanged( | 973 void WebIntentPickerViews::OnFaviconChanged( |
969 WebIntentPickerModel* model, size_t index) { | 974 WebIntentPickerModel* model, size_t index) { |
970 service_buttons_->Update(); | 975 service_buttons_->Update(); |
971 contents_->Layout(); | 976 contents_->Layout(); |
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1092 // Padding row. | 1097 // Padding row. |
1093 grid_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 1098 grid_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
1094 | 1099 |
1095 // Service button row. | 1100 // Service button row. |
1096 grid_layout->StartRow(0, kFullWidthColumnSet); | 1101 grid_layout->StartRow(0, kFullWidthColumnSet); |
1097 service_buttons_ = new ServiceButtonsView(model_, this); | 1102 service_buttons_ = new ServiceButtonsView(model_, this); |
1098 grid_layout->AddView(service_buttons_); | 1103 grid_layout->AddView(service_buttons_); |
1099 | 1104 |
1100 // Row with app suggestions label. | 1105 // Row with app suggestions label. |
1101 grid_layout->StartRow(0, kIndentedFullWidthColumnSet); | 1106 grid_layout->StartRow(0, kIndentedFullWidthColumnSet); |
1102 suggestions_label_ = new views::Label( | 1107 suggestions_label_ = new views::Label(); |
1103 l10n_util::GetStringUTF16(IDS_INTENT_PICKER_GET_MORE_SERVICES)); | 1108 suggestions_label_->SetVisible(false); |
1104 suggestions_label_->SetMultiLine(true); | 1109 suggestions_label_->SetMultiLine(true); |
1105 suggestions_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); | 1110 suggestions_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); |
1106 grid_layout->AddView(suggestions_label_); | 1111 grid_layout->AddView(suggestions_label_); |
1107 | 1112 |
1108 // Padding row. | 1113 // Padding row. |
1109 grid_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); | 1114 grid_layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); |
1110 | 1115 |
1111 // Row with extension suggestions. | 1116 // Row with extension suggestions. |
1112 grid_layout->StartRow(0, kIndentedFullWidthColumnSet); | 1117 grid_layout->StartRow(0, kIndentedFullWidthColumnSet); |
1113 extensions_ = new SuggestedExtensionsView(model_, this); | 1118 extensions_ = new SuggestedExtensionsView(model_, this); |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1159 views::ImageButton* close_button = new views::ImageButton(this); | 1164 views::ImageButton* close_button = new views::ImageButton(this); |
1160 close_button->SetImage(views::CustomButton::BS_NORMAL, | 1165 close_button->SetImage(views::CustomButton::BS_NORMAL, |
1161 rb.GetBitmapNamed(IDR_CLOSE_BAR)); | 1166 rb.GetBitmapNamed(IDR_CLOSE_BAR)); |
1162 close_button->SetImage(views::CustomButton::BS_HOT, | 1167 close_button->SetImage(views::CustomButton::BS_HOT, |
1163 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); | 1168 rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); |
1164 close_button->SetImage(views::CustomButton::BS_PUSHED, | 1169 close_button->SetImage(views::CustomButton::BS_PUSHED, |
1165 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); | 1170 rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); |
1166 return close_button; | 1171 return close_button; |
1167 } | 1172 } |
1168 #endif | 1173 #endif |
OLD | NEW |