| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_ABOUT_CHROME_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "views/controls/image_view.h" | 13 #include "views/controls/image_view.h" |
| 14 #include "views/controls/label.h" | 14 #include "views/controls/label.h" |
| 15 #include "views/controls/link_listener.h" | 15 #include "views/controls/link_listener.h" |
| 16 #include "views/view.h" | 16 #include "views/view.h" |
| 17 #include "views/window/dialog_delegate.h" | 17 #include "views/window/dialog_delegate.h" |
| 18 | 18 |
| 19 #if defined(OS_WIN) | 19 #if defined(OS_WIN) && !defined(USE_AURA) |
| 20 #include "chrome/browser/google/google_update.h" | 20 #include "chrome/browser/google/google_update.h" |
| 21 #endif | 21 #endif |
| 22 | 22 |
| 23 namespace views { | 23 namespace views { |
| 24 class Textfield; | 24 class Textfield; |
| 25 class Throbber; | 25 class Throbber; |
| 26 } | 26 } |
| 27 | 27 |
| 28 class Profile; | 28 class Profile; |
| 29 | 29 |
| 30 //////////////////////////////////////////////////////////////////////////////// | 30 //////////////////////////////////////////////////////////////////////////////// |
| 31 // | 31 // |
| 32 // The AboutChromeView class is responsible for drawing the UI controls of the | 32 // The AboutChromeView class is responsible for drawing the UI controls of the |
| 33 // About Chrome dialog that allows the user to see what version is installed | 33 // About Chrome dialog that allows the user to see what version is installed |
| 34 // and check for updates. | 34 // and check for updates. |
| 35 // | 35 // |
| 36 //////////////////////////////////////////////////////////////////////////////// | 36 //////////////////////////////////////////////////////////////////////////////// |
| 37 class AboutChromeView : public views::DialogDelegateView, | 37 class AboutChromeView : public views::DialogDelegateView, |
| 38 public views::LinkListener | 38 public views::LinkListener |
| 39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) && !defined(USE_AURA) |
| 40 , public GoogleUpdateStatusListener | 40 , public GoogleUpdateStatusListener |
| 41 #endif | 41 #endif |
| 42 { | 42 { |
| 43 public: | 43 public: |
| 44 explicit AboutChromeView(Profile* profile); | 44 explicit AboutChromeView(Profile* profile); |
| 45 virtual ~AboutChromeView(); | 45 virtual ~AboutChromeView(); |
| 46 | 46 |
| 47 // Initialize the controls on the dialog. | 47 // Initialize the controls on the dialog. |
| 48 void Init(); | 48 void Init(); |
| 49 | 49 |
| (...skipping 18 matching lines...) Expand all Loading... |
| 68 virtual bool IsAlwaysOnTop() const; | 68 virtual bool IsAlwaysOnTop() const; |
| 69 virtual bool HasAlwaysOnTopMenu() const; | 69 virtual bool HasAlwaysOnTopMenu() const; |
| 70 virtual bool IsModal() const; | 70 virtual bool IsModal() const; |
| 71 virtual std::wstring GetWindowTitle() const; | 71 virtual std::wstring GetWindowTitle() const; |
| 72 virtual bool Accept(); | 72 virtual bool Accept(); |
| 73 virtual views::View* GetContentsView(); | 73 virtual views::View* GetContentsView(); |
| 74 | 74 |
| 75 // Overridden from views::LinkListener: | 75 // Overridden from views::LinkListener: |
| 76 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 76 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; |
| 77 | 77 |
| 78 #if defined(OS_WIN) | 78 #if defined(OS_WIN) && !defined(USE_AURA) |
| 79 // Overridden from GoogleUpdateStatusListener: | 79 // Overridden from GoogleUpdateStatusListener: |
| 80 virtual void OnReportResults(GoogleUpdateUpgradeResult result, | 80 virtual void OnReportResults(GoogleUpdateUpgradeResult result, |
| 81 GoogleUpdateErrorCode error_code, | 81 GoogleUpdateErrorCode error_code, |
| 82 const std::wstring& version); | 82 const std::wstring& version); |
| 83 #endif | 83 #endif |
| 84 | 84 |
| 85 private: | 85 private: |
| 86 #if defined(OS_WIN) | 86 #if defined(OS_WIN) && !defined(USE_AURA) |
| 87 // Update the UI to show the status of the upgrade. | 87 // Update the UI to show the status of the upgrade. |
| 88 void UpdateStatus(GoogleUpdateUpgradeResult result, | 88 void UpdateStatus(GoogleUpdateUpgradeResult result, |
| 89 GoogleUpdateErrorCode error_code); | 89 GoogleUpdateErrorCode error_code); |
| 90 #endif | 90 #endif |
| 91 | 91 |
| 92 Profile* profile_; | 92 Profile* profile_; |
| 93 | 93 |
| 94 // UI elements on the dialog. | 94 // UI elements on the dialog. |
| 95 views::ImageView* about_dlg_background_logo_; | 95 views::ImageView* about_dlg_background_logo_; |
| 96 views::Label* about_title_label_; | 96 views::Label* about_title_label_; |
| (...skipping 24 matching lines...) Expand all Loading... |
| 121 // word for word with the help of the WordIterator, and make room for URLs | 121 // word for word with the help of the WordIterator, and make room for URLs |
| 122 // which are drawn using views::Link. See also |url_offsets_|. | 122 // which are drawn using views::Link. See also |url_offsets_|. |
| 123 std::wstring main_label_chunk1_; | 123 std::wstring main_label_chunk1_; |
| 124 std::wstring main_label_chunk2_; | 124 std::wstring main_label_chunk2_; |
| 125 std::wstring main_label_chunk3_; | 125 std::wstring main_label_chunk3_; |
| 126 std::wstring main_label_chunk4_; | 126 std::wstring main_label_chunk4_; |
| 127 std::wstring main_label_chunk5_; | 127 std::wstring main_label_chunk5_; |
| 128 // Determines the order of the two links we draw in the main label. | 128 // Determines the order of the two links we draw in the main label. |
| 129 bool chromium_url_appears_first_; | 129 bool chromium_url_appears_first_; |
| 130 | 130 |
| 131 #if defined(OS_WIN) | 131 #if defined(OS_WIN) && !defined(USE_AURA) |
| 132 // The class that communicates with Google Update to find out if an update is | 132 // The class that communicates with Google Update to find out if an update is |
| 133 // available and asks it to start an upgrade. | 133 // available and asks it to start an upgrade. |
| 134 scoped_refptr<GoogleUpdate> google_updater_; | 134 scoped_refptr<GoogleUpdate> google_updater_; |
| 135 #endif | 135 #endif |
| 136 | 136 |
| 137 // The version Google Update reports is available to us. | 137 // The version Google Update reports is available to us. |
| 138 std::wstring new_version_available_; | 138 std::wstring new_version_available_; |
| 139 | 139 |
| 140 // Whether text direction is left-to-right or right-to-left. | 140 // Whether text direction is left-to-right or right-to-left. |
| 141 bool text_direction_is_rtl_; | 141 bool text_direction_is_rtl_; |
| 142 | 142 |
| 143 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); | 143 DISALLOW_COPY_AND_ASSIGN(AboutChromeView); |
| 144 }; | 144 }; |
| 145 | 145 |
| 146 #endif // CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_ | 146 #endif // CHROME_BROWSER_UI_VIEWS_ABOUT_CHROME_VIEW_H_ |
| OLD | NEW |