| 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_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
| 10 #include "ui/gfx/native_widget_types.h" | 10 #include "ui/gfx/native_widget_types.h" |
| 11 #include "ui/views/window/dialog_delegate.h" | 11 #include "ui/views/window/dialog_delegate.h" |
| 12 | 12 |
| 13 namespace views { | 13 namespace views { |
| 14 class MessageBoxView; | 14 class MessageBoxView; |
| 15 } | 15 } |
| 16 | 16 |
| 17 // A dialog box that tells the user that an update is recommended in order for | 17 // A dialog box that tells the user that an update is recommended in order for |
| 18 // the latest version to be put to use. | 18 // the latest version to be put to use. |
| 19 class UpdateRecommendedMessageBox : public views::DialogDelegate { | 19 class UpdateRecommendedMessageBox : public views::DialogDelegate { |
| 20 public: | 20 public: |
| 21 // This box is modal to |parent_window|. | 21 static void Show(gfx::NativeWindow parent_window); |
| 22 static void ShowMessageBox(gfx::NativeWindow parent_window); | 22 |
| 23 private: |
| 24 UpdateRecommendedMessageBox(); |
| 25 virtual ~UpdateRecommendedMessageBox(); |
| 23 | 26 |
| 24 // Overridden from views::DialogDelegate: | 27 // Overridden from views::DialogDelegate: |
| 25 virtual bool Accept() OVERRIDE; | 28 virtual bool Accept() OVERRIDE; |
| 26 | |
| 27 protected: | |
| 28 // Overridden from views::DialogDelegate: | |
| 29 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; | 29 virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE; |
| 30 | 30 |
| 31 // Overridden from views::WidgetDelegate: | 31 // Overridden from views::WidgetDelegate: |
| 32 virtual bool ShouldShowWindowTitle() const OVERRIDE; | 32 virtual bool ShouldShowWindowTitle() const OVERRIDE; |
| 33 virtual string16 GetWindowTitle() const OVERRIDE; | 33 virtual string16 GetWindowTitle() const OVERRIDE; |
| 34 virtual void DeleteDelegate() OVERRIDE; | 34 virtual void DeleteDelegate() OVERRIDE; |
| 35 virtual ui::ModalType GetModalType() const OVERRIDE; | 35 virtual ui::ModalType GetModalType() const OVERRIDE; |
| 36 virtual views::View* GetContentsView() OVERRIDE; | 36 virtual views::View* GetContentsView() OVERRIDE; |
| 37 virtual views::Widget* GetWidget() OVERRIDE; | 37 virtual views::Widget* GetWidget() OVERRIDE; |
| 38 virtual const views::Widget* GetWidget() const OVERRIDE; | 38 virtual const views::Widget* GetWidget() const OVERRIDE; |
| 39 | 39 |
| 40 private: | |
| 41 explicit UpdateRecommendedMessageBox(gfx::NativeWindow parent_window); | |
| 42 virtual ~UpdateRecommendedMessageBox(); | |
| 43 | |
| 44 views::MessageBoxView* message_box_view_; | 40 views::MessageBoxView* message_box_view_; |
| 45 | 41 |
| 46 DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedMessageBox); | 42 DISALLOW_COPY_AND_ASSIGN(UpdateRecommendedMessageBox); |
| 47 }; | 43 }; |
| 48 | 44 |
| 49 #endif // CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ | 45 #endif // CHROME_BROWSER_UI_VIEWS_UPDATE_RECOMMENDED_MESSAGE_BOX_H_ |
| OLD | NEW |