What's new? | Help | Directory | Sign in
Google
             
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
// Copyright 2006, Google Inc.
//
// Redistribution and use in source and binary forms, with or without
// modification, are permitted provided that the following conditions are met:
//
// 1. Redistributions of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
// 2. Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
// 3. Neither the name of Google Inc. nor the names of its contributors may be
// used to endorse or promote products derived from this software without
// specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
// WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
// EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
// SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
// PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
// OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
// WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
// OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
// ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifdef WINCE
#include "gears/base/ie/activex_utils.h"
#endif
#include "gears/base/common/detect_version_collision.h"
#include "gears/base/common/exception_handler.h"
#include "gears/base/common/trace_buffers_win32/trace_buffers_win32.h"
#include "gears/base/common/user_config.h"
#include "gears/base/ie/bho.h"
#include "gears/factory/factory_utils.h"
#ifdef WINCE
#include "gears/installer/iemobile/cab_updater.h"
#endif
#include "gears/localserver/ie/http_handler_ie.h"

#ifdef WINCE
HWND BrowserHelperObject::browser_window_ = NULL;
#endif

STDAPI BrowserHelperObject::SetSite(IUnknown *pUnkSite) {
#if defined(WIN32) && !defined(WINCE)
// Only send crash reports for offical builds. Crashes on an engineer's machine
// during internal development are confusing false alarms.
#ifdef OFFICIAL_BUILD
if (IsUsageReportingAllowed()) {
static ExceptionManager exception_manager(false); // false == only our DLL
exception_manager.StartMonitoring();
// Trace buffers only exist in dbg official builds.
#ifdef DEBUG
exception_manager.AddMemoryRange(g_trace_buffers,
sizeof(g_trace_buffers));
exception_manager.AddMemoryRange(g_trace_positions,
sizeof(g_trace_positions));
#endif // DEBUG
}
#endif // OFFICIAL_BUILD
#endif // WIN32 && !WINCE

if (DetectedVersionCollision())
return S_OK;

if (pUnkSite == NULL) {
// We never get here on WinCE so we cannot know when we are
// uninitialized. SetSite should be called with pUnkSite = NULL
// when the BHO is unitialized. It seems that this call
// is not made on WinCE.
LOG16((L"SetSite(): pUnkSite is NULL\n"));
} else {
HttpHandler::Register();
#ifdef WINCE
static CabUpdater updater;
CComQIPtr<IWebBrowser2> site = pUnkSite;
ASSERT(site);
updater.SetSiteAndStart(site);
assert(NULL == browser_window_);
site->get_HWND(reinterpret_cast<long*>(&browser_window_));
#endif
}
return S_OK;
}

#ifdef WINCE
// static
HWND BrowserHelperObject::GetBrowserWindow() {
return browser_window_;
}
#endif
Show details Hide details

Change log

r2769 by gears.daemon on Aug 27, 2008   Diff
[Author: aa]

Check registry before sending crash
reports.

PRESUBMIT=passed
R=cprince
CC=gears-internal
DELTA=106  (92 added, 0 deleted, 14
changed)
OCL=8105765
SCL=8117115
Go to: 
Project members, sign in to write a code review

Older revisions

r2554 by gears.daemon on Jul 30, 2008   Diff
[Author: nigeltao]

Flatten the gears/factory directory
hierarchy.
For example,
...
r2157 by gears.daemon on Jun 27, 2008   Diff
[Author: playmobil]

Gears-Side Breakpad integration.

PRESUBMIT=passed
...
r1642 by gears.daemon on May 13, 2008   Diff
[Author: cprince]

Fix build break: remove trace-buffer
references in opt official builds.

...
All revisions of this file

File info

Size: 3592 bytes, 90 lines