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

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

Issue 2480813003: Reduce views::Border creation verbosity by promoting factory functions (Closed)
Patch Set: fix bad merge Created 4 years, 1 month 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
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 218 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 rating->SetLayoutManager(new views::BoxLayout( 229 rating->SetLayoutManager(new views::BoxLayout(
230 views::BoxLayout::kHorizontal, 0, 0, 0)); 230 views::BoxLayout::kHorizontal, 0, 0, 0));
231 layout->AddView(rating); 231 layout->AddView(rating);
232 prompt_->AppendRatingStars(AddResourceIcon, rating); 232 prompt_->AppendRatingStars(AddResourceIcon, rating);
233 233
234 const gfx::FontList& small_font_list = 234 const gfx::FontList& small_font_list =
235 rb.GetFontList(ui::ResourceBundle::SmallFont); 235 rb.GetFontList(ui::ResourceBundle::SmallFont);
236 views::Label* rating_count = 236 views::Label* rating_count =
237 new views::Label(prompt_->GetRatingCount(), small_font_list); 237 new views::Label(prompt_->GetRatingCount(), small_font_list);
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::Border::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 248
249 layout->StartRow(0, column_set_id); 249 layout->StartRow(0, column_set_id);
(...skipping 482 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 expanded ? gfx::VectorIconId::FIND_PREV : gfx::VectorIconId::FIND_NEXT, 732 expanded ? gfx::VectorIconId::FIND_PREV : gfx::VectorIconId::FIND_NEXT,
733 gfx::kChromeIconGrey); 733 gfx::kChromeIconGrey);
734 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon); 734 arrow_toggle_->SetImage(views::Button::STATE_NORMAL, &icon);
735 } 735 }
736 736
737 // static 737 // static
738 ExtensionInstallPrompt::ShowDialogCallback 738 ExtensionInstallPrompt::ShowDialogCallback
739 ExtensionInstallPrompt::GetViewsShowDialogCallback() { 739 ExtensionInstallPrompt::GetViewsShowDialogCallback() {
740 return base::Bind(&ShowExtensionInstallDialogImpl); 740 return base::Bind(&ShowExtensionInstallDialogImpl);
741 } 741 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698