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

Side by Side Diff: chrome/browser/ui/views/find_bar_view.cc

Issue 1406613002: For some vector icons, get the size from the vector definition. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
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/find_bar_view.h" 5 #include "chrome/browser/ui/views/find_bar_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/strings/string_number_conversions.h" 9 #include "base/strings/string_number_conversions.h"
10 #include "base/strings/string_util.h" 10 #include "base/strings/string_util.h"
(...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after
549 549
550 for (size_t i = 0; i < arraysize(button_images); ++i) { 550 for (size_t i = 0; i < arraysize(button_images); ++i) {
551 views::ImageButton* button = button_images[i].button; 551 views::ImageButton* button = button_images[i].button;
552 button->SetBorder(views::Border::CreateEmptyBorder( 552 button->SetBorder(views::Border::CreateEmptyBorder(
553 kButtonExtraTouchSize, kButtonExtraTouchSize, kButtonExtraTouchSize, 553 kButtonExtraTouchSize, kButtonExtraTouchSize, kButtonExtraTouchSize,
554 kButtonExtraTouchSize)); 554 kButtonExtraTouchSize));
555 button->SetImageAlignment(views::ImageButton::ALIGN_CENTER, 555 button->SetImageAlignment(views::ImageButton::ALIGN_CENTER,
556 views::ImageButton::ALIGN_MIDDLE); 556 views::ImageButton::ALIGN_MIDDLE);
557 557
558 gfx::ImageSkia image = 558 gfx::ImageSkia image =
559 gfx::CreateVectorIcon(button_images[i].id, 16, gfx::kChromeIconGrey); 559 gfx::CreatePrimaryVectorIcon(button_images[i].id, gfx::kChromeIconGrey);
560 button->SetImage(views::CustomButton::STATE_NORMAL, &image); 560 button->SetImage(views::CustomButton::STATE_NORMAL, &image);
561 image = gfx::CreateVectorIcon(button_images[i].id, 16, 561 image = gfx::CreatePrimaryVectorIcon(
562 SkColorSetA(gfx::kChromeIconGrey, 0xff / 2)); 562 button_images[i].id, SkColorSetA(gfx::kChromeIconGrey, 0xff / 2));
563 button->SetImage(views::CustomButton::STATE_DISABLED, &image); 563 button->SetImage(views::CustomButton::STATE_DISABLED, &image);
564 } 564 }
565 565
566 views::BoxLayout* manager = 566 views::BoxLayout* manager =
567 new views::BoxLayout(views::BoxLayout::kHorizontal, kInteriorPadding, 567 new views::BoxLayout(views::BoxLayout::kHorizontal, kInteriorPadding,
568 kInteriorPadding, kInterChildSpacing); 568 kInteriorPadding, kInterChildSpacing);
569 SetLayoutManager(manager); 569 SetLayoutManager(manager);
570 manager->SetFlexForView(find_text_, 1); 570 manager->SetFlexForView(find_text_, 1);
571 } 571 }
572 572
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after
654 void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) { 654 void FindBarView::OnNativeThemeChanged(const ui::NativeTheme* theme) {
655 if (!ui::MaterialDesignController::IsModeMaterial()) 655 if (!ui::MaterialDesignController::IsModeMaterial())
656 return; 656 return;
657 657
658 SkColor color = 658 SkColor color =
659 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground); 659 theme->GetSystemColor(ui::NativeTheme::kColorId_DialogBackground);
660 set_background(views::Background::CreateSolidBackground(color)); 660 set_background(views::Background::CreateSolidBackground(color));
661 match_count_text_->SetBackgroundColor(color); 661 match_count_text_->SetBackgroundColor(color);
662 match_count_text_->SetEnabledColor(kMatchTextColorMD); 662 match_count_text_->SetEnabledColor(kMatchTextColorMD);
663 } 663 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698