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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/location_bar/ev_bubble_view.h"
6 #include "grit/theme_resources.h"
7 #include "ui/views/painter.h"
11 const int kBackgroundImages
[] = IMAGE_GRID(IDR_OMNIBOX_EV_BUBBLE
);
15 EVBubbleView::EVBubbleView(const gfx::FontList
& font_list
,
17 SkColor parent_background_color
,
18 LocationBarView
* location_bar
)
19 : IconLabelBubbleView(kBackgroundImages
, NULL
, IDR_OMNIBOX_HTTPS_VALID
,
20 font_list
, text_color
, parent_background_color
, true),
21 page_info_helper_(this, location_bar
) {
24 EVBubbleView::~EVBubbleView() {
27 gfx::Size
EVBubbleView::GetMinimumSize() {
28 // Height will be ignored by the LocationBarView.
29 gfx::Size
minimum(GetPreferredSize());
30 static const int kMinBubbleWidth
= 150;
31 minimum
.SetToMax(gfx::Size(kMinBubbleWidth
, 0));
35 bool EVBubbleView::OnMousePressed(const ui::MouseEvent
& event
) {
36 // We want to show the dialog on mouse release; that is the standard behavior
41 void EVBubbleView::OnMouseReleased(const ui::MouseEvent
& event
) {
42 page_info_helper_
.ProcessEvent(event
);
45 void EVBubbleView::OnGestureEvent(ui::GestureEvent
* event
) {
46 if (event
->type() == ui::ET_GESTURE_TAP
) {
47 page_info_helper_
.ProcessEvent(*event
);