Hello andreip,

I'd like you to do a code review.  Please execute
        g4 diff -c 9447321

or point your web browser to
        http://mondrian/9447321

to review the following code:

Change 9447321 by stevebl...@steveblock-gears3 on 2008/12/17 12:36:46 *pending*

        Implements HTML dialog for Opera. Mailed on behalf of Opera.
        
        R=andreip
        [email protected],[email protected]
        DELTA=31  (14 added, 4 deleted, 13 changed)
        OCL=9447321

Affected files ...

... //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#68 edit
... //depot/googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc#1 
edit

31 delta lines: 14 added, 4 deleted, 13 changed

Also consider running:
        g4 lint -c 9447321

which verifies that the changelist doesn't introduce new style violations.

If you can't do the review, please let me know as soon as possible.  During
your review, please ensure that all new code has corresponding unit tests and
that existing unit tests are updated appropriately.  Visit
http://www/eng/code_review.html for more information.

This is a semiautomated message from "g4 mail".  Complaints or suggestions?
Mail [email protected].
Change 9447321 by stevebl...@steveblock-gears3 on 2008/12/17 12:36:46 *pending*

        Implements HTML dialog for Opera. Mailed on behalf of Opera.

Affected files ...

... //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#68 edit
... //depot/googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc#1 
edit

==== //depot/googleclient/gears/opensource/gears/desktop/desktop.cc#68 - 
c:\MyDocs\Gears3/googleclient/gears/opensource/gears/desktop/desktop.cc ====
# action=edit type=text
--- googleclient/gears/opensource/gears/desktop/desktop.cc      2008-12-17 
12:38:29.000000000 +0000
+++ googleclient/gears/opensource/gears/desktop/desktop.cc      2008-12-17 
12:21:38.000000000 +0000
@@ -375,7 +375,7 @@
   const int kShortcutsDialogWidth = 360;
   const int kShortcutsDialogHeight = 320;
 
-  HtmlDialog shortcuts_dialog(NULL);
+  HtmlDialog shortcuts_dialog(EnvPageBrowsingContext());
   if (desktop.InitializeDialog(&shortcut_info, &shortcuts_dialog,
                                Desktop::DIALOG_STYLE_STANDARD)) {
     HtmlDialogReturnValue dialog_result = shortcuts_dialog.DoModal(
==== //depot/googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc#1 - 
c:\MyDocs\Gears3/googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc 
====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc      
2008-12-17 12:38:29.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/opera/html_dialog_op.cc      
2008-12-17 12:31:14.000000000 +0000
@@ -25,31 +25,41 @@
 
 #include "gears/ui/common/html_dialog.h"
 
-#include <assert.h>
+#include "third_party/opera/opera_callback_api.h"
+
+#include "gears/base/common/js_types.h"
+#include "gears/base/opera/opera_utils.h"
+#include "gears/base/opera/browsing_context_op.h"
 
 
-bool HtmlDialog::DoModalImpl(const char16 *html_filename,
-                             int width,
-                             int height,
+bool HtmlDialog::DoModalImpl(const char16 *html_filename, int width, int 
height,
                              const char16 *arguments_string) {
-  // TODO(steveblock): Implement me.
-  assert(false);
-  return false;
+  bool ret_val = false;
+
+  OperaGearsApiInterface *opera_api = OperaUtils::GetBrowserApiForGears();
+
+  const unsigned short *result;
+
+  OPBrowsingContext *context
+    = static_cast<OPBrowsingContext*>(browsing_context_);
+  opera_api->OpenDialog(context ? context->GetJsContext() : NULL,
+                        html_filename, width, height,
+                        arguments_string, &result);
+
+  return SetResult(result);
 }
 
-bool HtmlDialog::DoModelessImpl(const char16 *html_filename,
-                                int width,
-                                int height,
-                                const char16 *arguments_string,
-                                ModelessCompletionCallback callback,
-                                void *closure) {
-  // TODO(steveblock): Implement me.
+bool HtmlDialog::DoModelessImpl(
+    const char16 *html_filename, int width, int height,
+    const char16 *arguments_string,
+    ModelessCompletionCallback callback,
+    void *closure) {
+  // Unused in Opera.
   assert(false);
   return false;
 }
 
 bool HtmlDialog::GetLocale(std::string16 *locale) {
-  // TODO(steveblock): Implement me.
-  assert(false);
+  // TODO: Get the correct locale
   return false;
-}
+}
\ No newline at end of file

Reply via email to