| 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_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/i18n/rtl.h" | 10 #include "base/i18n/rtl.h" |
| (...skipping 994 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1005 OSExchangeData* data) { | 1005 OSExchangeData* data) { |
| 1006 DCHECK_NE(GetDragOperationsForView(sender, press_pt), | 1006 DCHECK_NE(GetDragOperationsForView(sender, press_pt), |
| 1007 ui::DragDropTypes::DRAG_NONE); | 1007 ui::DragDropTypes::DRAG_NONE); |
| 1008 | 1008 |
| 1009 WebContents* web_contents = GetWebContents(); | 1009 WebContents* web_contents = GetWebContents(); |
| 1010 favicon::FaviconDriver* favicon_driver = | 1010 favicon::FaviconDriver* favicon_driver = |
| 1011 favicon::ContentFaviconDriver::FromWebContents(web_contents); | 1011 favicon::ContentFaviconDriver::FromWebContents(web_contents); |
| 1012 gfx::ImageSkia favicon = favicon_driver->GetFavicon().AsImageSkia(); | 1012 gfx::ImageSkia favicon = favicon_driver->GetFavicon().AsImageSkia(); |
| 1013 button_drag_utils::SetURLAndDragImage(web_contents->GetURL(), | 1013 button_drag_utils::SetURLAndDragImage(web_contents->GetURL(), |
| 1014 web_contents->GetTitle(), favicon, | 1014 web_contents->GetTitle(), favicon, |
| 1015 nullptr, data, sender->GetWidget()); | 1015 nullptr, *sender->GetWidget(), data); |
| 1016 } | 1016 } |
| 1017 | 1017 |
| 1018 int LocationBarView::GetDragOperationsForView(views::View* sender, | 1018 int LocationBarView::GetDragOperationsForView(views::View* sender, |
| 1019 const gfx::Point& p) { | 1019 const gfx::Point& p) { |
| 1020 DCHECK_EQ(location_icon_view_, sender); | 1020 DCHECK_EQ(location_icon_view_, sender); |
| 1021 WebContents* web_contents = delegate_->GetWebContents(); | 1021 WebContents* web_contents = delegate_->GetWebContents(); |
| 1022 return (web_contents && web_contents->GetURL().is_valid() && | 1022 return (web_contents && web_contents->GetURL().is_valid() && |
| 1023 (!GetOmniboxView()->IsEditingOrEmpty())) ? | 1023 (!GetOmniboxView()->IsEditingOrEmpty())) ? |
| 1024 (ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK) : | 1024 (ui::DragDropTypes::DRAG_COPY | ui::DragDropTypes::DRAG_LINK) : |
| 1025 ui::DragDropTypes::DRAG_NONE; | 1025 ui::DragDropTypes::DRAG_NONE; |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1066 // LocationBarView, private TemplateURLServiceObserver implementation: | 1066 // LocationBarView, private TemplateURLServiceObserver implementation: |
| 1067 | 1067 |
| 1068 void LocationBarView::OnTemplateURLServiceChanged() { | 1068 void LocationBarView::OnTemplateURLServiceChanged() { |
| 1069 template_url_service_->RemoveObserver(this); | 1069 template_url_service_->RemoveObserver(this); |
| 1070 template_url_service_ = nullptr; | 1070 template_url_service_ = nullptr; |
| 1071 // If the browser is no longer active, let's not show the info bubble, as this | 1071 // If the browser is no longer active, let's not show the info bubble, as this |
| 1072 // would make the browser the active window again. | 1072 // would make the browser the active window again. |
| 1073 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) | 1073 if (omnibox_view_ && omnibox_view_->GetWidget()->IsActive()) |
| 1074 ShowFirstRunBubble(); | 1074 ShowFirstRunBubble(); |
| 1075 } | 1075 } |
| OLD | NEW |