summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome_frame/chrome_frame_activex.cc2
-rw-r--r--chrome_frame/urlmon_url_request.cc13
-rw-r--r--chrome_frame/urlmon_url_request.h8
-rw-r--r--chrome_frame/urlmon_url_request_private.h9
4 files changed, 27 insertions, 5 deletions
diff --git a/chrome_frame/chrome_frame_activex.cc b/chrome_frame/chrome_frame_activex.cc
index 3104f0e..a88c5f1 100644
--- a/chrome_frame/chrome_frame_activex.cc
+++ b/chrome_frame/chrome_frame_activex.cc
@@ -410,6 +410,8 @@ HRESULT ChromeFrameActivex::IOleObject_SetClientSite(
if (SUCCEEDED(service_hr) && wants_privileged)
is_privileged_ = true;
+
+ url_fetcher_.set_privileged_mode(is_privileged_);
}
std::wstring chrome_extra_arguments;
diff --git a/chrome_frame/urlmon_url_request.cc b/chrome_frame/urlmon_url_request.cc
index 229e196..6f1a123 100644
--- a/chrome_frame/urlmon_url_request.cc
+++ b/chrome_frame/urlmon_url_request.cc
@@ -39,7 +39,8 @@ UrlmonUrlRequest::UrlmonUrlRequest()
: pending_read_size_(0),
headers_received_(false),
thread_(NULL),
- parent_window_(NULL) {
+ parent_window_(NULL),
+ privileged_mode_(false) {
DLOG(INFO) << StringPrintf("Created request. Obj: %X", this);
}
@@ -546,9 +547,11 @@ STDMETHODIMP UrlmonUrlRequest::GetWindow(const GUID& guid_reason,
STDMETHODIMP UrlmonUrlRequest::Authenticate(HWND* parent_window,
LPWSTR* user_name,
LPWSTR* password) {
- if (!parent_window) {
+ if (!parent_window)
return E_INVALIDARG;
- }
+
+ if (privileged_mode_)
+ return E_ACCESSDENIED;
DCHECK(::IsWindow(parent_window_));
*parent_window = parent_window_;
@@ -897,6 +900,7 @@ void UrlmonUrlRequestManager::StartRequestWorker(int request_id,
request_info.upload_data,
enable_frame_busting_);
new_request->set_parent_window(notification_window_);
+ new_request->set_privileged_mode(privileged_mode_);
// Shall we use previously fetched data?
if (request_for_url.get()) {
@@ -1039,7 +1043,8 @@ scoped_refptr<UrlmonUrlRequest> UrlmonUrlRequestManager::LookupRequest(
UrlmonUrlRequestManager::UrlmonUrlRequestManager()
: stopping_(false), worker_thread_("UrlMon fetch thread"),
- map_empty_(true, true), notification_window_(NULL) {
+ map_empty_(true, true), notification_window_(NULL),
+ privileged_mode_(false) {
}
UrlmonUrlRequestManager::~UrlmonUrlRequestManager() {
diff --git a/chrome_frame/urlmon_url_request.h b/chrome_frame/urlmon_url_request.h
index 38ba257..6ab6bcb 100644
--- a/chrome_frame/urlmon_url_request.h
+++ b/chrome_frame/urlmon_url_request.h
@@ -86,6 +86,12 @@ class UrlmonUrlRequestManager
notification_window_ = window;
}
+ // This function passes information on whether ChromeFrame is running in
+ // privileged mode.
+ void set_privileged_mode(bool privileged_mode) {
+ privileged_mode_ = privileged_mode;
+ }
+
private:
friend class MessageLoop;
friend struct RunnableMethodTraits<UrlmonUrlRequestManager>;
@@ -137,6 +143,8 @@ class UrlmonUrlRequestManager
PrivacyInfo privacy_info_;
// The window to be used to fire notifications on.
HWND notification_window_;
+ // Set to true if the ChromeFrame instance is running in privileged mode.
+ bool privileged_mode_;
};
#endif // CHROME_FRAME_URLMON_URL_REQUEST_H_
diff --git a/chrome_frame/urlmon_url_request_private.h b/chrome_frame/urlmon_url_request_private.h
index 1f76057..10dcedf 100644
--- a/chrome_frame/urlmon_url_request_private.h
+++ b/chrome_frame/urlmon_url_request_private.h
@@ -40,6 +40,12 @@ class UrlmonUrlRequest
parent_window_ = parent_window;
}
+ // This function passes information on whether ChromeFrame is running in
+ // privileged mode.
+ void set_privileged_mode(bool privileged_mode) {
+ privileged_mode_ = privileged_mode;
+ }
+
protected:
UrlmonUrlRequest();
~UrlmonUrlRequest();
@@ -302,7 +308,8 @@ class UrlmonUrlRequest
PlatformThreadId thread_;
HWND parent_window_;
bool headers_received_;
-
+ // Set to true if the ChromeFrame instance is running in privileged mode.
+ bool privileged_mode_;
DISALLOW_COPY_AND_ASSIGN(UrlmonUrlRequest);
};