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

Unified Diff: chrome/browser/automation/automation_provider_observers.cc

Issue 8790003: Allow the automation provider to accept an ID for performing render-view (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: ... Created 9 years 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/automation/automation_provider_observers.cc
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc
index ba23f4b8526624fd4a3c317a858fe1ad6a5c7123..668ca99386c8521294efb133c7439c2e8dd7f4d9 100644
--- a/chrome/browser/automation/automation_provider_observers.cc
+++ b/chrome/browser/automation/automation_provider_observers.cc
@@ -281,6 +281,10 @@ NavigationNotificationObserver::NavigationNotificationObserver(
navigations_remaining_(number_of_navigations),
navigation_started_(false),
use_json_interface_(use_json_interface) {
+ if (number_of_navigations == 0) {
+ ConditionMet(AUTOMATION_MSG_NAVIGATION_SUCCESS);
+ return;
+ }
DCHECK_LT(0, navigations_remaining_);
content::Source<NavigationController> source(controller_);
registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, source);
@@ -652,10 +656,14 @@ void ExtensionReadyNotificationObserver::Observe(
}
if (use_json_) {
- DictionaryValue dict;
- dict.SetString("id", extension_->id());
- AutomationJSONReply(automation_, reply_message_.release())
- .SendSuccess(&dict);
+ AutomationJSONReply reply(automation_, reply_message_.release());
+ if (extension_) {
+ DictionaryValue dict;
+ dict.SetString("id", extension_->id());
+ reply.SendSuccess(&dict);
+ } else {
+ reply.SendError("Extension could not be installed");
+ }
} else {
if (id_ == AutomationMsg_InstallExtension::ID) {
// A handle of zero indicates an error.

Powered by Google App Engine
This is Rietveld 408576698