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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_install_dialog_view.cc

Issue 2683843004: harmony: update extension install dialog (Closed)
Patch Set: Created 3 years, 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "chrome/browser/ui/views/extensions/extension_install_dialog_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_install_dialog_view.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <algorithm> 8 #include <algorithm>
9 #include <string> 9 #include <string>
10 #include <utility> 10 #include <utility>
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after
238 // Add some space between the stars and the rating count. 238 // Add some space between the stars and the rating count.
239 rating_count->SetBorder(views::CreateEmptyBorder(0, 2, 0, 0)); 239 rating_count->SetBorder(views::CreateEmptyBorder(0, 2, 0, 0));
240 rating->AddChildView(rating_count); 240 rating->AddChildView(rating_count);
241 241
242 layout->StartRow(0, column_set_id); 242 layout->StartRow(0, column_set_id);
243 views::Label* user_count = 243 views::Label* user_count =
244 new views::Label(prompt_->GetUserCount(), small_font_list); 244 new views::Label(prompt_->GetUserCount(), small_font_list);
245 user_count->SetAutoColorReadabilityEnabled(false); 245 user_count->SetAutoColorReadabilityEnabled(false);
246 user_count->SetEnabledColor(SK_ColorGRAY); 246 user_count->SetEnabledColor(SK_ColorGRAY);
247 layout->AddView(user_count); 247 layout->AddView(user_count);
248
249 layout->StartRow(0, column_set_id);
250 views::Link* store_link = new views::Link(
251 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_STORE_LINK));
252 store_link->SetFontList(small_font_list);
253 store_link->set_listener(this);
254 layout->AddView(store_link);
255 } 248 }
256 249
257 if (prompt_->ShouldShowPermissions()) { 250 if (prompt_->ShouldShowPermissions()) {
258 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing); 251 layout->AddPaddingRow(0, views::kRelatedControlVerticalSpacing);
259 layout->StartRow(0, column_set_id); 252 layout->StartRow(0, column_set_id);
260 layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 3, 1, 253 layout->AddView(new views::Separator(views::Separator::HORIZONTAL), 3, 1,
261 views::GridLayout::FILL, views::GridLayout::FILL); 254 views::GridLayout::FILL, views::GridLayout::FILL);
262 } 255 }
263 256
264 const int content_width = 257 const int content_width =
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
552 545
553 void ExtensionInstallDialogView::Layout() { 546 void ExtensionInstallDialogView::Layout() {
554 container_->SetBounds(0, 0, width(), height()); 547 container_->SetBounds(0, 0, width(), height());
555 DialogDelegateView::Layout(); 548 DialogDelegateView::Layout();
556 } 549 }
557 550
558 gfx::Size ExtensionInstallDialogView::GetPreferredSize() const { 551 gfx::Size ExtensionInstallDialogView::GetPreferredSize() const {
559 return dialog_size_; 552 return dialog_size_;
560 } 553 }
561 554
555 views::View* ExtensionInstallDialogView::CreateExtraView() {
556 if (!prompt_->has_webstore_data())
557 return nullptr;
benwells 2017/02/10 01:56:06 optional nit: newline after return.
Elly Fong-Jones 2017/02/10 16:28:07 Done.
558 views::Link* store_link = new views::Link(
559 l10n_util::GetStringUTF16(IDS_EXTENSION_PROMPT_STORE_LINK));
560 store_link->set_listener(this);
561 return store_link;
562 }
563
562 void ExtensionInstallDialogView::UpdateInstallResultHistogram(bool accepted) 564 void ExtensionInstallDialogView::UpdateInstallResultHistogram(bool accepted)
563 const { 565 const {
564 if (prompt_->type() == ExtensionInstallPrompt::INSTALL_PROMPT) 566 if (prompt_->type() == ExtensionInstallPrompt::INSTALL_PROMPT)
565 UMA_HISTOGRAM_BOOLEAN("Extensions.InstallPrompt.Accepted", accepted); 567 UMA_HISTOGRAM_BOOLEAN("Extensions.InstallPrompt.Accepted", accepted);
566 } 568 }
567 569
568 // ExpandableContainerView::DetailsView ---------------------------------------- 570 // ExpandableContainerView::DetailsView ----------------------------------------
569 571
570 ExpandableContainerView::DetailsView::DetailsView(int horizontal_space, 572 ExpandableContainerView::DetailsView::DetailsView(int horizontal_space,
571 bool parent_bulleted) 573 bool parent_bulleted)
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after
731 gfx::ImageSkia icon = gfx::CreateVectorIcon( 733 gfx::ImageSkia icon = gfx::CreateVectorIcon(
732 expanded ? kCaretUpIcon : kCaretDownIcon, gfx::kChromeIconGrey); 734 expanded ? kCaretUpIcon : kCaretDownIcon, gfx::kChromeIconGrey);
733 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon); 735 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon);
734 } 736 }
735 737
736 // static 738 // static
737 ExtensionInstallPrompt::ShowDialogCallback 739 ExtensionInstallPrompt::ShowDialogCallback
738 ExtensionInstallPrompt::GetViewsShowDialogCallback() { 740 ExtensionInstallPrompt::GetViewsShowDialogCallback() {
739 return base::Bind(&ShowExtensionInstallDialogImpl); 741 return base::Bind(&ShowExtensionInstallDialogImpl);
740 } 742 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_install_dialog_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698