Chromium Code Reviews| OLD | NEW |
|---|---|
| 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/protector/settings_change_global_error.h" | 5 #include "chrome/browser/protector/settings_change_global_error.h" |
| 6 | 6 |
| 7 #include <bitset> | 7 #include <bitset> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/compiler_specific.h" | 10 #include "base/compiler_specific.h" |
| (...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 158 | 158 |
| 159 string16 SettingsChangeGlobalError::GetBubbleViewAcceptButtonLabel() { | 159 string16 SettingsChangeGlobalError::GetBubbleViewAcceptButtonLabel() { |
| 160 return change_->GetDiscardButtonText(); | 160 return change_->GetDiscardButtonText(); |
| 161 } | 161 } |
| 162 | 162 |
| 163 string16 SettingsChangeGlobalError::GetBubbleViewCancelButtonLabel() { | 163 string16 SettingsChangeGlobalError::GetBubbleViewCancelButtonLabel() { |
| 164 return change_->GetApplyButtonText(); | 164 return change_->GetApplyButtonText(); |
| 165 } | 165 } |
| 166 | 166 |
| 167 void SettingsChangeGlobalError::OnBubbleViewDidClose(Browser* browser) { | 167 void SettingsChangeGlobalError::OnBubbleViewDidClose(Browser* browser) { |
| 168 // The bubble may be closed as the result of RemoveFromProfile call. | |
|
whywhat
2012/04/06 16:28:32
Could you add more details on when RemoveFromProfi
Ivan Korotkov
2012/04/09 14:46:47
Done.
| |
| 169 if (!profile_) | |
| 170 return; | |
| 168 if (!closed_by_button_) { | 171 if (!closed_by_button_) { |
| 169 BrowserThread::PostDelayedTask( | 172 BrowserThread::PostDelayedTask( |
| 170 BrowserThread::UI, FROM_HERE, | 173 BrowserThread::UI, FROM_HERE, |
| 171 base::Bind(&SettingsChangeGlobalError::OnInactiveTimeout, | 174 base::Bind(&SettingsChangeGlobalError::OnInactiveTimeout, |
| 172 weak_factory_.GetWeakPtr()), | 175 weak_factory_.GetWeakPtr()), |
| 173 base::TimeDelta::FromMilliseconds(kMenuItemDisplayPeriodMs)); | 176 base::TimeDelta::FromMilliseconds(kMenuItemDisplayPeriodMs)); |
| 174 #if !defined(TOOLKIT_GTK) | 177 #if !defined(TOOLKIT_GTK) |
| 175 // TODO(ivankr): the logic for redisplaying bubble is disabled on Gtk, see | 178 // TODO(ivankr): the logic for redisplaying bubble is disabled on Gtk, see |
| 176 // http://crbug.com/115719. | 179 // http://crbug.com/115719. |
| 177 if (browser->window() && | 180 if (browser->window() && |
| (...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 222 weak_factory_.InvalidateWeakPtrs(); | 225 weak_factory_.InvalidateWeakPtrs(); |
| 223 ShowBubbleView(browser); | 226 ShowBubbleView(browser); |
| 224 } | 227 } |
| 225 | 228 |
| 226 void SettingsChangeGlobalError::OnInactiveTimeout() { | 229 void SettingsChangeGlobalError::OnInactiveTimeout() { |
| 227 delegate_->OnDecisionTimeout(this); | 230 delegate_->OnDecisionTimeout(this); |
| 228 RemoveFromProfile(); | 231 RemoveFromProfile(); |
| 229 } | 232 } |
| 230 | 233 |
| 231 } // namespace protector | 234 } // namespace protector |
| OLD | NEW |