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/ev_bubble_view.h" | 5 #include "chrome/browser/ui/views/location_bar/ev_bubble_view.h" |
6 #include "grit/theme_resources.h" | 6 #include "grit/theme_resources.h" |
7 #include "ui/views/painter.h" | 7 #include "ui/views/painter.h" |
8 | 8 |
9 | 9 |
10 namespace { | 10 namespace { |
11 const int kBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); | 11 const int kBackgroundImages[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE); |
12 } | 12 } |
13 | 13 |
14 | 14 |
15 EVBubbleView::EVBubbleView(const gfx::FontList& font_list, | 15 EVBubbleView::EVBubbleView(const gfx::FontList& font_list, |
16 int font_y_offset, | |
17 SkColor text_color, | 16 SkColor text_color, |
18 SkColor parent_background_color, | 17 SkColor parent_background_color, |
19 LocationBarView* location_bar) | 18 LocationBarView* location_bar) |
20 : IconLabelBubbleView(kBackgroundImages, NULL, IDR_OMNIBOX_HTTPS_VALID, | 19 : IconLabelBubbleView(kBackgroundImages, NULL, IDR_OMNIBOX_HTTPS_VALID, |
21 font_list, font_y_offset, text_color, | 20 font_list, text_color, parent_background_color, true), |
22 parent_background_color, true), | |
23 page_info_helper_(this, location_bar) { | 21 page_info_helper_(this, location_bar) { |
24 } | 22 } |
25 | 23 |
26 EVBubbleView::~EVBubbleView() { | 24 EVBubbleView::~EVBubbleView() { |
27 } | 25 } |
28 | 26 |
29 gfx::Size EVBubbleView::GetMinimumSize() { | 27 gfx::Size EVBubbleView::GetMinimumSize() { |
30 // Height will be ignored by the LocationBarView. | 28 // Height will be ignored by the LocationBarView. |
31 gfx::Size minimum(GetPreferredSize()); | 29 gfx::Size minimum(GetPreferredSize()); |
32 static const int kMinBubbleWidth = 150; | 30 static const int kMinBubbleWidth = 150; |
(...skipping 10 matching lines...) Expand all Loading... |
43 void EVBubbleView::OnMouseReleased(const ui::MouseEvent& event) { | 41 void EVBubbleView::OnMouseReleased(const ui::MouseEvent& event) { |
44 page_info_helper_.ProcessEvent(event); | 42 page_info_helper_.ProcessEvent(event); |
45 } | 43 } |
46 | 44 |
47 void EVBubbleView::OnGestureEvent(ui::GestureEvent* event) { | 45 void EVBubbleView::OnGestureEvent(ui::GestureEvent* event) { |
48 if (event->type() == ui::ET_GESTURE_TAP) { | 46 if (event->type() == ui::ET_GESTURE_TAP) { |
49 page_info_helper_.ProcessEvent(*event); | 47 page_info_helper_.ProcessEvent(*event); |
50 event->SetHandled(); | 48 event->SetHandled(); |
51 } | 49 } |
52 } | 50 } |
OLD | NEW |