OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ | 5 #ifndef CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ |
6 #define CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ | 6 #define CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/scoped_ptr.h" | 10 #include "base/scoped_ptr.h" |
11 #include "base/weak_ptr.h" | 11 #include "base/weak_ptr.h" |
12 #include "chrome_frame/infobars/infobar_content.h" | 12 #include "chrome_frame/infobars/infobar_content.h" |
13 | 13 |
14 class ReadyModeState; | 14 class ReadyModeState; |
15 class ReadyPromptWindow; | 15 class ReadyPromptWindow; |
| 16 class UrlLauncher; |
16 | 17 |
17 // Encapsulates the Ready Mode prompt inviting users to permanently activate | 18 // Encapsulates the Ready Mode prompt inviting users to permanently activate |
18 // Chrome Frame, temporarily disable Ready Mode, or permanently disable Ready | 19 // Chrome Frame, temporarily disable Ready Mode, or permanently disable Ready |
19 // Mode. | 20 // Mode. |
20 class ReadyPromptContent : public InfobarContent { | 21 class ReadyPromptContent : public InfobarContent { |
21 public: | 22 public: |
22 explicit ReadyPromptContent(ReadyModeState* ready_mode_state); | 23 // Takes ownership of the ReadyModeState and UrlLauncher instances, which |
23 ~ReadyPromptContent(); | 24 // will be freed upon destruction of the ReadyPromptContent. |
| 25 ReadyPromptContent(ReadyModeState* ready_mode_state, |
| 26 UrlLauncher* url_launcher); |
| 27 virtual ~ReadyPromptContent(); |
24 | 28 |
25 // InfobarContent implementation | 29 // InfobarContent implementation |
26 virtual bool InstallInFrame(Frame* frame); | 30 virtual bool InstallInFrame(Frame* frame); |
27 virtual void SetDimensions(const RECT& dimensions); | 31 virtual void SetDimensions(const RECT& dimensions); |
28 virtual size_t GetDesiredSize(size_t width, size_t height); | 32 virtual size_t GetDesiredSize(size_t width, size_t height); |
29 | 33 |
30 private: | 34 private: |
31 base::WeakPtr<ReadyPromptWindow> window_; | 35 base::WeakPtr<ReadyPromptWindow> window_; |
32 scoped_ptr<ReadyModeState> ready_mode_state_; | 36 scoped_ptr<ReadyModeState> ready_mode_state_; |
| 37 scoped_ptr<UrlLauncher> url_launcher_; |
33 | 38 |
34 DISALLOW_COPY_AND_ASSIGN(ReadyPromptContent); | 39 DISALLOW_COPY_AND_ASSIGN(ReadyPromptContent); |
35 }; // class ReadyPromptContent | 40 }; // class ReadyPromptContent |
36 | 41 |
37 #endif // CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ | 42 #endif // CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_CONTENT_H_ |
OLD | NEW |