[Metrics] Make MetricsStateManager take a callback param to check if UMA is enabled.
[chromium-blink-merge.git] / chrome / browser / ui / views / location_bar / open_pdf_in_reader_view.h
blob3bb25b0750addfb0dce5415ccc446230e295d1b0
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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_
8 #include "ui/views/controls/image_view.h"
9 #include "ui/views/widget/widget_observer.h"
11 class OpenPDFInReaderBubbleView;
12 class OpenPDFInReaderPromptDelegate;
14 namespace content {
15 class WebContents;
18 // A Page Action image view for the "Open PDF in Reader" bubble.
19 class OpenPDFInReaderView : public views::ImageView,
20 public views::WidgetObserver {
21 public:
22 OpenPDFInReaderView();
23 virtual ~OpenPDFInReaderView();
25 void Update(content::WebContents* web_contents);
27 private:
28 void ShowBubble();
30 // views::ImageView:
31 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE;
32 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE;
33 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE;
34 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE;
36 // views::WidgetObserver:
37 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE;
39 OpenPDFInReaderBubbleView* bubble_;
41 // Weak pointer; owned by the PDFTabHelper of the currently active tab.
42 OpenPDFInReaderPromptDelegate* model_;
44 DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderView);
47 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_