| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/first_run_bubble.h" | 5 #include "chrome/browser/ui/views/first_run_bubble.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
| 10 #include "chrome/browser/search_engines/util.h" | 10 #include "chrome/browser/search_engines/util.h" |
| (...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 101 // Compensate for padding in anchor. | 101 // Compensate for padding in anchor. |
| 102 return BubbleDelegateView::GetAnchorPoint().Add( | 102 return BubbleDelegateView::GetAnchorPoint().Add( |
| 103 gfx::Point(0, anchor_view() ? kAnchorVerticalOffset : 0)); | 103 gfx::Point(0, anchor_view() ? kAnchorVerticalOffset : 0)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 FirstRunBubble::FirstRunBubble( | 106 FirstRunBubble::FirstRunBubble( |
| 107 Profile* profile, | 107 Profile* profile, |
| 108 views::View* anchor_view, | 108 views::View* anchor_view, |
| 109 views::BubbleBorder::ArrowLocation arrow_location, | 109 views::BubbleBorder::ArrowLocation arrow_location, |
| 110 FirstRun::BubbleType bubble_type) | 110 FirstRun::BubbleType bubble_type) |
| 111 : views::BubbleDelegateView(anchor_view, | 111 : views::BubbleDelegateView(anchor_view, arrow_location), |
| 112 arrow_location, | |
| 113 SK_ColorWHITE), | |
| 114 profile_(profile), | 112 profile_(profile), |
| 115 bubble_type_(bubble_type) { | 113 bubble_type_(bubble_type) { |
| 116 } | 114 } |
| 117 | 115 |
| 118 FirstRunBubble::~FirstRunBubble() { | 116 FirstRunBubble::~FirstRunBubble() { |
| 119 } | 117 } |
| 120 | 118 |
| 121 void FirstRunBubble::ButtonPressed(views::Button* sender, | 119 void FirstRunBubble::ButtonPressed(views::Button* sender, |
| 122 const views::Event& event) { | 120 const views::Event& event) { |
| 123 if (bubble_type_ == FirstRun::OEM_BUBBLE) { | 121 if (bubble_type_ == FirstRun::OEM_BUBBLE) { |
| 124 UserMetrics::RecordAction( | 122 UserMetrics::RecordAction( |
| 125 UserMetricsAction("FirstRunOEMBubbleView_Clicked")); | 123 UserMetricsAction("FirstRunOEMBubbleView_Clicked")); |
| 126 } | 124 } |
| 127 GetWidget()->Close(); | 125 GetWidget()->Close(); |
| 128 } | 126 } |
| OLD | NEW |