diff options
author | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 18:27:53 +0000 |
---|---|---|
committer | jrg@chromium.org <jrg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-03-12 18:27:53 +0000 |
commit | 6d8ffc9f70711222db4aaaca570be0574e88de42 (patch) | |
tree | eafb5c341c9119e5c438025caa27dfda4902b096 /chrome/browser/automation/automation_provider_observers.cc | |
parent | a9710f39948f20b8eb3d9897a692a594374ee576 (diff) | |
download | chromium_src-6d8ffc9f70711222db4aaaca570be0574e88de42.zip chromium_src-6d8ffc9f70711222db4aaaca570be0574e88de42.tar.gz chromium_src-6d8ffc9f70711222db4aaaca570be0574e88de42.tar.bz2 |
Add pyauto hooks for bookmarks.
Get model, add/remove, add folder, reparent, change title/url.
BUG=34492
Review URL: http://codereview.chromium.org/792003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@41450 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/automation/automation_provider_observers.cc')
-rw-r--r-- | chrome/browser/automation/automation_provider_observers.cc | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/chrome/browser/automation/automation_provider_observers.cc b/chrome/browser/automation/automation_provider_observers.cc index 9c5f656..7f1f4f5 100644 --- a/chrome/browser/automation/automation_provider_observers.cc +++ b/chrome/browser/automation/automation_provider_observers.cc @@ -7,6 +7,7 @@ #include "base/basictypes.h" #include "chrome/app/chrome_dll_resource.h" #include "chrome/browser/automation/automation_provider.h" +#include "chrome/browser/bookmarks/bookmark_model.h" #include "chrome/browser/dom_operation_notification_details.h" #include "chrome/browser/login_prompt.h" #include "chrome/browser/metrics/metric_event_duration_details.h" @@ -743,3 +744,24 @@ void LoginManagerObserver::Observe(NotificationType type, delete this; } #endif + +AutomationProviderBookmarkModelObserver::AutomationProviderBookmarkModelObserver( + AutomationProvider* provider, + IPC::Message* reply_message, + BookmarkModel* model) { + automation_provider_ = provider; + reply_message_ = reply_message; + model_ = model; + model_->AddObserver(this); +} + +AutomationProviderBookmarkModelObserver::~AutomationProviderBookmarkModelObserver() { + model_->RemoveObserver(this); +} + +void AutomationProviderBookmarkModelObserver::ReplyAndDelete(bool success) { + AutomationMsg_WaitForBookmarkModelToLoad::WriteReplyParams( + reply_message_, success); + automation_provider_->Send(reply_message_); + delete this; +} |