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_FIRST_RUN_BUBBLE_H_ 6#define CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_ 7#pragma once 8 9#include "base/compiler_specific.h" 10#include "base/task.h" 11#include "chrome/browser/first_run/first_run.h" 12#include "chrome/browser/ui/views/bubble/bubble.h" 13 14class FirstRunBubbleViewBase; 15class Profile; 16 17class FirstRunBubble : public Bubble, 18 public BubbleDelegate { 19 public: 20 static FirstRunBubble* Show(Profile* profile, views::Widget* parent, 21 const gfx::Rect& position_relative_to, 22 BubbleBorder::ArrowLocation arrow_location, 23 FirstRun::BubbleType bubble_type); 24 25 private: 26 FirstRunBubble(); 27 virtual ~FirstRunBubble(); 28 29 void set_view(FirstRunBubbleViewBase* view) { view_ = view; } 30 31 // Re-enable the parent window. 32 void EnableParent(); 33 34#if defined(OS_WIN) 35 // Overridden from Bubble: 36 virtual void OnActivate(UINT action, BOOL minimized, HWND window); 37#endif 38 39 // BubbleDelegate. 40 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape); 41 virtual bool CloseOnEscape() { return true; } 42 virtual bool FadeInOnShow() { return true; } 43 44 // Whether we have already been activated. 45 bool has_been_activated_; 46 47 ScopedRunnableMethodFactory<FirstRunBubble> enable_window_method_factory_; 48 49 // The view inside the FirstRunBubble. 50 FirstRunBubbleViewBase* view_; 51 52 DISALLOW_COPY_AND_ASSIGN(FirstRunBubble); 53}; 54 55#endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_ 56