| 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/content_setting_bubble_contents.h" | 5 #include "chrome/browser/ui/views/content_setting_bubble_contents.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <set> | 8 #include <set> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool ContentSettingBubbleContents::Favicon::OnMousePressed( | 95 bool ContentSettingBubbleContents::Favicon::OnMousePressed( |
| 96 const ui::MouseEvent& event) { | 96 const ui::MouseEvent& event) { |
| 97 return event.IsLeftMouseButton() || event.IsMiddleMouseButton(); | 97 return event.IsLeftMouseButton() || event.IsMiddleMouseButton(); |
| 98 } | 98 } |
| 99 | 99 |
| 100 void ContentSettingBubbleContents::Favicon::OnMouseReleased( | 100 void ContentSettingBubbleContents::Favicon::OnMouseReleased( |
| 101 const ui::MouseEvent& event) { | 101 const ui::MouseEvent& event) { |
| 102 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && | 102 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && |
| 103 HitTestPoint(event.location())) { | 103 HitTestPoint(gfx::ToFlooredPoint(event.location()))) { |
| 104 parent_->LinkClicked(link_, event.flags()); | 104 parent_->LinkClicked(link_, event.flags()); |
| 105 } | 105 } |
| 106 } | 106 } |
| 107 | 107 |
| 108 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( | 108 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( |
| 109 const ui::MouseEvent& event) { | 109 const ui::MouseEvent& event) { |
| 110 #if defined(USE_AURA) | 110 #if defined(USE_AURA) |
| 111 return ui::kCursorHand; | 111 return ui::kCursorHand; |
| 112 #elif defined(OS_WIN) | 112 #elif defined(OS_WIN) |
| 113 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); | 113 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); |
| (...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 461 int width = button->GetPreferredSize().width(); | 461 int width = button->GetPreferredSize().width(); |
| 462 for (int i = 0; i < menu_model->GetItemCount(); ++i) { | 462 for (int i = 0; i < menu_model->GetItemCount(); ++i) { |
| 463 button->SetText(menu_model->GetLabelAt(i)); | 463 button->SetText(menu_model->GetLabelAt(i)); |
| 464 width = std::max(width, button->GetPreferredSize().width()); | 464 width = std::max(width, button->GetPreferredSize().width()); |
| 465 } | 465 } |
| 466 | 466 |
| 467 // Recover the title for the menu button. | 467 // Recover the title for the menu button. |
| 468 button->SetText(title); | 468 button->SetText(title); |
| 469 return width; | 469 return width; |
| 470 } | 470 } |
| OLD | NEW |