| 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 "chrome/browser/ui/view_ids.h" | 7 #include "chrome/browser/ui/view_ids.h" |
| 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 9 #include "chrome/browser/ui/views/page_info/page_info_popup_view.h" | 9 #include "chrome/browser/ui/views/page_info/page_info_bubble_view.h" |
| 10 #include "chrome/grit/generated_resources.h" | 10 #include "chrome/grit/generated_resources.h" |
| 11 #include "chrome/grit/theme_resources.h" | 11 #include "chrome/grit/theme_resources.h" |
| 12 #include "components/grit/components_scaled_resources.h" | 12 #include "components/grit/components_scaled_resources.h" |
| 13 #include "components/omnibox/browser/omnibox_edit_model.h" | 13 #include "components/omnibox/browser/omnibox_edit_model.h" |
| 14 #include "content/public/browser/web_contents.h" | 14 #include "content/public/browser/web_contents.h" |
| 15 #include "ui/accessibility/ax_node_data.h" | 15 #include "ui/accessibility/ax_node_data.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/views/controls/label.h" | 17 #include "ui/views/controls/label.h" |
| 18 | 18 |
| 19 using content::WebContents; | 19 using content::WebContents; |
| (...skipping 27 matching lines...) Expand all Loading... |
| 47 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { | 47 ui::Clipboard::IsSupportedClipboardType(ui::CLIPBOARD_TYPE_SELECTION)) { |
| 48 base::string16 text; | 48 base::string16 text; |
| 49 ui::Clipboard::GetForCurrentThread()->ReadText( | 49 ui::Clipboard::GetForCurrentThread()->ReadText( |
| 50 ui::CLIPBOARD_TYPE_SELECTION, &text); | 50 ui::CLIPBOARD_TYPE_SELECTION, &text); |
| 51 text = OmniboxView::SanitizeTextForPaste(text); | 51 text = OmniboxView::SanitizeTextForPaste(text); |
| 52 OmniboxEditModel* model = location_bar_->GetOmniboxView()->model(); | 52 OmniboxEditModel* model = location_bar_->GetOmniboxView()->model(); |
| 53 if (model->CanPasteAndGo(text)) | 53 if (model->CanPasteAndGo(text)) |
| 54 model->PasteAndGo(text); | 54 model->PasteAndGo(text); |
| 55 } | 55 } |
| 56 | 56 |
| 57 suppress_mouse_released_action_ = | 57 suppress_mouse_released_action_ = PageInfoBubbleView::GetShownBubbleType() != |
| 58 PageInfoPopupView::GetShownPopupType() != PageInfoPopupView::POPUP_NONE; | 58 PageInfoBubbleView::BUBBLE_NONE; |
| 59 return true; | 59 return true; |
| 60 } | 60 } |
| 61 | 61 |
| 62 bool LocationIconView::OnMouseDragged(const ui::MouseEvent& event) { | 62 bool LocationIconView::OnMouseDragged(const ui::MouseEvent& event) { |
| 63 location_bar_->GetOmniboxView()->CloseOmniboxPopup(); | 63 location_bar_->GetOmniboxView()->CloseOmniboxPopup(); |
| 64 return false; | 64 return false; |
| 65 } | 65 } |
| 66 | 66 |
| 67 void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) { | 67 void LocationIconView::OnMouseReleased(const ui::MouseEvent& event) { |
| 68 if (event.IsOnlyMiddleMouseButton()) | 68 if (event.IsOnlyMiddleMouseButton()) |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 152 return size; | 152 return size; |
| 153 } | 153 } |
| 154 | 154 |
| 155 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { | 155 void LocationIconView::OnClickOrTap(const ui::LocatedEvent& event) { |
| 156 // Do not show page info if the user has been editing the location bar or the | 156 // Do not show page info if the user has been editing the location bar or the |
| 157 // location bar is at the NTP. | 157 // location bar is at the NTP. |
| 158 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) | 158 if (location_bar_->GetOmniboxView()->IsEditingOrEmpty()) |
| 159 return; | 159 return; |
| 160 ProcessLocatedEvent(event); | 160 ProcessLocatedEvent(event); |
| 161 } | 161 } |
| OLD | NEW |