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 3// found in the LICENSE file. 4 5#ifndef CHROME_BROWSER_UI_VIEWS_IMPORTER_IMPORT_LOCK_DIALOG_VIEW_H_ 6#define CHROME_BROWSER_UI_VIEWS_IMPORTER_IMPORT_LOCK_DIALOG_VIEW_H_ 7#pragma once 8 9#include "base/basictypes.h" 10#include "base/compiler_specific.h" 11#include "base/memory/ref_counted.h" 12#include "views/view.h" 13#include "views/window/dialog_delegate.h" 14 15namespace views { 16class Label; 17} 18 19class ImporterHost; 20 21// ImportLockDialogView asks the user to shut down Firefox before starting the 22// profile import. 23class ImportLockDialogView : public views::View, 24 public views::DialogDelegate { 25 public: 26 static void Show(gfx::NativeWindow parent, ImporterHost* importer_host); 27 28 private: 29 explicit ImportLockDialogView(ImporterHost* importer_host); 30 virtual ~ImportLockDialogView(); 31 32 // views::View: 33 virtual gfx::Size GetPreferredSize() OVERRIDE; 34 virtual void Layout() OVERRIDE; 35 36 // views::DialogDelegate: 37 virtual std::wstring GetDialogButtonLabel( 38 MessageBoxFlags::DialogButton button) const OVERRIDE; 39 virtual bool IsModal() const OVERRIDE; 40 virtual std::wstring GetWindowTitle() const OVERRIDE; 41 virtual bool Accept() OVERRIDE; 42 virtual bool Cancel() OVERRIDE; 43 virtual views::View* GetContentsView() OVERRIDE; 44 45 private: 46 views::Label* description_label_; 47 48 // Utility class that does the actual import. 49 scoped_refptr<ImporterHost> importer_host_; 50 51 DISALLOW_COPY_AND_ASSIGN(ImportLockDialogView); 52}; 53 54#endif // CHROME_BROWSER_UI_VIEWS_IMPORTER_IMPORT_LOCK_DIALOG_VIEW_H_ 55