summaryrefslogtreecommitdiffstats
path: root/chrome/common/extensions/extension_error_reporter.cc
diff options
context:
space:
mode:
authoravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 14:52:01 +0000
committeravi@chromium.org <avi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-25 14:52:01 +0000
commit638d35291e4a0e5e1ff6275e01296362ce4292be (patch)
tree9906d59bc3afc7b32af98c067fcc66bb94e149d3 /chrome/common/extensions/extension_error_reporter.cc
parentc0040acfc3017e824f61cb2607dfc913b8245c23 (diff)
downloadchromium_src-638d35291e4a0e5e1ff6275e01296362ce4292be.zip
chromium_src-638d35291e4a0e5e1ff6275e01296362ce4292be.tar.gz
chromium_src-638d35291e4a0e5e1ff6275e01296362ce4292be.tar.bz2
Temporary extension UI for the Mac.
BUG=none TEST=try loading a failing extension on the Mac; you should get some UI Review URL: http://codereview.chromium.org/147098 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@19247 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/common/extensions/extension_error_reporter.cc')
-rw-r--r--chrome/common/extensions/extension_error_reporter.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/chrome/common/extensions/extension_error_reporter.cc b/chrome/common/extensions/extension_error_reporter.cc
index 442ed79..87bd0f4 100644
--- a/chrome/common/extensions/extension_error_reporter.cc
+++ b/chrome/common/extensions/extension_error_reporter.cc
@@ -8,6 +8,10 @@
#if defined(OS_WIN)
#include "app/win_util.h"
+#elif defined(OS_MACOSX)
+#include "base/scoped_cftyperef.h"
+#include "base/sys_string_conversions.h"
+#include <CoreFoundation/CFUserNotification.h>
#endif
#include "base/logging.h"
#include "base/message_loop.h"
@@ -61,6 +65,15 @@ void ExtensionErrorReporter::ReportError(const std::string& message,
#if defined(OS_WIN)
win_util::MessageBox(NULL, UTF8ToWide(message), L"Extension error",
MB_OK | MB_SETFOREGROUND);
+#elif defined(OS_MACOSX)
+ // There must be a better way to do this, for all platforms.
+ scoped_cftyperef<CFStringRef> message_cf(
+ base::SysUTF8ToCFStringRef(message));
+ CFOptionFlags response;
+ CFUserNotificationDisplayAlert(
+ 0, kCFUserNotificationCautionAlertLevel, NULL, NULL, NULL,
+ CFSTR("Extension error"), message_cf,
+ NULL, NULL, NULL, &response);
#else
// TODO(port)
#endif