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/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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 #include "chrome/browser/notifications/notification.h" | 47 #include "chrome/browser/notifications/notification.h" |
48 #include "chrome/browser/password_manager/password_store_change.h" | 48 #include "chrome/browser/password_manager/password_store_change.h" |
49 #include "chrome/browser/profiles/profile.h" | 49 #include "chrome/browser/profiles/profile.h" |
50 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" | 50 #include "chrome/browser/renderer_host/chrome_render_message_filter.h" |
51 #include "chrome/browser/search_engines/template_url_service.h" | 51 #include "chrome/browser/search_engines/template_url_service.h" |
52 #include "chrome/browser/search_engines/template_url_service_factory.h" | 52 #include "chrome/browser/search_engines/template_url_service_factory.h" |
53 #include "chrome/browser/sessions/session_tab_helper.h" | 53 #include "chrome/browser/sessions/session_tab_helper.h" |
54 #include "chrome/browser/sessions/tab_restore_service.h" | 54 #include "chrome/browser/sessions/tab_restore_service.h" |
55 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 55 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
56 #include "chrome/browser/ui/browser.h" | 56 #include "chrome/browser/ui/browser.h" |
| 57 #include "chrome/browser/ui/browser_iterator.h" |
57 #include "chrome/browser/ui/browser_list.h" | 58 #include "chrome/browser/ui/browser_list.h" |
58 #include "chrome/browser/ui/browser_window.h" | 59 #include "chrome/browser/ui/browser_window.h" |
59 #include "chrome/browser/ui/find_bar/find_notification_details.h" | 60 #include "chrome/browser/ui/find_bar/find_notification_details.h" |
60 #include "chrome/browser/ui/login/login_prompt.h" | 61 #include "chrome/browser/ui/login/login_prompt.h" |
61 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 62 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
62 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 63 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
63 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" | 64 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
64 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 65 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
65 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" | 66 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" |
66 #include "chrome/common/automation_constants.h" | 67 #include "chrome/common/automation_constants.h" |
(...skipping 2246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2313 ExtensionProcessManager* extension_process_manager) | 2314 ExtensionProcessManager* extension_process_manager) |
2314 : automation_(automation->AsWeakPtr()), | 2315 : automation_(automation->AsWeakPtr()), |
2315 reply_message_(reply_message), | 2316 reply_message_(reply_message), |
2316 extension_process_manager_(extension_process_manager) { | 2317 extension_process_manager_(extension_process_manager) { |
2317 registrar_.Add(this, | 2318 registrar_.Add(this, |
2318 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, | 2319 chrome::NOTIFICATION_APP_MODAL_DIALOG_SHOWN, |
2319 content::NotificationService::AllSources()); | 2320 content::NotificationService::AllSources()); |
2320 registrar_.Add(this, | 2321 registrar_.Add(this, |
2321 content::NOTIFICATION_LOAD_STOP, | 2322 content::NOTIFICATION_LOAD_STOP, |
2322 content::NotificationService::AllSources()); | 2323 content::NotificationService::AllSources()); |
2323 for (BrowserList::const_iterator iter = BrowserList::begin(); | 2324 for (chrome::BrowserIterator it; !it.done(); it.Next()) { |
2324 iter != BrowserList::end(); | 2325 Browser* browser = *it; |
2325 ++iter) { | |
2326 Browser* browser = *iter; | |
2327 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { | 2326 for (int i = 0; i < browser->tab_strip_model()->count(); ++i) { |
2328 WebContents* web_contents = | 2327 WebContents* web_contents = |
2329 browser->tab_strip_model()->GetWebContentsAt(i); | 2328 browser->tab_strip_model()->GetWebContentsAt(i); |
2330 AutomationTabHelper* automation_tab_helper = | 2329 AutomationTabHelper* automation_tab_helper = |
2331 AutomationTabHelper::FromWebContents(web_contents); | 2330 AutomationTabHelper::FromWebContents(web_contents); |
2332 StartObserving(automation_tab_helper); | 2331 StartObserving(automation_tab_helper); |
2333 if (automation_tab_helper->has_pending_loads()) | 2332 if (automation_tab_helper->has_pending_loads()) |
2334 pending_tabs_.insert(web_contents); | 2333 pending_tabs_.insert(web_contents); |
2335 } | 2334 } |
2336 } | 2335 } |
(...skipping 504 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2841 if (automation_) { | 2840 if (automation_) { |
2842 AutomationJSONReply(automation_, reply_message_.release()) | 2841 AutomationJSONReply(automation_, reply_message_.release()) |
2843 .SendSuccess(NULL); | 2842 .SendSuccess(NULL); |
2844 } | 2843 } |
2845 delete this; | 2844 delete this; |
2846 } | 2845 } |
2847 } else { | 2846 } else { |
2848 NOTREACHED(); | 2847 NOTREACHED(); |
2849 } | 2848 } |
2850 } | 2849 } |
OLD | NEW |