Logo Search packages:      
Sourcecode: chromium-browser version File versions  Download package


// Copyright (c) 2010 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.


#include "app/combobox_model.h"
#include "chrome/browser/views/first_run_view_base.h"
#include "views/controls/button/button.h"
#include "views/controls/combobox/combobox.h"
#include "views/view.h"
#include "views/window/dialog_delegate.h"

namespace views {
class Checkbox;
class ComboBox;
class ImageView;
class Label;
class Separator;
class Window;

class Profile;

// FirstRunCustomizeView implements the dialog that allows the user to do
// some simple customizations during the first run.
class FirstRunCustomizeView : public FirstRunViewBase,
                              public ComboboxModel {
  class CustomizeViewObserver {
    // Called when the user has accepted the dialog.
    virtual void CustomizeAccepted() = 0;
    // Called when the user has canceled the dialog.
    virtual void CustomizeCanceled() = 0;

  FirstRunCustomizeView(Profile* profile,
                        ImporterHost* importer_host,
                        CustomizeViewObserver* observer,
                        bool default_browser_checked,
                        bool homepage_defined,
                        int import_items,
                        int dont_import_items,
                        bool search_engine_experiment);
  virtual ~FirstRunCustomizeView();

  // Overridden from views::View.
  virtual gfx::Size GetPreferredSize();
  virtual void Layout();

  // Overridden from views::DialogDelegate.
  virtual bool Accept();
  virtual bool Cancel();

  // Overridden form FirstRunViewBase.
  virtual void ButtonPressed(views::Button* sender, const views::Event& event);

  // Overridden form ComboboxModel.
  virtual int GetItemCount();
  virtual std::wstring GetItemAt(int index);

  // Overridden from views::WindowDelegate.
  virtual std::wstring GetWindowTitle() const;
  virtual views::View* GetContentsView();
  // Yes, we're modal.
  // NOTE: if you change this you'll need to make sure it isn't possible to
  // close the window while importing.
  virtual bool IsModal() const { return true; }

  // Initializes the controls on the dialog.
  void SetupControls();

  views::Checkbox* MakeCheckBox(int resource_id);

  views::Label* main_label_;
  views::Checkbox* import_cbox_;
  views::Combobox* import_from_combo_;
  views::Label* shortcuts_label_;
  views::Checkbox* desktop_shortcut_cbox_;
  views::Checkbox* quick_shortcut_cbox_;

  CustomizeViewObserver* customize_observer_;



Generated by  Doxygen 1.6.0   Back to index