diff options
author | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 19:28:50 +0000 |
---|---|---|
committer | erikwright@chromium.org <erikwright@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-12 19:28:50 +0000 |
commit | 6e58a95b99e1c88172d5eae8925c8dfa39c2b765 (patch) | |
tree | 77e93bb7e93198024c36e5a6bba434b9412820ac /chrome_frame/infobars | |
parent | f24a74a242f8605d43085d6cc0cb36e5e376b2d4 (diff) | |
download | chromium_src-6e58a95b99e1c88172d5eae8925c8dfa39c2b765.zip chromium_src-6e58a95b99e1c88172d5eae8925c8dfa39c2b765.tar.gz chromium_src-6e58a95b99e1c88172d5eae8925c8dfa39c2b765.tar.bz2 |
Integrate the Ready Mode prompt with IE and Chrome Frame. In Ready Mode, prompts are displayed when the user browses to GCF-enabled sites, allowing the user to permanently activate, permanently decline, or temporarily decline Chrome Frame.
BUG=None
TEST=chrome_frame_unittests --gtest_filter=Ready* && chrome_frame_unittests --gtest_filter=Infobar* && setup.exe --chrome-frame --ready-mode --multi-install --system--level --chrome
Review URL: http://codereview.chromium.org/6040003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71215 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome_frame/infobars')
-rw-r--r-- | chrome_frame/infobars/internal/infobar_window.cc | 33 | ||||
-rw-r--r-- | chrome_frame/infobars/internal/infobar_window.h | 4 |
2 files changed, 29 insertions, 8 deletions
diff --git a/chrome_frame/infobars/internal/infobar_window.cc b/chrome_frame/infobars/internal/infobar_window.cc index 92c332a..c2964f1 100644 --- a/chrome_frame/infobars/internal/infobar_window.cc +++ b/chrome_frame/infobars/internal/infobar_window.cc @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. // @@ -23,7 +23,8 @@ const int kInfobarSlideCloseStep = 6; } // namespace void OnSliderTimer(InfobarWindow::Host* host) { - host->UpdateLayout(); + if (host) + host->UpdateLayout(); } InfobarWindow::InfobarWindow(InfobarType type) @@ -41,9 +42,10 @@ InfobarWindow::InfobarWindow(InfobarType type) } InfobarWindow::~InfobarWindow() { - StopTimer(); - if (timer_stub_ != NULL) + if (StopTimer() && timer_stub_ != NULL) FunctionStub::Destroy(timer_stub_); + else if (timer_stub_ != NULL) + timer_stub_->set_argument(NULL); // Couldn't stop it, so orphan and disable } void InfobarWindow::SetHost(Host* host) { @@ -137,6 +139,15 @@ void InfobarWindow::StartSlidingTowards(int target_height) { } bool InfobarWindow::StartTimer() { + return false; // TODO(erikwright): Diagnose and fix crashes on IE. +#if 0 + if (timer_id_ != 0) + return true; + + DCHECK(timer_stub_ != NULL); + if (timer_stub_ == NULL) + return false; + timer_id_ = ::SetTimer(NULL, timer_id_, kInfobarSlidingTimerIntervalMs, @@ -145,10 +156,20 @@ bool InfobarWindow::StartTimer() { DPLOG_IF(ERROR, timer_id_ == 0) << "Failure in SetTimer."; return timer_id_ != 0; +#endif } -void InfobarWindow::StopTimer() { - ::KillTimer(NULL, timer_id_); +bool InfobarWindow::StopTimer() { + if (timer_id_ == 0) + return true; + + if (::KillTimer(NULL, timer_id_)) { + timer_id_ = 0; + return true; + } + + DPLOG(ERROR) << "Failure in KillTimer."; + return false; } int InfobarWindow::CalculateHeight() { diff --git a/chrome_frame/infobars/internal/infobar_window.h b/chrome_frame/infobars/internal/infobar_window.h index cc81bcc..434c5cd 100644 --- a/chrome_frame/infobars/internal/infobar_window.h +++ b/chrome_frame/infobars/internal/infobar_window.h @@ -1,4 +1,4 @@ -// Copyright (c) 2010 The Chromium Authors. All rights reserved. +// Copyright (c) 2011 The Chromium Authors. All rights reserved. // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. @@ -82,7 +82,7 @@ class InfobarWindow { // Manage a timer that repeatedly calls Host::UpdateLayout bool StartTimer(); - void StopTimer(); + bool StopTimer(); scoped_ptr<InfobarContent> content_; Host* host_; |