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

Unified Diff: chrome_frame/ready_mode/internal/ready_prompt_window.h

Issue 5747002: Implement a ReadyPromptContent that displays a prompt to accept, temporarily ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome_frame/ready_mode/internal/ready_prompt_window.h
===================================================================
--- chrome_frame/ready_mode/internal/ready_prompt_window.h (revision 0)
+++ chrome_frame/ready_mode/internal/ready_prompt_window.h (revision 0)
@@ -0,0 +1,87 @@
+// Copyright (c) 2010 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_WINDOW_H_
+#define CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_WINDOW_H_
+#pragma once
+
+#include <atlbase.h>
+#include <atlapp.h>
+#include <atlcrack.h>
+#include <atlframe.h>
+#include <atlwin.h>
+
+#include "base/weak_ptr.h"
+#include "base/scoped_ptr.h"
+#include "chrome_frame/infobars/infobar_content.h"
+#include "chrome_frame/resource.h"
+#include "grit/generated_resources.h"
+
+class ReadyModeState;
+
+// Implements a dialog with text and buttons inviting the user to permanently
+// activate the product or temporarily/permanently disable Ready Mode.
+class ReadyPromptWindow
+ : public CDialogImpl<ReadyPromptWindow, CWindow>,
+ public CDialogResize<ReadyPromptWindow> {
+ public:
+ enum { IDD = IDD_CHROME_FRAME_READY_PROMPT };
+
+ ReadyPromptWindow();
+ ~ReadyPromptWindow() {}
+
+ // Initializes the dialog for display in the provided frame. The
+ // ReadyModeState will be invoked to capture the user's response, if any.
+ //
+ // Upon success, takes ownership of itself (to be deleted upon WM_DESTROY) and
+ // returns a weak pointer to this dialog. Upon failure, returns a null weak
+ // pointer and deletes self.
+ //
+ // In either case, takes ownership of the ReadyModeState, but not the frame.
+ base::WeakPtr<ReadyPromptWindow> Initialize(InfobarContent::Frame* frame,
+ ReadyModeState* ready_mode_state);
+
+ BEGIN_MSG_MAP(InfobarWindow)
+ MSG_WM_INITDIALOG(OnInitDialog)
+ MSG_WM_DESTROY(OnDestroy)
+ COMMAND_HANDLER(IDACTIVATE, BN_CLICKED, OnYes)
+ COMMAND_HANDLER(IDLATER, BN_CLICKED, OnRemindMeLater)
+ COMMAND_HANDLER(IDNEVER, BN_CLICKED, OnNo)
+ CHAIN_MSG_MAP(CDialogResize<ReadyPromptWindow>)
+ END_MSG_MAP()
+
+ BEGIN_DLGRESIZE_MAP(InfobarWindow)
+ DLGRESIZE_CONTROL(IDACTIVATE, DLSZ_CENTER_Y | DLSZ_MOVE_X)
+ DLGRESIZE_CONTROL(IDLATER, DLSZ_CENTER_Y | DLSZ_MOVE_X)
+ DLGRESIZE_CONTROL(IDNEVER, DLSZ_CENTER_Y | DLSZ_MOVE_X)
+ DLGRESIZE_CONTROL(IDC_PROMPT_MESSAGE, DLSZ_SIZE_Y | DLSZ_SIZE_X)
+ END_DLGRESIZE_MAP()
+
+ virtual void OnFinalMessage(HWND);
+
+ private:
+ // Event handlers.
+ void OnDestroy();
+ BOOL OnInitDialog(CWindow wndFocus, LPARAM lInitParam);
+ LRESULT OnYes(WORD wNotifyCode,
+ WORD wID,
+ HWND hWndCtl,
+ BOOL& bHandled);
+ LRESULT OnRemindMeLater(WORD wNotifyCode,
+ WORD wID,
+ HWND hWndCtl,
+ BOOL& bHandled);
+ LRESULT OnNo(WORD wNotifyCode,
+ WORD wID,
+ HWND hWndCtl,
+ BOOL& bHandled);
+
+ InfobarContent::Frame* frame_; // Not owned by this instance
+ scoped_ptr<ReadyModeState> ready_mode_state_;
+
+ base::WeakPtrFactory<ReadyPromptWindow> weak_ptr_factory_;
+ DISALLOW_COPY_AND_ASSIGN(ReadyPromptWindow);
+}; // class ReadyPromptWindow
+
+#endif // CHROME_FRAME_READY_MODE_INTERNAL_READY_PROMPT_WINDOW_H_
Property changes on: chrome_frame\ready_mode\internal\ready_prompt_window.h
___________________________________________________________________
Added: svn:eol-style
+ LF
« no previous file with comments | « chrome_frame/ready_mode/internal/ready_prompt_content.cc ('k') | chrome_frame/ready_mode/internal/ready_prompt_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698