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