OLD | NEW |
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/location_icon_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_icon_view.h" |
6 | 6 |
7 #include "base/strings/utf_string_conversions.h" | 7 #include "base/strings/utf_string_conversions.h" |
8 #include "chrome/browser/ssl/chrome_security_state_model_client.h" | 8 #include "chrome/browser/ssl/chrome_security_state_model_client.h" |
9 #include "chrome/browser/ui/view_ids.h" | 9 #include "chrome/browser/ui/view_ids.h" |
10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 10 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 LocationIconView::LocationIconView(const gfx::FontList& font_list, | 51 LocationIconView::LocationIconView(const gfx::FontList& font_list, |
52 SkColor parent_background_color, | 52 SkColor parent_background_color, |
53 LocationBarView* location_bar) | 53 LocationBarView* location_bar) |
54 : IconLabelBubbleView(IDR_OMNIBOX_HTTPS_INVALID, | 54 : IconLabelBubbleView(IDR_OMNIBOX_HTTPS_INVALID, |
55 font_list, | 55 font_list, |
56 parent_background_color, | 56 parent_background_color, |
57 true), | 57 true), |
58 suppress_mouse_released_action_(false), | 58 suppress_mouse_released_action_(false), |
59 location_bar_(location_bar) { | 59 location_bar_(location_bar) { |
60 set_id(VIEW_ID_LOCATION_ICON); | 60 set_id(VIEW_ID_LOCATION_ICON); |
61 SetFocusable(true); | 61 |
| 62 #if defined(OS_MACOSX) |
| 63 SetFocusBehavior(views::View::FocusBehavior::ACCESSIBLE_ONLY); |
| 64 #else |
| 65 SetFocusBehavior(views::View::FocusBehavior::ALWAYS); |
| 66 #endif |
62 SetBackground(false); | 67 SetBackground(false); |
63 } | 68 } |
64 | 69 |
65 LocationIconView::~LocationIconView() { | 70 LocationIconView::~LocationIconView() { |
66 } | 71 } |
67 | 72 |
68 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { | 73 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
69 if (event.IsOnlyMiddleMouseButton() && | 74 if (event.IsOnlyMiddleMouseButton() && |
70 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { | 75 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { |
71 base::string16 text; | 76 base::string16 text; |
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
171 return size; | 176 return size; |
172 } | 177 } |
173 | 178 |
174 void LocationIconView::SetBackground(bool should_show_ev) { | 179 void LocationIconView::SetBackground(bool should_show_ev) { |
175 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); | 180 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); |
176 if (should_show_ev) | 181 if (should_show_ev) |
177 SetBackgroundImageGrid(kEvBackgroundImages); | 182 SetBackgroundImageGrid(kEvBackgroundImages); |
178 else | 183 else |
179 UnsetBackgroundImageGrid(); | 184 UnsetBackgroundImageGrid(); |
180 } | 185 } |
OLD | NEW |