Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(544)

Side by Side Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 2861019: Enable "get html from page" functionality for PyAuto.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/json/json_writer.h" 8 #include "base/json/json_writer.h"
9 #include "base/string_util.h" 9 #include "base/string_util.h"
10 #include "chrome/app/chrome_dll_resource.h" 10 #include "chrome/app/chrome_dll_resource.h"
11 #include "chrome/browser/automation/automation_provider.h" 11 #include "chrome/browser/automation/automation_provider.h"
12 #include "chrome/browser/bookmarks/bookmark_model.h" 12 #include "chrome/browser/bookmarks/bookmark_model.h"
13 #include "chrome/browser/dom_operation_notification_details.h" 13 #include "chrome/browser/dom_operation_notification_details.h"
14 #include "chrome/browser/download/save_package.h"
14 #include "chrome/browser/extensions/extension_host.h" 15 #include "chrome/browser/extensions/extension_host.h"
15 #include "chrome/browser/extensions/extension_process_manager.h" 16 #include "chrome/browser/extensions/extension_process_manager.h"
16 #include "chrome/browser/extensions/extension_updater.h" 17 #include "chrome/browser/extensions/extension_updater.h"
17 #include "chrome/browser/login_prompt.h" 18 #include "chrome/browser/login_prompt.h"
18 #include "chrome/browser/metrics/metric_event_duration_details.h" 19 #include "chrome/browser/metrics/metric_event_duration_details.h"
19 #include "chrome/browser/printing/print_job.h" 20 #include "chrome/browser/printing/print_job.h"
20 #include "chrome/browser/profile.h" 21 #include "chrome/browser/profile.h"
21 #include "chrome/browser/tab_contents/navigation_controller.h" 22 #include "chrome/browser/tab_contents/navigation_controller.h"
22 #include "chrome/browser/tab_contents/tab_contents.h" 23 #include "chrome/browser/tab_contents/tab_contents.h"
23 #include "chrome/common/extensions/extension.h" 24 #include "chrome/common/extensions/extension.h"
(...skipping 1011 matching lines...) Expand 10 before | Expand all | Expand 10 after
1035 type == NotificationType::AUTH_NEEDED) { 1036 type == NotificationType::AUTH_NEEDED) {
1036 AutomationMsg_SendJSONRequest::WriteReplyParams( 1037 AutomationMsg_SendJSONRequest::WriteReplyParams(
1037 reply_message_, std::string("{}"), false); 1038 reply_message_, std::string("{}"), false);
1038 automation_->Send(reply_message_); 1039 automation_->Send(reply_message_);
1039 delete this; 1040 delete this;
1040 } else { 1041 } else {
1041 NOTREACHED(); 1042 NOTREACHED();
1042 } 1043 }
1043 } 1044 }
1044 1045
1046 SavePackageNotificationObserver::SavePackageNotificationObserver(
1047 SavePackage* save_package,
1048 AutomationProvider* automation,
1049 IPC::Message* reply_message) : automation_(automation),
1050 reply_message_(reply_message) {
1051 Source<SavePackage> source(save_package);
1052 registrar_.Add(this, NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED,
1053 source);
1054 }
1055
1056 void SavePackageNotificationObserver::Observe(
1057 NotificationType type,
1058 const NotificationSource& source,
1059 const NotificationDetails& details) {
1060 if (type == NotificationType::SAVE_PACKAGE_SUCCESSFULLY_FINISHED) {
1061 AutomationMsg_SendJSONRequest::WriteReplyParams(
1062 reply_message_, std::string("{}"), true);
1063 automation_->Send(reply_message_);
1064 delete this;
1065 } else {
1066 NOTREACHED();
1067 }
1068 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698