Skip to content
Browse files

esteid-browser-plugin: Rename UI functions now that we no longer have…

… duplicate blocking dialogs

git-svn-id: https://esteid.googlecode.com/svn/esteid-browser-plugin/trunk@3808 0d7e1ef0-d974-fc83-f0b3-ccc071561e0e
  • Loading branch information...
1 parent c791004 commit 03fcaa96d9d23b9898b20b348cec6650a8b37fe6 kalevlember committed Jun 21, 2011
Showing with 69 additions and 62 deletions.
  1. +11 −11 EsteidAPI.cpp
  2. +3 −3 EsteidAPI.h
  3. +7 −6 Mac/MacUI.h
  4. +7 −6 Mac/MacUI.mm
  5. +9 −8 PluginUI.h
  6. +11 −10 Win/WindowsUI.cpp
  7. +7 −6 Win/WindowsUI.h
  8. +7 −6 X11/GtkUI.cpp
  9. +7 −6 X11/GtkUI.h
View
22 EsteidAPI.cpp
@@ -250,7 +250,7 @@ void EsteidAPI::showSettings()
if (m_pageURL.protocol() == "file" ||
m_pageURL.protocol() == "chrome") {
try {
- m_UI->ShowSettings(m_settings);
+ m_UI->settingsDialog(m_settings);
} catch(const std::exception& e) {
ESTEID_DEBUG("Unable to display whitelist editor: %s", e.what());
}
@@ -259,13 +259,13 @@ void EsteidAPI::showSettings()
}
}
-void EsteidAPI::ShowSettings()
+void EsteidAPI::settingsDialog()
{
try {
if (IsSecure())
- m_UI->ShowSettings(m_settings, m_pageURL.hostname());
+ m_UI->settingsDialog(m_settings, m_pageURL.hostname());
else
- m_UI->ShowSettings(m_settings);
+ m_UI->settingsDialog(m_settings);
} catch(const std::exception& e) {
ESTEID_DEBUG("Unable to display whitelist editor: %s", e.what());
}
@@ -361,7 +361,7 @@ void EsteidAPI::signAsync(const std::string& hash, const std::string& url, const
whitelistRequired();
prepareSign(hash, url);
- promptForPinAsync();
+ askPin();
} catch(const std::exception& e) {
returnSignFailure(e.what());
return;
@@ -394,16 +394,16 @@ void EsteidAPI::prepareSign(const std::string& hash, const std::string& url)
}
-void EsteidAPI::promptForPinAsync(bool retrying)
+void EsteidAPI::askPin(bool retrying)
{
int triesLeft = getPin2RetryCount();
if (triesLeft <= 0) {
- m_UI->ShowPinBlockedMessage(2);
+ m_UI->pinBlockedMessage(2);
throw std::runtime_error("PIN2 locked");
}
- m_UI->PromptForPinAsync(m_subject, m_url, m_hash,
- retrying, triesLeft);
+ m_UI->pinDialog(m_subject, m_url, m_hash,
+ retrying, triesLeft);
}
@@ -441,7 +441,7 @@ void EsteidAPI::onPinEntered(const std::string& pin)
try {
// ask again for PIN
- promptForPinAsync(true);
+ askPin(true);
} catch(const std::exception& e) {
returnSignFailure(e.what());
}
@@ -509,7 +509,7 @@ void EsteidAPI::throwIfSignFailure()
std::string EsteidAPI::askPinAndSign(const std::string& hash, const std::string& url)
{
prepareSign(hash, url);
- promptForPinAsync();
+ askPin();
m_stoprequested = false;
do {
View
6 EsteidAPI.h
@@ -174,7 +174,7 @@ class EsteidAPI : public FB::JSAPIAuto, CardService::MessageObserver
SettingsCallback(FB::BrowserHostPtr host, EsteidAPI &eidp) :
CallbackAPI(host), m_eidp(eidp) { }
virtual bool eventHandler()
- { m_eidp.ShowSettings(); return true; };
+ { m_eidp.settingsDialog(); return true; };
private:
EsteidAPI &m_eidp;
};
@@ -202,10 +202,10 @@ class EsteidAPI : public FB::JSAPIAuto, CardService::MessageObserver
std::string pageURL();
void prepareSign(const std::string& hash, const std::string& url);
- void promptForPinAsync(bool retrying = false);
+ void askPin(bool retrying = false);
std::string signSHA1(std::string hash, const std::string& pin);
int getPin2RetryCount();
- void ShowSettings();
+ void settingsDialog();
void DisplayNotification(const std::string& msg);
void CreateNotificationBar();
void OpenNotificationBar();
View
13 Mac/MacUI.h
@@ -31,17 +31,18 @@ class MacUI : public PluginUI {
MacUI(boost::shared_ptr<UICallbacks>);
virtual ~MacUI();
- void PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries);
- void ClosePinPrompt();
+ void pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries);
+ void closePinDialog();
#ifdef SUPPORT_OLD_APIS
std::string PromptForPin(const std::string& subject,
const std::string& docUrl, const std::string& docHash,
bool retry, int tries);
#endif
- void ShowPinBlockedMessage(int pin);
- void ShowSettings(PluginSettings& settings, const std::string& pageUrl = "");
+ void pinBlockedMessage(int pin);
+ void settingsDialog(PluginSettings& settings, const std::string& pageUrl = "");
static void SetWindow(void *window);
private:
View
13 Mac/MacUI.mm
@@ -64,9 +64,10 @@
ESTEID_DEBUG("~MacUI()");
}
-void MacUI::PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries)
+void MacUI::pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -128,7 +129,7 @@
}
#endif
-void MacUI::ClosePinPrompt()
+void MacUI::closePinDialog()
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
@@ -137,7 +138,7 @@
[pool release];
}
-void MacUI::ShowPinBlockedMessage(int pin)
+void MacUI::pinBlockedMessage(int pin)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
NSBundle *bundle = [NSBundle bundleForClass:[(MacUIPrivate *)m_internal class]];
@@ -154,7 +155,7 @@
[pool release];
}
-void MacUI::ShowSettings(PluginSettings& settings, const std::string& pageUrl)
+void MacUI::settingsDialog(PluginSettings& settings, const std::string& pageUrl)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
View
17 PluginUI.h
@@ -42,19 +42,20 @@ class PluginUI
};
/** Prompt for Signature PIN */
- virtual void PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries) = 0;
+ virtual void pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries) = 0;
- /** Close Signature PIN prompt (used when user hits cancel on pinpad) */
- virtual void ClosePinPrompt() = 0;
+ /** Close Signature PIN dialog */
+ virtual void closePinDialog() = 0;
/** Inform user that the PIN has been blocked */
- virtual void ShowPinBlockedMessage(int pin) = 0;
+ virtual void pinBlockedMessage(int pin) = 0;
/** Open Settings dialog */
- virtual void ShowSettings(PluginSettings& conf,
- const std::string& pageUrl = "") = 0;
+ virtual void settingsDialog(PluginSettings& conf,
+ const std::string& pageUrl = "") = 0;
/** Run a single iteration of the underlying platform's event loop */
virtual void iteration() = 0;
View
21 Win/WindowsUI.cpp
@@ -87,11 +87,12 @@ HWND WindowsUI::parentHWND()
}
-void WindowsUI::PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries)
+void WindowsUI::pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries)
{
- ESTEID_DEBUG("WindowsUI::PromptForPinAsync()");
+ ESTEID_DEBUG("WindowsUI::pinDialog()");
m_pinInputDialog->setSubject(subject);
m_pinInputDialog->setRetry(retry);
@@ -100,23 +101,23 @@ void WindowsUI::PromptForPinAsync(const std::string& subject,
}
-void WindowsUI::ClosePinPrompt()
+void WindowsUI::closePinDialog()
{
- ESTEID_DEBUG("WindowsUI::ClosePinPrompt()");
+ ESTEID_DEBUG("WindowsUI::closePinDialog()");
}
-void WindowsUI::ShowPinBlockedMessage(int pin)
+void WindowsUI::pinBlockedMessage(int pin)
{
- ESTEID_DEBUG("WindowsUI::ShowPinBlockedMessage()");
+ ESTEID_DEBUG("WindowsUI::pinBlockedMessage()");
m_pinInputDialog->showPinBlocked(parentHWND());
}
-void WindowsUI::ShowSettings(PluginSettings& settings, const std::string& pageUrl)
+void WindowsUI::settingsDialog(PluginSettings& settings, const std::string& pageUrl)
{
- ESTEID_DEBUG("WindowsUI::ShowSettings()");
+ ESTEID_DEBUG("WindowsUI::settingsDialog()");
m_settings = &settings;
View
13 Win/WindowsUI.h
@@ -31,12 +31,13 @@ class WindowsUI : public PluginUI {
WindowsUI(boost::shared_ptr<UICallbacks>);
virtual ~WindowsUI();
- void PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries);
- void ClosePinPrompt();
- void ShowSettings(PluginSettings& settings, const std::string& pageUrl = "");
- void ShowPinBlockedMessage(int pin);
+ void pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries);
+ void closePinDialog();
+ void settingsDialog(PluginSettings& settings, const std::string& pageUrl = "");
+ void pinBlockedMessage(int pin);
void iteration();
protected:
View
13 X11/GtkUI.cpp
@@ -85,9 +85,10 @@ GdkWindow* GtkUI::browserWindow()
}
-void GtkUI::PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries)
+void GtkUI::pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries)
{
if (!m_pinInputDialog)
throw std::runtime_error("PinInputDialog not loaded");
@@ -110,12 +111,12 @@ void GtkUI::PromptForPinAsync(const std::string& subject,
m_dialog_up = true;
}
-void GtkUI::ClosePinPrompt()
+void GtkUI::closePinDialog()
{
}
-void GtkUI::ShowPinBlockedMessage(int pin)
+void GtkUI::pinBlockedMessage(int pin)
{
if (m_dialog_up)
return;
@@ -131,7 +132,7 @@ void GtkUI::ShowPinBlockedMessage(int pin)
}
-void GtkUI::ShowSettings(PluginSettings& settings, const std::string& pageUrl)
+void GtkUI::settingsDialog(PluginSettings& settings, const std::string& pageUrl)
{
m_settings = &settings;
View
13 X11/GtkUI.h
@@ -38,12 +38,13 @@ class GtkUI : public PluginUI {
GtkUI(boost::shared_ptr<UICallbacks>);
virtual ~GtkUI();
- void PromptForPinAsync(const std::string& subject,
- const std::string& docUrl, const std::string& docHash,
- bool retry, int tries);
- void ClosePinPrompt();
- void ShowSettings(PluginSettings& settings, const std::string& pageUrl = "");
- void ShowPinBlockedMessage(int pin);
+ void pinDialog(const std::string& subject,
+ const std::string& docUrl,
+ const std::string& docHash,
+ bool retry, int tries);
+ void closePinDialog();
+ void settingsDialog(PluginSettings& settings, const std::string& pageUrl = "");
+ void pinBlockedMessage(int pin);
void iteration();
protected:

0 comments on commit 03fcaa9

Please sign in to comment.
Something went wrong with that request. Please try again.