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 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
73 } | 73 } |
74 | 74 |
75 bool ContentSettingBubbleContents::Favicon::OnMousePressed( | 75 bool ContentSettingBubbleContents::Favicon::OnMousePressed( |
76 const views::MouseEvent& event) { | 76 const views::MouseEvent& event) { |
77 return event.IsLeftMouseButton() || event.IsMiddleMouseButton(); | 77 return event.IsLeftMouseButton() || event.IsMiddleMouseButton(); |
78 } | 78 } |
79 | 79 |
80 void ContentSettingBubbleContents::Favicon::OnMouseReleased( | 80 void ContentSettingBubbleContents::Favicon::OnMouseReleased( |
81 const views::MouseEvent& event) { | 81 const views::MouseEvent& event) { |
82 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && | 82 if ((event.IsLeftMouseButton() || event.IsMiddleMouseButton()) && |
83 HitTest(event.location())) { | 83 HitTestPoint(event.location())) { |
84 parent_->LinkClicked(link_, event.flags()); | 84 parent_->LinkClicked(link_, event.flags()); |
85 } | 85 } |
86 } | 86 } |
87 | 87 |
88 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( | 88 gfx::NativeCursor ContentSettingBubbleContents::Favicon::GetCursor( |
89 const views::MouseEvent& event) { | 89 const views::MouseEvent& event) { |
90 #if defined(USE_AURA) | 90 #if defined(USE_AURA) |
91 return ui::kCursorHand; | 91 return ui::kCursorHand; |
92 #elif defined(OS_WIN) | 92 #elif defined(OS_WIN) |
93 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); | 93 static HCURSOR g_hand_cursor = LoadCursor(NULL, IDC_HAND); |
(...skipping 230 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
324 } | 324 } |
325 | 325 |
326 void ContentSettingBubbleContents::Observe( | 326 void ContentSettingBubbleContents::Observe( |
327 int type, | 327 int type, |
328 const content::NotificationSource& source, | 328 const content::NotificationSource& source, |
329 const content::NotificationDetails& details) { | 329 const content::NotificationDetails& details) { |
330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); | 330 DCHECK(type == content::NOTIFICATION_WEB_CONTENTS_DESTROYED); |
331 DCHECK(source == content::Source<WebContents>(web_contents_)); | 331 DCHECK(source == content::Source<WebContents>(web_contents_)); |
332 web_contents_ = NULL; | 332 web_contents_ = NULL; |
333 } | 333 } |
OLD | NEW |