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

Side by Side Diff: chrome_frame/test/net/dialog_watchdog.h

Issue 218019: Initial import of the Chrome Frame codebase. Integration in chrome.gyp coming... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 11 years, 3 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
« no previous file with comments | « chrome_frame/test/icu_stubs_unittests.cc ('k') | chrome_frame/test/net/dialog_watchdog.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef CHROME_FRAME_TEST_NET_DIALOG_WATCHDOG_H_
6 #define CHROME_FRAME_TEST_NET_DIALOG_WATCHDOG_H_
7
8 #include <windows.h>
9
10 #include <string>
11 #include <vector>
12
13 struct FunctionStub;
14
15 class DialogWatchdogObserver { // NOLINT
16 public:
17 // returns true if this observer handled the dialog.
18 virtual bool OnDialogDetected(HWND hwnd, const std::string& caption) = 0;
19 };
20
21 class SupplyProxyCredentials : public DialogWatchdogObserver {
22 public:
23 SupplyProxyCredentials(const char* username, const char* password);
24
25 protected:
26 struct DialogProps {
27 HWND username_;
28 HWND password_;
29 };
30
31 virtual bool OnDialogDetected(HWND hwnd, const std::string& caption);
32 static BOOL CALLBACK EnumChildren(HWND hwnd, LPARAM param);
33
34 protected:
35 std::string username_;
36 std::string password_;
37 };
38
39 class DialogWatchdog {
40 public:
41 DialogWatchdog();
42 ~DialogWatchdog();
43
44 inline void AddObserver(DialogWatchdogObserver* observer) {
45 observers_.push_back(observer);
46 }
47
48 bool Initialize();
49 void Uninitialize();
50
51 protected:
52 static void CALLBACK WinEventHook(DialogWatchdog* me, HWINEVENTHOOK hook,
53 DWORD event, HWND hwnd, LONG object_id, LONG child_id,
54 DWORD event_thread_id, DWORD event_time);
55
56 void OnDialogFound(HWND hwnd, const std::string& caption);
57
58 protected:
59 HWINEVENTHOOK hook_;
60 std::vector<DialogWatchdogObserver*> observers_;
61 FunctionStub* hook_stub_;
62 };
63
64 #endif // CHROME_FRAME_TEST_NET_DIALOG_WATCHDOG_H_
OLDNEW
« no previous file with comments | « chrome_frame/test/icu_stubs_unittests.cc ('k') | chrome_frame/test/net/dialog_watchdog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698