OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 148 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
149 profile_ = profile; | 149 profile_ = profile; |
150 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError(this); | 150 GlobalErrorServiceFactory::GetForProfile(profile_)->AddGlobalError(this); |
151 Show(); | 151 Show(); |
152 } | 152 } |
153 | 153 |
154 void SettingsChangeGlobalError::Show() { | 154 void SettingsChangeGlobalError::Show() { |
155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 155 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
156 DCHECK(profile_); | 156 DCHECK(profile_); |
157 browser_ = BrowserList::GetLastActiveWithProfile(profile_); | 157 browser_ = BrowserList::GetLastActiveWithProfile(profile_); |
| 158 if (!browser_ && profile_->HasOffTheRecordProfile()) { |
| 159 browser_ = BrowserList::GetLastActiveWithProfile( |
| 160 profile_->GetOffTheRecordProfile()); |
| 161 } |
158 if (browser_) | 162 if (browser_) |
159 ShowBubbleView(browser_); | 163 ShowBubbleView(browser_); |
160 } | 164 } |
161 | 165 |
162 void SettingsChangeGlobalError::OnInactiveTimeout() { | 166 void SettingsChangeGlobalError::OnInactiveTimeout() { |
163 delegate_->OnDecisionTimeout(); | 167 delegate_->OnDecisionTimeout(); |
164 RemoveFromProfile(); | 168 RemoveFromProfile(); |
165 } | 169 } |
166 | 170 |
167 } // namespace protector | 171 } // namespace protector |
OLD | NEW |