summaryrefslogtreecommitdiffstats
path: root/remoting
diff options
context:
space:
mode:
authorsimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 23:31:40 +0000
committersimonmorris@chromium.org <simonmorris@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-10-30 23:31:40 +0000
commiteba4b810a15cc813333aa24e21a451f649214079 (patch)
tree1f74d9977451938a083b29a97f37ccd92d8781ca /remoting
parent4a04889139472080d9be371c2c0f618c4da4e7a0 (diff)
downloadchromium_src-eba4b810a15cc813333aa24e21a451f649214079.zip
chromium_src-eba4b810a15cc813333aa24e21a451f649214079.tar.gz
chromium_src-eba4b810a15cc813333aa24e21a451f649214079.tar.bz2
[Chromoting] Make the AuthCodeGetter component of the Windows host configurer
use ScopedComPtr correctly. BUG=158611 Review URL: https://chromiumcodereview.appspot.com/11343050 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@165061 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting')
-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.