OLD | NEW |
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/outdated_upgrade_bubble_view.h" | 5 #include "chrome/browser/ui/views/outdated_upgrade_bubble_view.h" |
6 | 6 |
7 #include "base/metrics/histogram.h" | 7 #include "base/metrics/histogram.h" |
8 #include "chrome/browser/upgrade_detector.h" | 8 #include "chrome/browser/upgrade_detector.h" |
9 #include "content/public/browser/page_navigator.h" | 9 #include "content/public/browser/page_navigator.h" |
10 #include "content/public/browser/user_metrics.h" | 10 #include "content/public/browser/user_metrics.h" |
(...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 } | 162 } |
163 | 163 |
164 OutdatedUpgradeBubbleView::OutdatedUpgradeBubbleView( | 164 OutdatedUpgradeBubbleView::OutdatedUpgradeBubbleView( |
165 views::View* anchor_view, content::PageNavigator* navigator) | 165 views::View* anchor_view, content::PageNavigator* navigator) |
166 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), | 166 : BubbleDelegateView(anchor_view, views::BubbleBorder::TOP_RIGHT), |
167 chose_to_reinstall_(false), | 167 chose_to_reinstall_(false), |
168 reinstall_button_(NULL), | 168 reinstall_button_(NULL), |
169 later_button_(NULL), | 169 later_button_(NULL), |
170 navigator_(navigator) { | 170 navigator_(navigator) { |
171 // Compensate for built-in vertical padding in the anchor view's image. | 171 // Compensate for built-in vertical padding in the anchor view's image. |
172 set_anchor_insets(gfx::Insets(5, 0, 5, 0)); | 172 set_anchor_view_insets(gfx::Insets(5, 0, 5, 0)); |
173 } | 173 } |
174 | 174 |
175 void OutdatedUpgradeBubbleView::ButtonPressed( | 175 void OutdatedUpgradeBubbleView::ButtonPressed( |
176 views::Button* sender, const ui::Event& event) { | 176 views::Button* sender, const ui::Event& event) { |
177 if (event.IsMouseEvent() && | 177 if (event.IsMouseEvent() && |
178 !(static_cast<const ui::MouseEvent*>(&event))->IsOnlyLeftMouseButton()) { | 178 !(static_cast<const ui::MouseEvent*>(&event))->IsOnlyLeftMouseButton()) { |
179 return; | 179 return; |
180 } | 180 } |
181 HandleButtonPressed(sender); | 181 HandleButtonPressed(sender); |
182 } | 182 } |
(...skipping 12 matching lines...) Expand all Loading... |
195 NEW_FOREGROUND_TAB, | 195 NEW_FOREGROUND_TAB, |
196 content::PAGE_TRANSITION_LINK, | 196 content::PAGE_TRANSITION_LINK, |
197 false)); | 197 false)); |
198 } else { | 198 } else { |
199 DCHECK_EQ(later_button_, sender); | 199 DCHECK_EQ(later_button_, sender); |
200 content::RecordAction( | 200 content::RecordAction( |
201 content::UserMetricsAction("OutdatedUpgradeBubble.Later")); | 201 content::UserMetricsAction("OutdatedUpgradeBubble.Later")); |
202 } | 202 } |
203 StartFade(false); | 203 StartFade(false); |
204 } | 204 } |
OLD | NEW |