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" |
11 #include "base/lazy_instance.h" | 11 #include "base/lazy_instance.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/stl_util.h" | 13 #include "base/stl_util.h" |
14 #include "chrome/browser/platform_util.h" | 14 #include "chrome/browser/platform_util.h" |
15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
16 #include "chrome/browser/protector/base_setting_change.h" | 16 #include "chrome/browser/protector/base_setting_change.h" |
17 #include "chrome/browser/protector/settings_change_global_error_delegate.h" | 17 #include "chrome/browser/protector/settings_change_global_error_delegate.h" |
18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_finder.h" |
19 #include "chrome/browser/ui/browser_window.h" | 20 #include "chrome/browser/ui/browser_window.h" |
20 #include "chrome/browser/ui/global_error_service.h" | 21 #include "chrome/browser/ui/global_error_service.h" |
21 #include "chrome/browser/ui/global_error_service_factory.h" | 22 #include "chrome/browser/ui/global_error_service_factory.h" |
22 #include "content/public/browser/browser_thread.h" | 23 #include "content/public/browser/browser_thread.h" |
23 | 24 |
24 using content::BrowserThread; | 25 using content::BrowserThread; |
25 | 26 |
26 namespace protector { | 27 namespace protector { |
27 | 28 |
28 namespace { | 29 namespace { |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 profile_ = NULL; | 93 profile_ = NULL; |
93 } | 94 } |
94 BrowserList::RemoveObserver(this); | 95 BrowserList::RemoveObserver(this); |
95 // This will delete |this|. | 96 // This will delete |this|. |
96 delegate_->OnRemovedFromProfile(this); | 97 delegate_->OnRemovedFromProfile(this); |
97 } | 98 } |
98 | 99 |
99 void SettingsChangeGlobalError::ShowBubble() { | 100 void SettingsChangeGlobalError::ShowBubble() { |
100 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 101 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
101 DCHECK(profile_); | 102 DCHECK(profile_); |
102 Browser* browser = BrowserList::FindTabbedBrowser( | 103 Browser* browser = browser::FindTabbedBrowser( |
103 profile_, | 104 profile_, |
104 // match incognito | 105 // match incognito |
105 true); | 106 true); |
106 if (browser) | 107 if (browser) |
107 ShowBubbleInBrowser(browser); | 108 ShowBubbleInBrowser(browser); |
108 } | 109 } |
109 | 110 |
110 bool SettingsChangeGlobalError::HasBadge() { | 111 bool SettingsChangeGlobalError::HasBadge() { |
111 return true; | 112 return true; |
112 } | 113 } |
(...skipping 113 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
226 weak_factory_.InvalidateWeakPtrs(); | 227 weak_factory_.InvalidateWeakPtrs(); |
227 ShowBubbleView(browser); | 228 ShowBubbleView(browser); |
228 } | 229 } |
229 | 230 |
230 void SettingsChangeGlobalError::OnInactiveTimeout() { | 231 void SettingsChangeGlobalError::OnInactiveTimeout() { |
231 delegate_->OnDecisionTimeout(this); | 232 delegate_->OnDecisionTimeout(this); |
232 RemoveFromProfile(); | 233 RemoveFromProfile(); |
233 } | 234 } |
234 | 235 |
235 } // namespace protector | 236 } // namespace protector |
OLD | NEW |