Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(33)

Side by Side Diff: chrome/browser/ui/views/first_run_bubble.h

Issue 8265005: first run bubble using the views/bubble api. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: update. Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
10 #include "base/compiler_specific.h" 10 #include "base/compiler_specific.h"
11 #include "base/memory/weak_ptr.h" 11 #include "base/memory/weak_ptr.h"
12 #include "chrome/browser/first_run/first_run.h" 12 #include "chrome/browser/first_run/first_run.h"
13 #include "chrome/browser/ui/views/bubble/bubble.h" 13 #include "views/bubble/bubble_delegate.h"
14 14
15 class FirstRunBubbleViewBase; 15 class FirstRunBubbleView;
16 class Profile; 16 class Profile;
17 17
18 class FirstRunBubble : public Bubble, 18 class FirstRunBubble : public views::BubbleDelegateView {
19 public BubbleDelegate {
20 public: 19 public:
20 // Static method to create a first run bubble and delegate.
21 static FirstRunBubble* Show(Profile* profile, 21 static FirstRunBubble* Show(Profile* profile,
22 views::Widget* parent, 22 views::Widget* parent,
23 const gfx::Rect& position_relative_to, 23 const gfx::Rect& position_relative_to,
24 views::BubbleBorder::ArrowLocation arrow_location, 24 views::BubbleBorder::ArrowLocation location);
25 FirstRun::BubbleType bubble_type); 25
26 // WidgetDelegate override:
27 virtual void WindowClosing() OVERRIDE;
28
29 FirstRunBubbleView* view() const { return view_; }
30
31 protected:
32 // BubbleDelegateView override:
33 virtual void Init() OVERRIDE;
26 34
27 private: 35 private:
28 FirstRunBubble(); 36 FirstRunBubble(Profile* profile,
37 views::Widget* parent,
38 const gfx::Rect& position_relative_to,
39 views::BubbleBorder::ArrowLocation arrow_location);
29 virtual ~FirstRunBubble(); 40 virtual ~FirstRunBubble();
30 41
31 void set_view(FirstRunBubbleViewBase* view) { view_ = view; } 42 #if defined(OS_WIN) && !defined(USE_AURA)
32
33 // Re-enable the parent window. 43 // Re-enable the parent window.
34 void EnableParent(); 44 void EnableParent();
35 45
36 #if defined(OS_WIN) && !defined(USE_AURA)
37 // Overridden from Bubble: 46 // Overridden from Bubble:
38 virtual void OnActivate(UINT action, BOOL minimized, HWND window) OVERRIDE; 47 virtual void OnActivate(UINT action, BOOL minimized, HWND window) OVERRIDE;
39 #endif 48 #endif
40 49
41 // BubbleDelegate. 50 Profile* profile_;
42 virtual void BubbleClosing(Bubble* bubble, bool closed_by_escape) OVERRIDE; 51
43 virtual bool CloseOnEscape() OVERRIDE { return true; } 52 views::Widget* parent_;
44 virtual bool FadeInOnShow() OVERRIDE { return true; }
45 53
46 // Whether we have already been activated. 54 // Whether we have already been activated.
47 bool has_been_activated_; 55 bool has_been_activated_;
48 56
49 base::WeakPtrFactory<FirstRunBubble> enable_window_method_factory_; 57 base::WeakPtrFactory<FirstRunBubble> enable_window_method_factory_;
50 58
51 // The view inside the FirstRunBubble. 59 // The view inside the FirstRunBubble.
52 FirstRunBubbleViewBase* view_; 60 FirstRunBubbleView* view_;
53 61
54 DISALLOW_COPY_AND_ASSIGN(FirstRunBubble); 62 DISALLOW_COPY_AND_ASSIGN(FirstRunBubble);
55 }; 63 };
56 64
57 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_ 65 #endif // CHROME_BROWSER_UI_VIEWS_FIRST_RUN_BUBBLE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698