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 17 matching lines...) Expand all Loading... |
28 LocationIconView::LocationIconView(const gfx::FontList& font_list, | 28 LocationIconView::LocationIconView(const gfx::FontList& font_list, |
29 SkColor parent_background_color, | 29 SkColor parent_background_color, |
30 LocationBarView* location_bar) | 30 LocationBarView* location_bar) |
31 : IconLabelBubbleView(IDR_OMNIBOX_HTTPS_INVALID, | 31 : IconLabelBubbleView(IDR_OMNIBOX_HTTPS_INVALID, |
32 font_list, | 32 font_list, |
33 parent_background_color, | 33 parent_background_color, |
34 true), | 34 true), |
35 suppress_mouse_released_action_(false), | 35 suppress_mouse_released_action_(false), |
36 location_bar_(location_bar) { | 36 location_bar_(location_bar) { |
37 set_id(VIEW_ID_LOCATION_ICON); | 37 set_id(VIEW_ID_LOCATION_ICON); |
| 38 |
| 39 #if defined(OS_MACOSX) |
| 40 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 41 #else |
38 SetFocusBehavior(FocusBehavior::ALWAYS); | 42 SetFocusBehavior(FocusBehavior::ALWAYS); |
| 43 #endif |
| 44 |
39 SetBackground(false); | 45 SetBackground(false); |
40 } | 46 } |
41 | 47 |
42 LocationIconView::~LocationIconView() { | 48 LocationIconView::~LocationIconView() { |
43 } | 49 } |
44 | 50 |
45 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { | 51 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
46 if (event.IsOnlyMiddleMouseButton() && | 52 if (event.IsOnlyMiddleMouseButton() && |
47 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { | 53 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { |
48 base::string16 text; | 54 base::string16 text; |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 return size; | 162 return size; |
157 } | 163 } |
158 | 164 |
159 void LocationIconView::SetBackground(bool should_show_ev) { | 165 void LocationIconView::SetBackground(bool should_show_ev) { |
160 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); | 166 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); |
161 if (should_show_ev) | 167 if (should_show_ev) |
162 SetBackgroundImageGrid(kEvBackgroundImages); | 168 SetBackgroundImageGrid(kEvBackgroundImages); |
163 else | 169 else |
164 UnsetBackgroundImageGrid(); | 170 UnsetBackgroundImageGrid(); |
165 } | 171 } |
OLD | NEW |