| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ |
| 6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ |
| 7 | 7 |
| 8 #include "base/memory/weak_ptr.h" | 8 #include "base/memory/weak_ptr.h" |
| 9 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" | 9 #include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" |
| 10 #include "ui/views/controls/link_listener.h" | 10 #include "ui/views/controls/link_listener.h" |
| (...skipping 21 matching lines...) Expand all Loading... |
| 32 public base::SupportsWeakPtr<AppInfoHeaderPanel> { | 32 public base::SupportsWeakPtr<AppInfoHeaderPanel> { |
| 33 public: | 33 public: |
| 34 AppInfoHeaderPanel(Profile* profile, const extensions::Extension* app); | 34 AppInfoHeaderPanel(Profile* profile, const extensions::Extension* app); |
| 35 virtual ~AppInfoHeaderPanel(); | 35 virtual ~AppInfoHeaderPanel(); |
| 36 | 36 |
| 37 private: | 37 private: |
| 38 void CreateControls(); | 38 void CreateControls(); |
| 39 void LayoutControls(); | 39 void LayoutControls(); |
| 40 | 40 |
| 41 // Overridden from views::LinkListener: | 41 // Overridden from views::LinkListener: |
| 42 virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE; | 42 virtual void LinkClicked(views::Link* source, int event_flags) override; |
| 43 | 43 |
| 44 // Load the app icon asynchronously. For the response, check OnAppImageLoaded. | 44 // Load the app icon asynchronously. For the response, check OnAppImageLoaded. |
| 45 void LoadAppImageAsync(); | 45 void LoadAppImageAsync(); |
| 46 // Called when the app's icon is loaded. | 46 // Called when the app's icon is loaded. |
| 47 void OnAppImageLoaded(const gfx::Image& image); | 47 void OnAppImageLoaded(const gfx::Image& image); |
| 48 | 48 |
| 49 // Opens the app in the web store. Must only be called if | 49 // Opens the app in the web store. Must only be called if |
| 50 // CanShowAppInWebStore() returns true. | 50 // CanShowAppInWebStore() returns true. |
| 51 void ShowAppInWebStore() const; | 51 void ShowAppInWebStore() const; |
| 52 bool CanShowAppInWebStore() const; | 52 bool CanShowAppInWebStore() const; |
| 53 | 53 |
| 54 // Displays the licenses for the app. Must only be called if | 54 // Displays the licenses for the app. Must only be called if |
| 55 // CanDisplayLicenses() returns true. | 55 // CanDisplayLicenses() returns true. |
| 56 void DisplayLicenses(); | 56 void DisplayLicenses(); |
| 57 bool CanDisplayLicenses(); | 57 bool CanDisplayLicenses(); |
| 58 | 58 |
| 59 // UI elements on the dialog. Elements are NULL if they are not displayed. | 59 // UI elements on the dialog. Elements are NULL if they are not displayed. |
| 60 views::ImageView* app_icon_; | 60 views::ImageView* app_icon_; |
| 61 views::Label* app_name_label_; | 61 views::Label* app_name_label_; |
| 62 views::Link* view_in_store_link_; | 62 views::Link* view_in_store_link_; |
| 63 views::Link* licenses_link_; | 63 views::Link* licenses_link_; |
| 64 | 64 |
| 65 base::WeakPtrFactory<AppInfoHeaderPanel> weak_ptr_factory_; | 65 base::WeakPtrFactory<AppInfoHeaderPanel> weak_ptr_factory_; |
| 66 | 66 |
| 67 DISALLOW_COPY_AND_ASSIGN(AppInfoHeaderPanel); | 67 DISALLOW_COPY_AND_ASSIGN(AppInfoHeaderPanel); |
| 68 }; | 68 }; |
| 69 | 69 |
| 70 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ | 70 #endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_HEADER_PANEL_H_ |
| OLD | NEW |