Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1365)

Unified Diff: chrome/browser/extensions/app_notify_channel_ui.cc

Issue 8787013: Fix the following issue in app notify login flow: (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/extensions/app_notify_channel_ui.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/extensions/app_notify_channel_ui.cc
===================================================================
--- chrome/browser/extensions/app_notify_channel_ui.cc (revision 112840)
+++ chrome/browser/extensions/app_notify_channel_ui.cc (working copy)
@@ -87,7 +87,7 @@
TabContentsWrapper* wrapper,
const std::string& app_name)
: browser_(browser), wrapper_(wrapper), app_name_(app_name),
- delegate_(NULL), observing_sync_(false), got_first_sync_callback_(false) {
+ delegate_(NULL), observing_sync_(false), wizard_shown_to_user_(false) {
}
AppNotifyChannelUIImpl::~AppNotifyChannelUIImpl() {
@@ -125,8 +125,13 @@
void AppNotifyChannelUIImpl::OnStateChanged() {
ProfileSyncService* sync_service =
browser_->profile()->GetProfileSyncService();
- bool finished = got_first_sync_callback_ && !sync_service->SetupInProgress();
- got_first_sync_callback_ = true;
+ bool wizard_visible = sync_service->WizardIsVisible();
+ // ProfileSyncService raises OnStateChanged many times. Even multiple
+ // times before the wizard actually becomes visible for the first time.
+ // So we have to wait for the wizard to become visible once and then we
+ // wait for it to get dismissed.
+ bool finished = wizard_shown_to_user_ && !wizard_visible;
+ wizard_shown_to_user_ = wizard_visible;
asargent_no_longer_on_chrome 2011/12/03 18:45:25 nit: while this looks like it should work, would i
if (finished) {
StopObservingSync();
« no previous file with comments | « chrome/browser/extensions/app_notify_channel_ui.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698