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 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ | 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_ | 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ |
7 | 7 |
8 #include "ui/views/controls/image_view.h" | 8 #include "ui/views/controls/image_view.h" |
9 #include "ui/views/widget/widget_observer.h" | 9 #include "ui/views/widget/widget_observer.h" |
10 | 10 |
11 class OpenPDFInReaderBubbleView; | 11 class OpenPDFInReaderBubbleView; |
12 class OpenPDFInReaderPromptDelegate; | |
13 | 12 |
14 namespace content { | 13 namespace content { |
15 class WebContents; | 14 class WebContents; |
16 } | 15 } |
17 | 16 |
| 17 namespace pdf { |
| 18 class OpenPDFInReaderPromptDelegate; |
| 19 } |
| 20 |
18 // A Page Action image view for the "Open PDF in Reader" bubble. | 21 // A Page Action image view for the "Open PDF in Reader" bubble. |
19 class OpenPDFInReaderView : public views::ImageView, | 22 class OpenPDFInReaderView : public views::ImageView, |
20 public views::WidgetObserver { | 23 public views::WidgetObserver { |
21 public: | 24 public: |
22 OpenPDFInReaderView(); | 25 OpenPDFInReaderView(); |
23 virtual ~OpenPDFInReaderView(); | 26 virtual ~OpenPDFInReaderView(); |
24 | 27 |
25 void Update(content::WebContents* web_contents); | 28 void Update(content::WebContents* web_contents); |
26 | 29 |
27 private: | 30 private: |
28 void ShowBubble(); | 31 void ShowBubble(); |
29 | 32 |
30 // views::ImageView: | 33 // views::ImageView: |
31 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 34 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
32 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 35 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
33 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 36 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
34 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 37 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
35 | 38 |
36 // views::WidgetObserver: | 39 // views::WidgetObserver: |
37 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; | 40 virtual void OnWidgetDestroying(views::Widget* widget) OVERRIDE; |
38 | 41 |
39 OpenPDFInReaderBubbleView* bubble_; | 42 OpenPDFInReaderBubbleView* bubble_; |
40 | 43 |
41 // Weak pointer; owned by the PDFTabHelper of the currently active tab. | 44 // Weak pointer; owned by the PDFTabHelper of the currently active tab. |
42 OpenPDFInReaderPromptDelegate* model_; | 45 pdf::OpenPDFInReaderPromptDelegate* model_; |
43 | 46 |
44 DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderView); | 47 DISALLOW_COPY_AND_ASSIGN(OpenPDFInReaderView); |
45 }; | 48 }; |
46 | 49 |
47 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ | 50 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ |
OLD | NEW |