diff options
Diffstat (limited to 'embed/mozilla')
-rw-r--r-- | embed/mozilla/EphyBrowser.cpp | 12 | ||||
-rw-r--r-- | embed/mozilla/EphyBrowser.h | 1 | ||||
-rw-r--r-- | embed/mozilla/mozilla-embed.cpp | 20 |
3 files changed, 22 insertions, 11 deletions
diff --git a/embed/mozilla/EphyBrowser.cpp b/embed/mozilla/EphyBrowser.cpp index 8d1b3cdd0..732de1c42 100644 --- a/embed/mozilla/EphyBrowser.cpp +++ b/embed/mozilla/EphyBrowser.cpp @@ -722,3 +722,15 @@ nsresult EphyBrowser::DoCommand (const char *command) return cmdManager->DoCommand (command, nsnull, nsnull); } + +nsresult EphyBrowser::GetCommandState (const char *command, PRBool *enabled) +{ + nsCOMPtr<nsICommandManager> cmdManager; + + g_return_val_if_fail (mWebBrowser, NS_ERROR_FAILURE); + + cmdManager = do_GetInterface (mWebBrowser); + if (!cmdManager) return NS_ERROR_FAILURE; + + return cmdManager->IsCommandEnabled (command, nsnull, enabled); +} diff --git a/embed/mozilla/EphyBrowser.h b/embed/mozilla/EphyBrowser.h index 00d49cce2..a57736092 100644 --- a/embed/mozilla/EphyBrowser.h +++ b/embed/mozilla/EphyBrowser.h @@ -50,6 +50,7 @@ public: nsresult Destroy (void); nsresult DoCommand (const char *command); + nsresult GetCommandState (const char *command, PRBool *enabled); nsresult SetZoom (float aTextZoom, PRBool reflow); nsresult GetZoom (float *aTextZoom); diff --git a/embed/mozilla/mozilla-embed.cpp b/embed/mozilla/mozilla-embed.cpp index 62af22e82..2d11e32ad 100644 --- a/embed/mozilla/mozilla-embed.cpp +++ b/embed/mozilla/mozilla-embed.cpp @@ -243,25 +243,23 @@ impl_manager_do_command (EphyCommandManager *manager, } static gresult -impl_manager_can_do_command (EphyCommandManager *manager, - const char *command) +impl_manager_get_command_state (EphyCommandManager *manager, + const char *command, + gboolean *enabled) { - return G_NOT_IMPLEMENTED; -} + nsresult result; + MozillaEmbedPrivate *mpriv = MOZILLA_EMBED(manager)->priv; -static gresult -impl_manager_observe_command (EphyCommandManager *manager, - const char *command) -{ - return G_NOT_IMPLEMENTED; + result = mpriv->browser->GetCommandState (command, enabled); + + return result ? G_OK : G_FAILED; } static void ephy_command_manager_init (EphyCommandManagerClass *manager_class) { manager_class->do_command = impl_manager_do_command; - manager_class->can_do_command = impl_manager_can_do_command; - manager_class->observe_command = impl_manager_observe_command; + manager_class->get_command_state = impl_manager_get_command_state; } GType |