Chromium Code Reviews| 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/basictypes.h" |
|
msw
2011/11/12 03:35:55
nit: Can you check if this include is still needed
alicet1
2011/11/15 02:09:50
Done.
| |
| 10 #include "base/compiler_specific.h" | |
| 11 #include "base/memory/weak_ptr.h" | |
| 12 #include "chrome/browser/first_run/first_run.h" | 10 #include "chrome/browser/first_run/first_run.h" |
| 13 #include "chrome/browser/ui/views/bubble/bubble.h" | 11 #include "views/bubble/bubble_delegate.h" |
| 12 #include "views/controls/button/button.h" | |
| 14 | 13 |
| 15 class FirstRunBubbleViewBase; | |
| 16 class Profile; | 14 class Profile; |
| 17 | 15 |
| 18 class FirstRunBubble : public Bubble, | 16 class FirstRunBubble : public views::BubbleDelegateView, |
| 19 public BubbleDelegate { | 17 public views::ButtonListener { |
| 20 public: | 18 public: |
| 21 static FirstRunBubble* Show(Profile* profile, | 19 static FirstRunBubble* Show(Profile* profile, |
|
msw
2011/11/12 03:35:55
This overloads BubbleDelegateView::Show(), which i
alicet1
2011/11/15 02:09:50
Done.
| |
| 22 views::Widget* parent, | 20 views::View* anchor_view, |
| 23 const gfx::Rect& position_relative_to, | 21 views::BubbleBorder::ArrowLocation location, |
| 24 views::BubbleBorder::ArrowLocation arrow_location, | |
| 25 FirstRun::BubbleType bubble_type); | 22 FirstRun::BubbleType bubble_type); |
| 26 | 23 |
| 24 protected: | |
| 25 // views::BubbleDelegateView overrides: | |
| 26 virtual void Init() OVERRIDE; | |
|
msw
2011/11/12 03:35:55
nit: order Init after GetAnchorPoint, like BubbleD
alicet1
2011/11/15 02:09:50
Done.
| |
| 27 virtual gfx::Point GetAnchorPoint() OVERRIDE; | |
| 28 | |
| 27 private: | 29 private: |
| 28 FirstRunBubble(); | 30 FirstRunBubble(Profile* profile, |
| 31 views::View* anchor_view, | |
| 32 views::BubbleBorder::ArrowLocation arrow_location, | |
| 33 FirstRun::BubbleType bubble_type); | |
| 29 virtual ~FirstRunBubble(); | 34 virtual ~FirstRunBubble(); |
| 30 | 35 |
| 31 void set_view(FirstRunBubbleViewBase* view) { view_ = view; } | 36 // views::ButtonListener overrides: |
| 37 virtual void ButtonPressed(views::Button* sender, | |
| 38 const views::Event& event) OVERRIDE; | |
| 32 | 39 |
| 33 // Re-enable the parent window. | 40 Profile* profile_; |
| 34 void EnableParent(); | |
| 35 | 41 |
| 36 #if defined(OS_WIN) && !defined(USE_AURA) | 42 FirstRun::BubbleType bubble_type_; |
| 37 // Overridden from Bubble: | |
| 38 virtual void OnActivate(UINT action, BOOL minimized, HWND window) OVERRIDE; | |
| 39 #endif | |
| 40 | |
| 41 // BubbleDelegate. | |
| 42 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; | |
| 43 virtual bool CloseOnEscape() OVERRIDE { return true; } | |
| 44 virtual bool FadeInOnShow() OVERRIDE { return true; } | |
| 45 | |
| 46 // Whether we have already been activated. | |
| 47 bool has_been_activated_; | |
| 48 | |
| 49 base::WeakPtrFactory<FirstRunBubble> enable_window_method_factory_; | |
| 50 | |
| 51 // The view inside the FirstRunBubble. | |
| 52 FirstRunBubbleViewBase* view_; | |
| 53 | 43 |
| 54 DISALLOW_COPY_AND_ASSIGN(FirstRunBubble); | 44 DISALLOW_COPY_AND_ASSIGN(FirstRunBubble); |
| 55 }; | 45 }; |
| 56 | 46 |
| 57 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_ | 47 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_ |
| OLD | NEW |