| 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 "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" | 8 #include "chrome/browser/ui/views/location_bar/touchable_location_bar_view.h" |
| 9 #include "ui/views/controls/image_view.h" | 9 #include "ui/views/controls/image_view.h" |
| 10 #include "ui/views/widget/widget_observer.h" | 10 #include "ui/views/widget/widget_observer.h" |
| 11 | 11 |
| 12 class LocationBarView; | 12 class LocationBarView; |
| 13 class OpenPDFInReaderBubbleView; | 13 class OpenPDFInReaderBubbleView; |
| 14 class OpenPDFInReaderPromptDelegate; | 14 class OpenPDFInReaderPromptDelegate; |
| 15 class TabContents; | 15 |
| 16 namespace content { |
| 17 class WebContents; |
| 18 } |
| 16 | 19 |
| 17 // A Page Action image view for the "Open PDF in Reader" bubble. | 20 // A Page Action image view for the "Open PDF in Reader" bubble. |
| 18 class OpenPDFInReaderView : public views::ImageView, | 21 class OpenPDFInReaderView : public views::ImageView, |
| 19 public TouchableLocationBarView, | 22 public TouchableLocationBarView, |
| 20 views::WidgetObserver { | 23 views::WidgetObserver { |
| 21 public: | 24 public: |
| 22 explicit OpenPDFInReaderView(LocationBarView* location_bar_view); | 25 explicit OpenPDFInReaderView(LocationBarView* location_bar_view); |
| 23 virtual ~OpenPDFInReaderView(); | 26 virtual ~OpenPDFInReaderView(); |
| 24 | 27 |
| 25 void Update(TabContents* tab_contents); | 28 void Update(content::WebContents* web_contents); |
| 26 | 29 |
| 27 // TouchableLocationBarView overrides: | 30 // TouchableLocationBarView overrides: |
| 28 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; | 31 virtual int GetBuiltInHorizontalPadding() const OVERRIDE; |
| 29 | 32 |
| 30 private: | 33 private: |
| 31 void ShowBubble(); | 34 void ShowBubble(); |
| 32 | 35 |
| 33 // views::ImageView overrides: | 36 // views::ImageView overrides: |
| 34 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; | 37 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; |
| 35 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; | 38 virtual bool OnMousePressed(const ui::MouseEvent& event) OVERRIDE; |
| 36 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; | 39 virtual void OnMouseReleased(const ui::MouseEvent& event) OVERRIDE; |
| 37 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; | 40 virtual bool OnKeyPressed(const ui::KeyEvent& event) OVERRIDE; |
| 38 | 41 |
| 39 // views::WidgetObserver override: | 42 // views::WidgetObserver override: |
| 40 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 43 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 41 | 44 |
| 42 // The LocationBarView hosting this view. | 45 // The LocationBarView hosting this view. |
| 43 LocationBarView* location_bar_view_; | 46 LocationBarView* location_bar_view_; |
| 44 | 47 |
| 45 OpenPDFInReaderBubbleView* bubble_; | 48 OpenPDFInReaderBubbleView* bubble_; |
| 46 | 49 |
| 47 // Weak pointer; owned by the PDFTabHelper of the currently active tab. | 50 // Weak pointer; owned by the PDFTabHelper of the currently active tab. |
| 48 OpenPDFInReaderPromptDelegate* model_; | 51 OpenPDFInReaderPromptDelegate* model_; |
| 49 | 52 |
| 50 DISALLOW_IMPLICIT_CONSTRUCTORS(OpenPDFInReaderView); | 53 DISALLOW_IMPLICIT_CONSTRUCTORS(OpenPDFInReaderView); |
| 51 }; | 54 }; |
| 52 | 55 |
| 53 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ | 56 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_OPEN_PDF_IN_READER_VIEW_H_ |
| OLD | NEW |