| 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 |
| 62 #if defined(OS_MACOSX) |
| 63 SetFocusBehavior(FocusBehavior::ACCESSIBLE_ONLY); |
| 64 #else |
| 61 SetFocusBehavior(FocusBehavior::ALWAYS); | 65 SetFocusBehavior(FocusBehavior::ALWAYS); |
| 66 #endif |
| 67 |
| 62 SetBackground(false); | 68 SetBackground(false); |
| 63 } | 69 } |
| 64 | 70 |
| 65 LocationIconView::~LocationIconView() { | 71 LocationIconView::~LocationIconView() { |
| 66 } | 72 } |
| 67 | 73 |
| 68 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { | 74 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
| 69 if (event.IsOnlyMiddleMouseButton() && | 75 if (event.IsOnlyMiddleMouseButton() && |
| 70 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { | 76 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { |
| 71 base::string16 text; | 77 base::string16 text; |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 return size; | 177 return size; |
| 172 } | 178 } |
| 173 | 179 |
| 174 void LocationIconView::SetBackground(bool should_show_ev) { | 180 void LocationIconView::SetBackground(bool should_show_ev) { |
| 175 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); | 181 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); |
| 176 if (should_show_ev) | 182 if (should_show_ev) |
| 177 SetBackgroundImageGrid(kEvBackgroundImages); | 183 SetBackgroundImageGrid(kEvBackgroundImages); |
| 178 else | 184 else |
| 179 UnsetBackgroundImageGrid(); | 185 UnsetBackgroundImageGrid(); |
| 180 } | 186 } |
| OLD | NEW |