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 14 matching lines...) Expand all Loading... |
25 #include "chrome/app/chrome_command_ids.h" | 25 #include "chrome/app/chrome_command_ids.h" |
26 #include "chrome/browser/automation/automation_provider.h" | 26 #include "chrome/browser/automation/automation_provider.h" |
27 #include "chrome/browser/automation/automation_provider_json.h" | 27 #include "chrome/browser/automation/automation_provider_json.h" |
28 #include "chrome/browser/bookmarks/bookmark_model.h" | 28 #include "chrome/browser/bookmarks/bookmark_model.h" |
29 #include "chrome/browser/bookmarks/bookmark_model_factory.h" | 29 #include "chrome/browser/bookmarks/bookmark_model_factory.h" |
30 #include "chrome/browser/browser_process.h" | 30 #include "chrome/browser/browser_process.h" |
31 #include "chrome/browser/chrome_notification_types.h" | 31 #include "chrome/browser/chrome_notification_types.h" |
32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" | 32 #include "chrome/browser/content_settings/tab_specific_content_settings.h" |
33 #include "chrome/browser/extensions/crx_installer.h" | 33 #include "chrome/browser/extensions/crx_installer.h" |
34 #include "chrome/browser/extensions/extension_host.h" | 34 #include "chrome/browser/extensions/extension_host.h" |
35 #include "chrome/browser/extensions/extension_process_manager.h" | |
36 #include "chrome/browser/extensions/extension_service.h" | 35 #include "chrome/browser/extensions/extension_service.h" |
37 #include "chrome/browser/extensions/extension_system.h" | 36 #include "chrome/browser/extensions/extension_system.h" |
38 #include "chrome/browser/extensions/extension_tab_util.h" | 37 #include "chrome/browser/extensions/extension_tab_util.h" |
39 #include "chrome/browser/history/history_types.h" | 38 #include "chrome/browser/history/history_types.h" |
40 #include "chrome/browser/history/top_sites.h" | 39 #include "chrome/browser/history/top_sites.h" |
41 #include "chrome/browser/infobars/confirm_infobar_delegate.h" | 40 #include "chrome/browser/infobars/confirm_infobar_delegate.h" |
42 #include "chrome/browser/infobars/infobar_service.h" | 41 #include "chrome/browser/infobars/infobar_service.h" |
43 #include "chrome/browser/metrics/metric_event_duration_details.h" | 42 #include "chrome/browser/metrics/metric_event_duration_details.h" |
44 #include "chrome/browser/notifications/balloon.h" | 43 #include "chrome/browser/notifications/balloon.h" |
45 #include "chrome/browser/notifications/balloon_collection.h" | 44 #include "chrome/browser/notifications/balloon_collection.h" |
(...skipping 24 matching lines...) Expand all Loading... |
70 #include "chrome/common/automation_messages.h" | 69 #include "chrome/common/automation_messages.h" |
71 #include "chrome/common/content_settings_types.h" | 70 #include "chrome/common/content_settings_types.h" |
72 #include "chrome/common/extensions/extension.h" | 71 #include "chrome/common/extensions/extension.h" |
73 #include "content/public/browser/dom_operation_notification_details.h" | 72 #include "content/public/browser/dom_operation_notification_details.h" |
74 #include "content/public/browser/navigation_controller.h" | 73 #include "content/public/browser/navigation_controller.h" |
75 #include "content/public/browser/notification_service.h" | 74 #include "content/public/browser/notification_service.h" |
76 #include "content/public/browser/render_process_host.h" | 75 #include "content/public/browser/render_process_host.h" |
77 #include "content/public/browser/render_view_host.h" | 76 #include "content/public/browser/render_view_host.h" |
78 #include "content/public/browser/web_contents.h" | 77 #include "content/public/browser/web_contents.h" |
79 #include "content/public/common/process_type.h" | 78 #include "content/public/common/process_type.h" |
| 79 #include "extensions/browser/process_manager.h" |
80 #include "extensions/common/manifest.h" | 80 #include "extensions/common/manifest.h" |
81 #include "extensions/common/view_type.h" | 81 #include "extensions/common/view_type.h" |
82 #include "ui/gfx/codec/png_codec.h" | 82 #include "ui/gfx/codec/png_codec.h" |
83 #include "ui/gfx/rect.h" | 83 #include "ui/gfx/rect.h" |
84 #include "url/gurl.h" | 84 #include "url/gurl.h" |
85 | 85 |
86 using content::BrowserThread; | 86 using content::BrowserThread; |
87 using content::DomOperationNotificationDetails; | 87 using content::DomOperationNotificationDetails; |
88 using content::DownloadItem; | 88 using content::DownloadItem; |
89 using content::DownloadManager; | 89 using content::DownloadManager; |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
515 | 515 |
516 if (automation_.get()) { | 516 if (automation_.get()) { |
517 AutomationMsg_WaitForTabCountToBecome::WriteReplyParams( | 517 AutomationMsg_WaitForTabCountToBecome::WriteReplyParams( |
518 reply_message_.get(), true); | 518 reply_message_.get(), true); |
519 automation_->Send(reply_message_.release()); | 519 automation_->Send(reply_message_.release()); |
520 } | 520 } |
521 | 521 |
522 delete this; | 522 delete this; |
523 } | 523 } |
524 | 524 |
525 bool DidExtensionViewsStopLoading(ExtensionProcessManager* manager) { | 525 bool DidExtensionViewsStopLoading(extensions::ProcessManager* manager) { |
526 ExtensionProcessManager::ViewSet all_views = manager->GetAllViews(); | 526 extensions::ProcessManager::ViewSet all_views = manager->GetAllViews(); |
527 for (ExtensionProcessManager::ViewSet::const_iterator iter = | 527 for (extensions::ProcessManager::ViewSet::const_iterator iter = |
528 all_views.begin(); | 528 all_views.begin(); |
529 iter != all_views.end(); ++iter) { | 529 iter != all_views.end(); ++iter) { |
530 if ((*iter)->IsLoading()) | 530 if ((*iter)->IsLoading()) |
531 return false; | 531 return false; |
532 } | 532 } |
533 return true; | 533 return true; |
534 } | 534 } |
535 | 535 |
536 ExtensionUninstallObserver::ExtensionUninstallObserver( | 536 ExtensionUninstallObserver::ExtensionUninstallObserver( |
537 AutomationProvider* automation, | 537 AutomationProvider* automation, |
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
584 } | 584 } |
585 break; | 585 break; |
586 } | 586 } |
587 | 587 |
588 default: | 588 default: |
589 NOTREACHED(); | 589 NOTREACHED(); |
590 } | 590 } |
591 } | 591 } |
592 | 592 |
593 ExtensionReadyNotificationObserver::ExtensionReadyNotificationObserver( | 593 ExtensionReadyNotificationObserver::ExtensionReadyNotificationObserver( |
594 ExtensionProcessManager* manager, ExtensionService* service, | 594 extensions::ProcessManager* manager, ExtensionService* service, |
595 AutomationProvider* automation, IPC::Message* reply_message) | 595 AutomationProvider* automation, IPC::Message* reply_message) |
596 : manager_(manager), | 596 : manager_(manager), |
597 service_(service), | 597 service_(service), |
598 automation_(automation->AsWeakPtr()), | 598 automation_(automation->AsWeakPtr()), |
599 reply_message_(reply_message), | 599 reply_message_(reply_message), |
600 extension_(NULL) { | 600 extension_(NULL) { |
601 Init(); | 601 Init(); |
602 } | 602 } |
603 | 603 |
604 ExtensionReadyNotificationObserver::~ExtensionReadyNotificationObserver() { | 604 ExtensionReadyNotificationObserver::~ExtensionReadyNotificationObserver() { |
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
684 int type, const content::NotificationSource& source, | 684 int type, const content::NotificationSource& source, |
685 const content::NotificationDetails& details) { | 685 const content::NotificationDetails& details) { |
686 if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { | 686 if (type == chrome::NOTIFICATION_EXTENSION_UNLOADED) { |
687 did_receive_unload_notification_ = true; | 687 did_receive_unload_notification_ = true; |
688 } else { | 688 } else { |
689 NOTREACHED(); | 689 NOTREACHED(); |
690 } | 690 } |
691 } | 691 } |
692 | 692 |
693 ExtensionsUpdatedObserver::ExtensionsUpdatedObserver( | 693 ExtensionsUpdatedObserver::ExtensionsUpdatedObserver( |
694 ExtensionProcessManager* manager, AutomationProvider* automation, | 694 extensions::ProcessManager* manager, AutomationProvider* automation, |
695 IPC::Message* reply_message) | 695 IPC::Message* reply_message) |
696 : manager_(manager), automation_(automation->AsWeakPtr()), | 696 : manager_(manager), automation_(automation->AsWeakPtr()), |
697 reply_message_(reply_message), updater_finished_(false) { | 697 reply_message_(reply_message), updater_finished_(false) { |
698 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, | 698 registrar_.Add(this, content::NOTIFICATION_LOAD_STOP, |
699 content::NotificationService::AllSources()); | 699 content::NotificationService::AllSources()); |
700 } | 700 } |
701 | 701 |
702 ExtensionsUpdatedObserver::~ExtensionsUpdatedObserver() { | 702 ExtensionsUpdatedObserver::~ExtensionsUpdatedObserver() { |
703 } | 703 } |
704 | 704 |
(...skipping 1942 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2647 if (automation_.get()) { | 2647 if (automation_.get()) { |
2648 AutomationJSONReply(automation_.get(), reply_message_.release()) | 2648 AutomationJSONReply(automation_.get(), reply_message_.release()) |
2649 .SendSuccess(NULL); | 2649 .SendSuccess(NULL); |
2650 } | 2650 } |
2651 delete this; | 2651 delete this; |
2652 } | 2652 } |
2653 } else { | 2653 } else { |
2654 NOTREACHED(); | 2654 NOTREACHED(); |
2655 } | 2655 } |
2656 } | 2656 } |
OLD | NEW |