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 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
162 // This will delete |this|. | 162 // This will delete |this|. |
163 delegate_->OnRemovedFromProfile(this); | 163 delegate_->OnRemovedFromProfile(this); |
164 } | 164 } |
165 | 165 |
166 void SettingsChangeGlobalError::OnBubbleViewDidClose(Browser* browser) { | 166 void SettingsChangeGlobalError::OnBubbleViewDidClose(Browser* browser) { |
167 if (!closed_by_button_) { | 167 if (!closed_by_button_) { |
168 BrowserThread::PostDelayedTask( | 168 BrowserThread::PostDelayedTask( |
169 BrowserThread::UI, FROM_HERE, | 169 BrowserThread::UI, FROM_HERE, |
170 base::Bind(&SettingsChangeGlobalError::OnInactiveTimeout, | 170 base::Bind(&SettingsChangeGlobalError::OnInactiveTimeout, |
171 weak_factory_.GetWeakPtr()), | 171 weak_factory_.GetWeakPtr()), |
172 base::TimeDelta::FromMilliseconds(kMenuItemDisplayPeriodMs)); | 172 kMenuItemDisplayPeriodMs); |
173 #if !defined(TOOLKIT_GTK) | 173 #if !defined(TOOLKIT_GTK) |
174 // TODO(ivankr): the logic for redisplaying bubble is disabled on Gtk, see | 174 // TODO(ivankr): the logic for redisplaying bubble is disabled on Gtk, see |
175 // http://crbug.com/115719. | 175 // http://crbug.com/115719. |
176 if (browser->window() && | 176 if (browser->window() && |
177 !platform_util::IsWindowActive(browser->window()->GetNativeHandle())) { | 177 !platform_util::IsWindowActive(browser->window()->GetNativeHandle())) { |
178 // Bubble closed because the entire window lost activation, display | 178 // Bubble closed because the entire window lost activation, display |
179 // again when a window gets active. | 179 // again when a window gets active. |
180 show_on_browser_activation_ = true; | 180 show_on_browser_activation_ = true; |
181 } | 181 } |
182 #endif | 182 #endif |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 weak_factory_.InvalidateWeakPtrs(); | 223 weak_factory_.InvalidateWeakPtrs(); |
224 ShowBubbleView(browser); | 224 ShowBubbleView(browser); |
225 } | 225 } |
226 | 226 |
227 void SettingsChangeGlobalError::OnInactiveTimeout() { | 227 void SettingsChangeGlobalError::OnInactiveTimeout() { |
228 delegate_->OnDecisionTimeout(this); | 228 delegate_->OnDecisionTimeout(this); |
229 RemoveFromProfile(); | 229 RemoveFromProfile(); |
230 } | 230 } |
231 | 231 |
232 } // namespace protector | 232 } // namespace protector |
OLD | NEW |