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/ui/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 186 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 IDS_DONT_ASK_AGAIN_INFOBAR_BUTTON_LABEL); | 197 IDS_DONT_ASK_AGAIN_INFOBAR_BUTTON_LABEL); |
198 } | 198 } |
199 | 199 |
200 bool DefaultBrowserInfoBarDelegate::NeedElevation(InfoBarButton button) const { | 200 bool DefaultBrowserInfoBarDelegate::NeedElevation(InfoBarButton button) const { |
201 return button == BUTTON_OK; | 201 return button == BUTTON_OK; |
202 } | 202 } |
203 | 203 |
204 bool DefaultBrowserInfoBarDelegate::Accept() { | 204 bool DefaultBrowserInfoBarDelegate::Accept() { |
205 action_taken_ = true; | 205 action_taken_ = true; |
206 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.SetAsDefault", 1); | 206 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.SetAsDefault", 1); |
207 g_browser_process->file_thread()->message_loop()->PostTask( | 207 BrowserThread::PostTask( |
| 208 BrowserThread::FILE, |
208 FROM_HERE, | 209 FROM_HERE, |
209 base::IgnoreReturn<bool>( | 210 base::IgnoreReturn<bool>( |
210 base::Bind(&ShellIntegration::SetAsDefaultBrowser))); | 211 base::Bind(&ShellIntegration::SetAsDefaultBrowser))); |
211 return true; | 212 return true; |
212 } | 213 } |
213 | 214 |
214 bool DefaultBrowserInfoBarDelegate::Cancel() { | 215 bool DefaultBrowserInfoBarDelegate::Cancel() { |
215 action_taken_ = true; | 216 action_taken_ = true; |
216 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.DontSetAsDefault", 1); | 217 UMA_HISTOGRAM_COUNTS("DefaultBrowserWarning.DontSetAsDefault", 1); |
217 // User clicked "Don't ask me again", remember that. | 218 // User clicked "Don't ask me again", remember that. |
(...skipping 1271 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1489 if (!automation->InitializeChannel(channel_id)) | 1490 if (!automation->InitializeChannel(channel_id)) |
1490 return false; | 1491 return false; |
1491 automation->SetExpectedTabCount(expected_tabs); | 1492 automation->SetExpectedTabCount(expected_tabs); |
1492 | 1493 |
1493 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); | 1494 AutomationProviderList* list = g_browser_process->GetAutomationProviderList(); |
1494 DCHECK(list); | 1495 DCHECK(list); |
1495 list->AddProvider(automation); | 1496 list->AddProvider(automation); |
1496 | 1497 |
1497 return true; | 1498 return true; |
1498 } | 1499 } |
OLD | NEW |