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

Side by Side Diff: chrome/browser/ui/views/sync/one_click_signin_bubble_view.cc

Issue 11148007: views: Fix a bunch of dchecks. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fixes Created 8 years, 2 months 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h" 5 #include "chrome/browser/ui/views/sync/one_click_signin_bubble_view.h"
6 6
7 #include "base/callback_helpers.h" 7 #include "base/callback_helpers.h"
8 #include "base/logging.h" 8 #include "base/logging.h"
9 #include "base/message_loop.h" 9 #include "base/message_loop.h"
10 #include "chrome/browser/google/google_util.h" 10 #include "chrome/browser/google/google_util.h"
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 layout->AddView(ok_button_); 141 layout->AddView(ok_button_);
142 layout->AddView(undo_button_); 142 layout->AddView(undo_button_);
143 143
144 AddAccelerator(ui::Accelerator(ui::VKEY_RETURN, 0)); 144 AddAccelerator(ui::Accelerator(ui::VKEY_RETURN, 0));
145 } 145 }
146 146
147 void OneClickSigninBubbleView::WindowClosing() { 147 void OneClickSigninBubbleView::WindowClosing() {
148 // We have to reset |bubble_view_| here, not in our destructor, because 148 // We have to reset |bubble_view_| here, not in our destructor, because
149 // we'll be destroyed asynchronously and the shown state will be checked 149 // we'll be destroyed asynchronously and the shown state will be checked
150 // before then. 150 // before then.
151 DCHECK(bubble_view_ == this); 151 DCHECK_EQ(bubble_view_, this);
152 bubble_view_ = NULL; 152 bubble_view_ = NULL;
153 153
154 if (!start_sync_callback_.is_null()) { 154 if (!start_sync_callback_.is_null()) {
155 base::ResetAndReturn(&start_sync_callback_).Run( 155 base::ResetAndReturn(&start_sync_callback_).Run(
156 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); 156 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS);
157 } 157 }
158 } 158 }
159 159
160 bool OneClickSigninBubbleView::AcceleratorPressed( 160 bool OneClickSigninBubbleView::AcceleratorPressed(
161 const ui::Accelerator& accelerator) { 161 const ui::Accelerator& accelerator) {
(...skipping 23 matching lines...) Expand all
185 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender, 185 void OneClickSigninBubbleView::ButtonPressed(views::Button* sender,
186 const ui::Event& event) { 186 const ui::Event& event) {
187 StartFade(false); 187 StartFade(false);
188 if (ok_button_ == sender) { 188 if (ok_button_ == sender) {
189 base::ResetAndReturn(&start_sync_callback_).Run( 189 base::ResetAndReturn(&start_sync_callback_).Run(
190 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS); 190 OneClickSigninSyncStarter::SYNC_WITH_DEFAULT_SETTINGS);
191 } else { 191 } else {
192 start_sync_callback_.Reset(); 192 start_sync_callback_.Reset();
193 } 193 }
194 } 194 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698