| 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/search/search.h" | 8 #include "chrome/browser/search/search.h" |
| 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 9 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 10 #include "grit/generated_resources.h" | 10 #include "grit/generated_resources.h" |
| 11 #include "ui/base/l10n/l10n_util.h" | 11 #include "ui/base/l10n/l10n_util.h" |
| 12 | 12 |
| 13 LocationIconView::LocationIconView(LocationBarView* location_bar) | 13 LocationIconView::LocationIconView(LocationBarView* location_bar) |
| 14 : page_info_helper_(this, location_bar) { | 14 : page_info_helper_(this, location_bar) { |
| 15 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON)); | 15 SetTooltipText(l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON)); |
| 16 LocationBarView::InitTouchableLocationBarChildView(this); | |
| 17 } | 16 } |
| 18 | 17 |
| 19 LocationIconView::~LocationIconView() { | 18 LocationIconView::~LocationIconView() { |
| 20 } | 19 } |
| 21 | 20 |
| 22 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { | 21 bool LocationIconView::OnMousePressed(const ui::MouseEvent& event) { |
| 23 if (event.IsOnlyMiddleMouseButton() && | 22 if (event.IsOnlyMiddleMouseButton() && |
| 24 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { | 23 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { |
| 25 base::string16 text; | 24 base::string16 text; |
| 26 ui::Clipboard::GetForCurrentThread()->ReadText( | 25 ui::Clipboard::GetForCurrentThread()->ReadText( |
| (...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 58 chrome::ShouldDisplayOriginChip()) | 57 chrome::ShouldDisplayOriginChip()) |
| 59 return; | 58 return; |
| 60 | 59 |
| 61 page_info_helper_.ProcessEvent(event); | 60 page_info_helper_.ProcessEvent(event); |
| 62 } | 61 } |
| 63 | 62 |
| 64 void LocationIconView::ShowTooltip(bool show) { | 63 void LocationIconView::ShowTooltip(bool show) { |
| 65 SetTooltipText(show ? | 64 SetTooltipText(show ? |
| 66 l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON) : base::string16()); | 65 l10n_util::GetStringUTF16(IDS_TOOLTIP_LOCATION_ICON) : base::string16()); |
| 67 } | 66 } |
| OLD | NEW |