| 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 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return size; | 158 return size; |
| 153 } | 159 } |
| 154 | 160 |
| 155 void LocationIconView::SetBackground(bool should_show_ev) { | 161 void LocationIconView::SetBackground(bool should_show_ev) { |
| 156 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); | 162 static const int kEvBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); |
| 157 if (should_show_ev) | 163 if (should_show_ev) |
| 158 SetBackgroundImageGrid(kEvBackgroundImages); | 164 SetBackgroundImageGrid(kEvBackgroundImages); |
| 159 else | 165 else |
| 160 UnsetBackgroundImageGrid(); | 166 UnsetBackgroundImageGrid(); |
| 161 } | 167 } |
| OLD | NEW |