summaryrefslogtreecommitdiffstats
path: root/remoting/host/setup/win
diff options
context:
space:
mode:
Diffstat (limited to 'remoting/host/setup/win')
-rw-r--r--remoting/host/setup/win/auth_code_getter.cc10
-rw-r--r--remoting/host/setup/win/auth_code_getter.h2
2 files changed, 4 insertions, 8 deletions
diff --git a/remoting/host/setup/win/auth_code_getter.cc b/remoting/host/setup/win/auth_code_getter.cc
index 89ce104..6b3944d 100644
--- a/remoting/host/setup/win/auth_code_getter.cc
+++ b/remoting/host/setup/win/auth_code_getter.cc
@@ -18,7 +18,6 @@ namespace remoting {
AuthCodeGetter::AuthCodeGetter() :
browser_(NULL),
- browser_running_(false),
timer_interval_(base::TimeDelta::FromMilliseconds(kUrlPollIntervalMs)) {
}
@@ -28,7 +27,7 @@ AuthCodeGetter::~AuthCodeGetter() {
void AuthCodeGetter::GetAuthCode(
base::Callback<void(const std::string&)> on_auth_code) {
- if (browser_running_) {
+ if (browser_) {
on_auth_code.Run("");
return;
}
@@ -39,7 +38,6 @@ void AuthCodeGetter::GetAuthCode(
on_auth_code_.Run("");
return;
}
- browser_running_ = true;
base::win::ScopedBstr url(UTF8ToWide(
GetOauthStartUrl(GetDefaultOauthRedirectUrl())).c_str());
base::win::ScopedVariant empty_variant;
@@ -69,7 +67,7 @@ void AuthCodeGetter::OnTimer() {
bool AuthCodeGetter::TestBrowserUrl(std::string* auth_code) {
*auth_code = "";
- if (!browser_running_) {
+ if (!browser_) {
return true;
}
base::win::ScopedBstr url;
@@ -88,9 +86,9 @@ bool AuthCodeGetter::TestBrowserUrl(std::string* auth_code) {
}
void AuthCodeGetter::KillBrowser() {
- if (browser_running_) {
+ if (browser_) {
browser_->Quit();
- browser_running_ = false;
+ browser_.Release();
}
}
diff --git a/remoting/host/setup/win/auth_code_getter.h b/remoting/host/setup/win/auth_code_getter.h
index 2e09922..5cb9d81 100644
--- a/remoting/host/setup/win/auth_code_getter.h
+++ b/remoting/host/setup/win/auth_code_getter.h
@@ -43,8 +43,6 @@ class AuthCodeGetter : public base::NonThreadSafe {
base::Callback<void(const std::string&)> on_auth_code_;
// The browser through which the user requests an authorization code.
base::win::ScopedComPtr<IWebBrowser2, &IID_IWebBrowser2> browser_;
- // Whether the browser is running.
- bool browser_running_;
// A timer used to poll the browser's URL.
base::OneShotTimer<AuthCodeGetter> timer_;
// The interval at which the timer fires.