| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/toolbar/toolbar_origin_chip_view.h" | 5 #include "chrome/browser/ui/views/toolbar/toolbar_origin_chip_view.h" |
| 6 | 6 |
| 7 #include "base/files/file_path.h" | 7 #include "base/files/file_path.h" |
| 8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| (...skipping 312 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 323 | 323 |
| 324 // TODO(gbillock): Make the LocationBarView or OmniboxView the listener for | 324 // TODO(gbillock): Make the LocationBarView or OmniboxView the listener for |
| 325 // this button. | 325 // this button. |
| 326 void ToolbarOriginChipView::ButtonPressed(views::Button* sender, | 326 void ToolbarOriginChipView::ButtonPressed(views::Button* sender, |
| 327 const ui::Event& event) { | 327 const ui::Event& event) { |
| 328 // See if the event needs to be passed to the LocationIconView. | 328 // See if the event needs to be passed to the LocationIconView. |
| 329 if (event.IsMouseEvent() || (event.type() == ui::ET_GESTURE_TAP)) { | 329 if (event.IsMouseEvent() || (event.type() == ui::ET_GESTURE_TAP)) { |
| 330 location_icon_view_->set_interactive(true); | 330 location_icon_view_->set_interactive(true); |
| 331 const ui::LocatedEvent& located_event = | 331 const ui::LocatedEvent& located_event = |
| 332 static_cast<const ui::LocatedEvent&>(event); | 332 static_cast<const ui::LocatedEvent&>(event); |
| 333 if (GetEventHandlerForPoint(located_event.location()) == | 333 if (GetEventHandlerForPoint(gfx::ToFlooredPoint( |
| 334 location_icon_view_) { | 334 located_event.location())) == location_icon_view_) { |
| 335 location_icon_view_->page_info_helper()->ProcessEvent(located_event); | 335 location_icon_view_->page_info_helper()->ProcessEvent(located_event); |
| 336 location_icon_view_->set_interactive(false); | 336 location_icon_view_->set_interactive(false); |
| 337 return; | 337 return; |
| 338 } | 338 } |
| 339 location_icon_view_->set_interactive(false); | 339 location_icon_view_->set_interactive(false); |
| 340 } | 340 } |
| 341 | 341 |
| 342 UMA_HISTOGRAM_COUNTS("OriginChip.Pressed", 1); | 342 UMA_HISTOGRAM_COUNTS("OriginChip.Pressed", 1); |
| 343 content::RecordAction(base::UserMetricsAction("OriginChipPress")); | 343 content::RecordAction(base::UserMetricsAction("OriginChipPress")); |
| 344 | 344 |
| (...skipping 29 matching lines...) Expand all Loading... |
| 374 | 374 |
| 375 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will | 375 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will |
| 376 // have already been called. | 376 // have already been called. |
| 377 void ToolbarOriginChipView::OnSafeBrowsingHit( | 377 void ToolbarOriginChipView::OnSafeBrowsingHit( |
| 378 const SafeBrowsingUIManager::UnsafeResource& resource) {} | 378 const SafeBrowsingUIManager::UnsafeResource& resource) {} |
| 379 | 379 |
| 380 void ToolbarOriginChipView::OnSafeBrowsingMatch( | 380 void ToolbarOriginChipView::OnSafeBrowsingMatch( |
| 381 const SafeBrowsingUIManager::UnsafeResource& resource) { | 381 const SafeBrowsingUIManager::UnsafeResource& resource) { |
| 382 OnChanged(); | 382 OnChanged(); |
| 383 } | 383 } |
| OLD | NEW |