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
;
18 class OpenPDFInReaderPromptClient
;
21 // A Page Action image view for the "Open PDF in Reader" bubble.
22 class OpenPDFInReaderView
: public views::ImageView
,
23 public views::WidgetObserver
{
25 OpenPDFInReaderView();
26 ~OpenPDFInReaderView() override
;
28 void Update(content::WebContents
* web_contents
);
34 void GetAccessibleState(ui::AXViewState
* state
) override
;
35 bool OnMousePressed(const ui::MouseEvent
& event
) override
;
36 void OnMouseReleased(const ui::MouseEvent
& event
) override
;
37 bool OnKeyPressed(const ui::KeyEvent
& event
) override
;
39 // views::WidgetObserver:
40 void OnWidgetDestroying(views::Widget
* widget
) override
;
42 OpenPDFInReaderBubbleView
* bubble_
;
44 // Weak pointer; owned by the PDFWebContentsHelper of the currently active
46 pdf::OpenPDFInReaderPromptClient
* model_
;
48 DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderView
);
51 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_