app_info_summary_panel.h revision f8ee788a64d60abd8f2d742a5fdedde054ecd910
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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ 6#define CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ 7 8#include "base/memory/scoped_ptr.h" 9#include "chrome/browser/ui/views/apps/app_info_dialog/app_info_panel.h" 10#include "chrome/common/extensions/extension_constants.h" 11#include "ui/views/controls/combobox/combobox_listener.h" 12 13class LaunchOptionsComboboxModel; 14class Profile; 15 16namespace extensions { 17class Extension; 18} 19 20namespace views { 21class Combobox; 22class Label; 23} 24 25// The summary panel of the app info dialog, which provides basic information 26// and controls related to the app. 27class AppInfoSummaryPanel : public AppInfoPanel, 28 public views::ComboboxListener { 29 public: 30 AppInfoSummaryPanel(Profile* profile, const extensions::Extension* app); 31 32 virtual ~AppInfoSummaryPanel(); 33 34 private: 35 // Internal initialisation methods. 36 void CreateDescriptionControl(); 37 void CreateLaunchOptionControl(); 38 void LayoutDescriptionControl(); 39 40 // Overridden from views::ComboboxListener: 41 virtual void OnPerformAction(views::Combobox* combobox) OVERRIDE; 42 43 // Returns the launch type of the app (e.g. pinned tab, fullscreen, etc). 44 extensions::LaunchType GetLaunchType() const; 45 46 // Sets the launch type of the app to the given type. Must only be called if 47 // CanSetLaunchType() returns true. 48 void SetLaunchType(extensions::LaunchType) const; 49 bool CanSetLaunchType() const; 50 51 // UI elements on the dialog. 52 views::Label* description_heading_; 53 views::Label* description_label_; 54 55 scoped_ptr<LaunchOptionsComboboxModel> launch_options_combobox_model_; 56 views::Combobox* launch_options_combobox_; 57 58 DISALLOW_COPY_AND_ASSIGN(AppInfoSummaryPanel); 59}; 60 61#endif // CHROME_BROWSER_UI_VIEWS_APPS_APP_INFO_DIALOG_APP_INFO_SUMMARY_PANEL_H_ 62