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

Side by Side Diff: chrome_frame/event_hooker.cc

Issue 126143005: Remove Chrome Frame code and resources. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync to r244038 Created 6 years, 11 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/event_hooker.h ('k') | chrome_frame/exception_barrier.h » ('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) 2010 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 #include "chrome_frame/event_hooker.h"
6
7 #include <crtdbg.h>
8 #include "chrome_frame/bho_loader.h"
9
10 EXTERN_C IMAGE_DOS_HEADER __ImageBase;
11
12 EventHooker::EventHooker()
13 : window_creation_hook_(NULL) {}
14
15 EventHooker::~EventHooker() {
16 StopHook();
17 }
18
19 bool EventHooker::StartHook() {
20 if ((NULL != window_creation_hook_)) {
21 return false;
22 }
23
24 window_creation_hook_ = SetWinEventHook(EVENT_OBJECT_CREATE,
25 EVENT_OBJECT_CREATE,
26 reinterpret_cast<HMODULE>(
27 &__ImageBase),
28 WindowCreationHookProc,
29 0,
30 0,
31 WINEVENT_INCONTEXT);
32 if (NULL == window_creation_hook_) {
33 return false;
34 }
35 return true;
36 }
37
38 void EventHooker::StopHook() {
39 if (NULL != window_creation_hook_) {
40 UnhookWinEvent(window_creation_hook_);
41 window_creation_hook_ = NULL;
42 }
43 }
44
45 VOID CALLBACK EventHooker::WindowCreationHookProc(HWINEVENTHOOK hook,
46 DWORD event,
47 HWND window,
48 LONG object_id,
49 LONG child_id,
50 DWORD event_tid,
51 DWORD event_time) {
52 _ASSERTE((EVENT_OBJECT_CREATE == event) ||
53 (EVENT_OBJECT_PARENTCHANGE == event));
54 if (OBJID_WINDOW == object_id) {
55 BHOLoader::GetInstance()->OnHookEvent(event, window);
56 }
57 }
58
OLDNEW
« no previous file with comments | « chrome_frame/event_hooker.h ('k') | chrome_frame/exception_barrier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698