location_icon_view.h revision dc0f95d653279beabeb9817299e2902918ba123e
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
3// found in the LICENSE file.
4
5#ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_
6#define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_
7#pragma once
8
9#include "chrome/browser/ui/views/location_bar/click_handler.h"
10#include "views/controls/image_view.h"
11
12class LocationBarView;
13namespace views {
14class MouseEvent;
15}
16
17// LocationIconView is used to display an icon to the left of the edit field.
18// This shows the user's current action while editing, the page security
19// status on https pages, or a globe for other URLs.
20class LocationIconView : public views::ImageView {
21 public:
22  explicit LocationIconView(LocationBarView* location_bar);
23  virtual ~LocationIconView();
24
25  // Overridden from views::ImageView:
26  virtual bool OnMousePressed(const views::MouseEvent& event);
27  virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled);
28
29  // Whether we should show the tooltip for this icon or not.
30  void ShowTooltip(bool show);
31
32 private:
33  ClickHandler click_handler_;
34
35  DISALLOW_IMPLICIT_CONSTRUCTORS(LocationIconView);
36};
37
38#endif  // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_ICON_VIEW_H_
39