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

Side by Side Diff: chrome/browser/ui/views/location_bar/content_setting_image_view.cc

Issue 1690543004: MacViews: Implement Full Keyboard Access. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 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/location_bar/content_setting_image_view.h" 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h"
6 6
7 #include "base/strings/utf_string_conversions.h" 7 #include "base/strings/utf_string_conversions.h"
8 #include "chrome/browser/themes/theme_properties.h" 8 #include "chrome/browser/themes/theme_properties.h"
9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h"
10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 static const int kBackgroundImages[] = 54 static const int kBackgroundImages[] =
55 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE); 55 IMAGE_GRID(IDR_OMNIBOX_CONTENT_SETTING_BUBBLE);
56 SetBackgroundImageGrid(kBackgroundImages); 56 SetBackgroundImageGrid(kBackgroundImages);
57 } 57 }
58 58
59 image()->SetHorizontalAlignment(base::i18n::IsRTL() 59 image()->SetHorizontalAlignment(base::i18n::IsRTL()
60 ? views::ImageView::TRAILING 60 ? views::ImageView::TRAILING
61 : views::ImageView::LEADING); 61 : views::ImageView::LEADING);
62 image()->set_interactive(true); 62 image()->set_interactive(true);
63 image()->EnableCanvasFlippingForRTLUI(true); 63 image()->EnableCanvasFlippingForRTLUI(true);
64 image()->SetAccessibilityFocusable(true); 64 image()->SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY);
65 label()->SetElideBehavior(gfx::NO_ELIDE); 65 label()->SetElideBehavior(gfx::NO_ELIDE);
66 label()->SetVisible(false); 66 label()->SetVisible(false);
67 67
68 slide_animator_.SetSlideDuration(kAnimationDurationMS); 68 slide_animator_.SetSlideDuration(kAnimationDurationMS);
69 slide_animator_.SetTweenType(gfx::Tween::LINEAR); 69 slide_animator_.SetTweenType(gfx::Tween::LINEAR);
70 } 70 }
71 71
72 ContentSettingImageView::~ContentSettingImageView() { 72 ContentSettingImageView::~ContentSettingImageView() {
73 if (bubble_view_ && bubble_view_->GetWidget()) 73 if (bubble_view_ && bubble_view_->GetWidget())
74 bubble_view_->GetWidget()->RemoveObserver(this); 74 bubble_view_->GetWidget()->RemoveObserver(this);
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after
285 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT); 285 bubble_view_->SetArrowPaintType(views::BubbleBorder::PAINT_TRANSPARENT);
286 } 286 }
287 bubble_widget->Show(); 287 bubble_widget->Show();
288 } 288 }
289 } 289 }
290 290
291 void ContentSettingImageView::UpdateImage() { 291 void ContentSettingImageView::UpdateImage() {
292 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia()); 292 SetImage(content_setting_image_model_->GetIcon(GetTextColor()).AsImageSkia());
293 image()->SetTooltipText(content_setting_image_model_->get_tooltip()); 293 image()->SetTooltipText(content_setting_image_model_->get_tooltip());
294 } 294 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698