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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 #include "chrome/browser/metrics/metric_event_duration_details.h" | 35 #include "chrome/browser/metrics/metric_event_duration_details.h" |
36 #include "chrome/browser/notifications/balloon.h" | 36 #include "chrome/browser/notifications/balloon.h" |
37 #include "chrome/browser/notifications/balloon_collection.h" | 37 #include "chrome/browser/notifications/balloon_collection.h" |
38 #include "chrome/browser/notifications/balloon_host.h" | 38 #include "chrome/browser/notifications/balloon_host.h" |
39 #include "chrome/browser/notifications/notification.h" | 39 #include "chrome/browser/notifications/notification.h" |
40 #include "chrome/browser/notifications/notification_ui_manager.h" | 40 #include "chrome/browser/notifications/notification_ui_manager.h" |
41 #include "chrome/browser/printing/print_job.h" | 41 #include "chrome/browser/printing/print_job.h" |
42 #include "chrome/browser/profiles/profile.h" | 42 #include "chrome/browser/profiles/profile.h" |
43 #include "chrome/browser/search_engines/template_url_model.h" | 43 #include "chrome/browser/search_engines/template_url_model.h" |
44 #include "chrome/browser/sessions/tab_restore_service.h" | 44 #include "chrome/browser/sessions/tab_restore_service.h" |
| 45 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
45 #include "chrome/browser/tab_contents/thumbnail_generator.h" | 46 #include "chrome/browser/tab_contents/thumbnail_generator.h" |
46 #include "chrome/browser/translate/page_translated_details.h" | 47 #include "chrome/browser/translate/page_translated_details.h" |
47 #include "chrome/browser/translate/translate_infobar_delegate.h" | 48 #include "chrome/browser/translate/translate_infobar_delegate.h" |
48 #include "chrome/browser/translate/translate_tab_helper.h" | 49 #include "chrome/browser/translate/translate_tab_helper.h" |
49 #include "chrome/browser/ui/browser.h" | 50 #include "chrome/browser/ui/browser.h" |
50 #include "chrome/browser/ui/browser_list.h" | 51 #include "chrome/browser/ui/browser_list.h" |
51 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 52 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
52 #include "chrome/browser/ui/login/login_prompt.h" | 53 #include "chrome/browser/ui/login/login_prompt.h" |
53 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 54 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
54 #include "chrome/browser/ui/webui/app_launcher_handler.h" | 55 #include "chrome/browser/ui/webui/app_launcher_handler.h" |
(...skipping 1832 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1887 reply_message_(reply_message), | 1888 reply_message_(reply_message), |
1888 consumer_(consumer), | 1889 consumer_(consumer), |
1889 request_(0), | 1890 request_(0), |
1890 ntp_info_(new DictionaryValue) { | 1891 ntp_info_(new DictionaryValue) { |
1891 top_sites_ = automation_->profile()->GetTopSites(); | 1892 top_sites_ = automation_->profile()->GetTopSites(); |
1892 if (!top_sites_) { | 1893 if (!top_sites_) { |
1893 AutomationJSONReply(automation_, reply_message_.release()) | 1894 AutomationJSONReply(automation_, reply_message_.release()) |
1894 .SendError("Profile does not have service for querying the top sites."); | 1895 .SendError("Profile does not have service for querying the top sites."); |
1895 return; | 1896 return; |
1896 } | 1897 } |
1897 TabRestoreService* service = automation_->profile()->GetTabRestoreService(); | 1898 TabRestoreService* service = |
| 1899 TabRestoreServiceFactory::GetForProfile(automation_->profile()); |
1898 if (!service) { | 1900 if (!service) { |
1899 AutomationJSONReply(automation_, reply_message_.release()) | 1901 AutomationJSONReply(automation_, reply_message_.release()) |
1900 .SendError("No TabRestoreService."); | 1902 .SendError("No TabRestoreService."); |
1901 return; | 1903 return; |
1902 } | 1904 } |
1903 | 1905 |
1904 // Collect information about the apps in the new tab page. | 1906 // Collect information about the apps in the new tab page. |
1905 ExtensionService* ext_service = automation_->profile()->GetExtensionService(); | 1907 ExtensionService* ext_service = automation_->profile()->GetExtensionService(); |
1906 if (!ext_service) { | 1908 if (!ext_service) { |
1907 AutomationJSONReply(automation_, reply_message_.release()) | 1909 AutomationJSONReply(automation_, reply_message_.release()) |
(...skipping 453 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2361 this, | 2363 this, |
2362 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); | 2364 &WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread)); |
2363 } | 2365 } |
2364 | 2366 |
2365 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { | 2367 void WaitForProcessLauncherThreadToGoIdleObserver::RunOnUIThread() { |
2366 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 2368 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
2367 if (automation_) | 2369 if (automation_) |
2368 automation_->Send(reply_message_.release()); | 2370 automation_->Send(reply_message_.release()); |
2369 Release(); | 2371 Release(); |
2370 } | 2372 } |
OLD | NEW |