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

Side by Side Diff: chrome_frame/turndown_prompt/turndown_prompt_window.h

Issue 18769007: Make the dismiss button on the CF infobar be an image button. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 5 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_ 5 #ifndef CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_
6 #define CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_ 6 #define CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_
7 7
8 #include <windows.h> 8 #include <windows.h>
9 #include <atlbase.h> 9 #include <atlbase.h>
10 #include <atlapp.h> 10 #include <atlapp.h>
(...skipping 10 matching lines...) Expand all
21 #include "base/win/scoped_comptr.h" 21 #include "base/win/scoped_comptr.h"
22 #include "base/win/scoped_handle.h" 22 #include "base/win/scoped_handle.h"
23 #include "chrome_frame/infobars/infobar_content.h" 23 #include "chrome_frame/infobars/infobar_content.h"
24 #include "chrome_frame/resource.h" 24 #include "chrome_frame/resource.h"
25 #include "grit/chrome_frame_dialogs.h" 25 #include "grit/chrome_frame_dialogs.h"
26 26
27 class UrlLauncher; 27 class UrlLauncher;
28 28
29 namespace WTL { 29 namespace WTL {
30 class CHyperLink; 30 class CHyperLink;
31 class CBitmapButton;
31 } // namespace WTL 32 } // namespace WTL
32 33
34 class CFBitmapButton;
35
33 // Implements a dialog with text and buttons notifying the user that Chrome 36 // Implements a dialog with text and buttons notifying the user that Chrome
34 // Frame is being turned down, offering them a link to learn more about moving 37 // Frame is being turned down, offering them a link to learn more about moving
35 // to a modern browser. 38 // to a modern browser.
36 class TurndownPromptWindow 39 class TurndownPromptWindow
37 : public CDialogImpl<TurndownPromptWindow, CWindow>, 40 : public CDialogImpl<TurndownPromptWindow, CWindow>,
38 public CDialogResize<TurndownPromptWindow>, 41 public CDialogResize<TurndownPromptWindow>,
39 public CThemeImpl<TurndownPromptWindow> { 42 public CThemeImpl<TurndownPromptWindow> {
40 public: 43 public:
41 enum { IDD = IDD_CHROME_FRAME_TURNDOWN_PROMPT }; 44 enum { IDD = IDD_CHROME_FRAME_TURNDOWN_PROMPT };
42 45
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 79
77 private: 80 private:
78 // Call CreateInstance() to get an initialized TurndownPromptWindow. 81 // Call CreateInstance() to get an initialized TurndownPromptWindow.
79 TurndownPromptWindow(InfobarContent::Frame* frame, 82 TurndownPromptWindow(InfobarContent::Frame* frame,
80 UrlLauncher* url_launcher, 83 UrlLauncher* url_launcher,
81 const base::Closure& uninstall_closure); 84 const base::Closure& uninstall_closure);
82 85
83 // The TurndownPromptWindow manages its own destruction. 86 // The TurndownPromptWindow manages its own destruction.
84 virtual ~TurndownPromptWindow(); 87 virtual ~TurndownPromptWindow();
85 88
89 // Performs the necessary configuration to initialize a bitmap button.
90 static void SetupBitmapButton(
91 const base::WeakPtr<TurndownPromptWindow>& window);
92
86 // Event handlers. 93 // Event handlers.
87 void OnDestroy(); 94 void OnDestroy();
88 BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam); 95 BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
89 LRESULT OnLearnMore(WORD wParam, LPNMHDR lParam, BOOL& bHandled); // NOLINT 96 LRESULT OnLearnMore(WORD wParam, LPNMHDR lParam, BOOL& bHandled); // NOLINT
90 LRESULT OnUninstall(WORD wNotifyCode, 97 LRESULT OnUninstall(WORD wNotifyCode,
91 WORD wID, 98 WORD wID,
92 HWND hWndCtl, 99 HWND hWndCtl,
93 BOOL& bHandled); 100 BOOL& bHandled);
94 LRESULT OnDismiss(WORD wNotifyCode, 101 LRESULT OnDismiss(WORD wNotifyCode,
95 WORD wID, 102 WORD wID,
96 HWND hWndCtl, 103 HWND hWndCtl,
97 BOOL& bHandled); 104 BOOL& bHandled);
98 105
99 // Returns the prompt text for the current version of IE. 106 // Returns the prompt text for the current version of IE.
100 static string16 GetPromptText(); 107 static string16 GetPromptText();
101 108
102 InfobarContent::Frame* frame_; // Not owned by this instance 109 InfobarContent::Frame* frame_; // Not owned by this instance
103 scoped_ptr<WTL::CHyperLink> link_; 110 scoped_ptr<WTL::CHyperLink> link_;
111 scoped_ptr<CFBitmapButton> close_button_;
104 scoped_ptr<UrlLauncher> url_launcher_; 112 scoped_ptr<UrlLauncher> url_launcher_;
105 base::Closure uninstall_closure_; 113 base::Closure uninstall_closure_;
106 114
107 base::WeakPtrFactory<TurndownPromptWindow> weak_ptr_factory_; 115 base::WeakPtrFactory<TurndownPromptWindow> weak_ptr_factory_;
108 DISALLOW_COPY_AND_ASSIGN(TurndownPromptWindow); 116 DISALLOW_COPY_AND_ASSIGN(TurndownPromptWindow);
109 }; // class TurndownPromptWindow 117 }; // class TurndownPromptWindow
110 118
111 #endif // CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_ 119 #endif // CHROME_FRAME_TURNDOWN_PROMPT_TURNDOWN_PROMPT_WINDOW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698