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

Side by Side Diff: chrome/browser/ui/views/website_settings/permissions_bubble_view.cc

Issue 1262513002: Use vectorized icon for default extensions icons (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 5 years, 4 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/libgtk2ui/native_theme_gtk2.cc ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/website_settings/permissions_bubble_view.h" 5 #include "chrome/browser/ui/views/website_settings/permissions_bubble_view.h"
6 6
7 #include "base/prefs/pref_service.h" 7 #include "base/prefs/pref_service.h"
8 #include "base/strings/string16.h" 8 #include "base/strings/string16.h"
9 #include "chrome/browser/profiles/profile.h" 9 #include "chrome/browser/profiles/profile.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
11 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h" 11 #include "chrome/browser/ui/views/exclusive_access_bubble_views.h"
12 #include "chrome/browser/ui/views/frame/browser_view.h" 12 #include "chrome/browser/ui/views/frame/browser_view.h"
13 #include "chrome/browser/ui/views/frame/top_container_view.h" 13 #include "chrome/browser/ui/views/frame/top_container_view.h"
14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 14 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
15 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" 15 #include "chrome/browser/ui/views/location_bar/location_icon_view.h"
16 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h" 16 #include "chrome/browser/ui/views/website_settings/permission_selector_view.h"
17 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse rver.h" 17 #include "chrome/browser/ui/views/website_settings/permission_selector_view_obse rver.h"
18 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 18 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
19 #include "chrome/common/pref_names.h" 19 #include "chrome/common/pref_names.h"
20 #include "chrome/grit/generated_resources.h" 20 #include "chrome/grit/generated_resources.h"
21 #include "net/base/net_util.h" 21 #include "net/base/net_util.h"
22 #include "ui/accessibility/ax_view_state.h" 22 #include "ui/accessibility/ax_view_state.h"
23 #include "ui/base/l10n/l10n_util.h" 23 #include "ui/base/l10n/l10n_util.h"
24 #include "ui/base/models/combobox_model.h" 24 #include "ui/base/models/combobox_model.h"
25 #include "ui/base/resource/resource_bundle.h" 25 #include "ui/base/resource/resource_bundle.h"
26 #include "ui/gfx/paint_vector_icon.h" 26 #include "ui/gfx/paint_vector_icon.h"
27 #include "ui/gfx/text_constants.h" 27 #include "ui/gfx/text_constants.h"
28 #include "ui/native_theme/common_theme.h"
29 #include "ui/native_theme/native_theme.h"
28 #include "ui/views/bubble/bubble_delegate.h" 30 #include "ui/views/bubble/bubble_delegate.h"
29 #include "ui/views/bubble/bubble_frame_view.h" 31 #include "ui/views/bubble/bubble_frame_view.h"
30 #include "ui/views/controls/button/checkbox.h" 32 #include "ui/views/controls/button/checkbox.h"
31 #include "ui/views/controls/button/label_button.h" 33 #include "ui/views/controls/button/label_button.h"
32 #include "ui/views/controls/button/label_button_border.h" 34 #include "ui/views/controls/button/label_button_border.h"
33 #include "ui/views/controls/button/menu_button.h" 35 #include "ui/views/controls/button/menu_button.h"
34 #include "ui/views/controls/button/menu_button_listener.h" 36 #include "ui/views/controls/button/menu_button_listener.h"
35 #include "ui/views/controls/combobox/combobox.h" 37 #include "ui/views/controls/combobox/combobox.h"
36 #include "ui/views/controls/combobox/combobox_listener.h" 38 #include "ui/views/controls/combobox/combobox_listener.h"
37 #include "ui/views/controls/label.h" 39 #include "ui/views/controls/label.h"
(...skipping 199 matching lines...) Expand 10 before | Expand all | Expand 10 after
237 row_layout->StartRow(0, 0); 239 row_layout->StartRow(0, 0);
238 240
239 views::View* label_container = new views::View(); 241 views::View* label_container = new views::View();
240 label_container->SetLayoutManager( 242 label_container->SetLayoutManager(
241 new views::BoxLayout(views::BoxLayout::kHorizontal, 243 new views::BoxLayout(views::BoxLayout::kHorizontal,
242 kPermissionIndentSpacing, 244 kPermissionIndentSpacing,
243 0, kBubbleOuterMargin)); 245 0, kBubbleOuterMargin));
244 views::ImageView* icon = new views::ImageView(); 246 views::ImageView* icon = new views::ImageView();
245 gfx::VectorIconId vector_id = requests[index]->GetVectorIconId(); 247 gfx::VectorIconId vector_id = requests[index]->GetVectorIconId();
246 if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) { 248 if (vector_id != gfx::VectorIconId::VECTOR_ICON_NONE) {
247 // TODO(estade): move this color to a shared location? 249 SkColor grey;
248 icon->SetImage(gfx::CreateVectorIcon(vector_id, kIconSize, 250 ui::CommonThemeGetSystemColor(ui::NativeTheme::kColorId_ChromeIconGrey,
249 SkColorSetRGB(0x5A, 0x5A, 0x5A))); 251 &grey);
252 icon->SetImage(gfx::CreateVectorIcon(vector_id, kIconSize, grey));
250 } else { 253 } else {
251 icon->SetImage(bundle.GetImageSkiaNamed(requests.at(index)->GetIconID())); 254 icon->SetImage(bundle.GetImageSkiaNamed(requests.at(index)->GetIconID()));
252 icon->SetImageSize(gfx::Size(kIconSize, kIconSize)); 255 icon->SetImageSize(gfx::Size(kIconSize, kIconSize));
253 } 256 }
254 icon->SetTooltipText(base::string16()); // Redundant with the text fragment 257 icon->SetTooltipText(base::string16()); // Redundant with the text fragment
255 label_container->AddChildView(icon); 258 label_container->AddChildView(icon);
256 views::Label* label = 259 views::Label* label =
257 new views::Label(requests.at(index)->GetMessageTextFragment()); 260 new views::Label(requests.at(index)->GetMessageTextFragment());
258 label->SetHorizontalAlignment(gfx::ALIGN_LEFT); 261 label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
259 label_container->AddChildView(label); 262 label_container->AddChildView(label);
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
502 505
503 void PermissionBubbleViewViews::Accept() { 506 void PermissionBubbleViewViews::Accept() {
504 if (delegate_) 507 if (delegate_)
505 delegate_->Accept(); 508 delegate_->Accept();
506 } 509 }
507 510
508 void PermissionBubbleViewViews::Deny() { 511 void PermissionBubbleViewViews::Deny() {
509 if (delegate_) 512 if (delegate_)
510 delegate_->Deny(); 513 delegate_->Deny();
511 } 514 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/libgtk2ui/native_theme_gtk2.cc ('k') | ui/gfx/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698