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