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/content_setting_image_view.h" | 5 #include "chrome/browser/ui/views/location_bar/content_setting_image_view.h" |
6 | 6 |
7 #include "base/utf_string_conversions.h" | 7 #include "base/utf_string_conversions.h" |
8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 8 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" | 9 #include "chrome/browser/ui/content_settings/content_setting_bubble_model.h" |
10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" | 10 #include "chrome/browser/ui/content_settings/content_setting_image_model.h" |
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
158 AnimationEnded(animation); | 158 AnimationEnded(animation); |
159 } | 159 } |
160 | 160 |
161 bool ContentSettingImageView::OnMousePressed(const views::MouseEvent& event) { | 161 bool ContentSettingImageView::OnMousePressed(const views::MouseEvent& event) { |
162 // We want to show the bubble on mouse release; that is the standard behavior | 162 // We want to show the bubble on mouse release; that is the standard behavior |
163 // for buttons. | 163 // for buttons. |
164 return true; | 164 return true; |
165 } | 165 } |
166 | 166 |
167 void ContentSettingImageView::OnMouseReleased(const views::MouseEvent& event) { | 167 void ContentSettingImageView::OnMouseReleased(const views::MouseEvent& event) { |
168 if (!HitTest(event.location())) | 168 if (!HitTest(gfx::Rect(event.location(), gfx::Size(0, 0)))) |
sky
2012/08/07 20:11:43
Based on how many calls of this we have I think it
tdanderson
2012/08/08 23:47:51
Done.
| |
169 return; | 169 return; |
170 | 170 |
171 TabContents* tab_contents = parent_->GetTabContents(); | 171 TabContents* tab_contents = parent_->GetTabContents(); |
172 if (!tab_contents) | 172 if (!tab_contents) |
173 return; | 173 return; |
174 | 174 |
175 // Stop animation. | 175 // Stop animation. |
176 if (slide_animator_.get() && slide_animator_->is_animating()) { | 176 if (slide_animator_.get() && slide_animator_->is_animating()) { |
177 slide_animator_->Reset(); | 177 slide_animator_->Reset(); |
178 pause_animation_ = true; | 178 pause_animation_ = true; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
263 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); | 263 1.0 - (visible_text_size_ * kAnimatingFraction) / text_size_); |
264 pause_animation_ = false; | 264 pause_animation_ = false; |
265 slide_animator_->Show(); | 265 slide_animator_->Show(); |
266 } | 266 } |
267 } | 267 } |
268 | 268 |
269 int ContentSettingImageView::GetBuiltInHorizontalPadding() const { | 269 int ContentSettingImageView::GetBuiltInHorizontalPadding() const { |
270 return GetBuiltInHorizontalPaddingImpl(); | 270 return GetBuiltInHorizontalPaddingImpl(); |
271 } | 271 } |
272 | 272 |
OLD | NEW |