Hello andreip,

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

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

to review the following code:

Change 9879962 by stevebl...@steveblock-gears2 on 2009/01/27 19:10:40 *pending*

        Modifies HTML dialogs for Opera. Mailed on behalf of Opera.
        
        Thanks for the replies Deepak.

        I've made all of the changes I suggested. I tested on other browsers 
and it's OK to add the empty title tag in all cases. Let me know if you're 
happy with the changes and I'll submit.

        R=andreip
        [email protected],[email protected],[email protected]
        DELTA=61  (51 added, 2 deleted, 8 changed)
        OCL=9879962

Affected files ...

... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.css#6 edit
... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#13 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#7
 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4#6 
edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#9
 edit

61 delta lines: 51 added, 2 deleted, 8 changed

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 9879962 by stevebl...@steveblock-gears2 on 2009/01/27 19:10:40 *pending*

        Modifies HTML dialogs for Opera. Mailed on behalf of Opera.
        
        R=andreip
        [email protected],[email protected],[email protected]
        DELTA=133  (123 added, 0 deleted, 10 changed)
        OCL=9879962

Affected files ...

... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.css#6 edit
... //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#13 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#7
 edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4#6 
edit
... 
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#9
 edit

==== //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.css#6 - 
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/html_dialog.css 
====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/html_dialog.css       
2009-01-27 19:25:43.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/html_dialog.css       
2009-01-28 11:10:23.000000000 +0000
@@ -30,7 +30,21 @@
   padding:0;
   margin:0;
   height:100%;
+
+m4_ifelse(PRODUCT_OS,~wince~,m4_dnl
+~
+m4_ifelse(PRODUCT_BROWSER,~OPERA~,m4_dnl
+~
+  /*
+  On Opera Mobile we use overflow:auto to allow content to resize automatically
+  */
+  overflow:auto;
+~,~
   overflow:hidden;
+~)
+~,~
+  overflow:hidden;
+~)
   cursor:default;
 
   /* 
@@ -74,18 +88,25 @@
 }
 
 #foot {
-m4_ifelse(PRODUCT_OS,~android~,m4_dnl
-~
   /*
-  On Android we do not use position:absolute due to some
+  On Android and Opera Mobile we do not use position:absolute due to some
   rendering limitations (absolute positioning works, but
   the automatic resizing of dialog is confused by the
   variable content and the display is wrong, while if we
   remove the absolute positioning, #foot is back in the
   flow and the dialog displays correctly)
   */
+m4_ifelse(PRODUCT_OS,~android~,m4_dnl
+~~,~
+m4_ifelse(PRODUCT_OS,~wince~,m4_dnl
+~
+m4_ifelse(PRODUCT_BROWSER,~OPERA~,m4_dnl
+~~,~
+  position:absolute;
+~)
 ~,~
   position:absolute;
+~)
 ~)
   background:white;
   bottom:0;
@@ -98,7 +119,7 @@
 
 #buttons-wince {
   /*
-  On Windows Mobile, we hide the div containing the buttons by default, as
+  On IE Mobile, we hide the div containing the buttons by default, as
   they are only used on touchscreen devices.
   */
   display:none;
==== //depot/googleclient/gears/opensource/gears/ui/common/html_dialog.js#13 - 
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/html_dialog.js 
====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/html_dialog.js        
2009-01-27 19:25:43.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/html_dialog.js        
2009-01-28 11:11:49.000000000 +0000
@@ -140,6 +140,8 @@
     argsString = getFirefoxArguments(window.arguments[0]);
   } else if (browser.safari) {
     argsString = window.gears_dialogArguments;
+  } else if (browser.opera) {
+    argsString = window.dialogArguments;
   } else if (browser.android) {
     argsString = "" + window.bridge.getDialogArguments();
   } else if (browser.chrome) {
@@ -179,6 +181,9 @@
     window.close();
   } else if (browser.safari) {
     window.gears_dialog.setResults(resultString);
+  } else if (browser.opera) {
+    window.returnValue = resultString;
+    window.close();
   } else if (browser.android) {
     window.bridge.closeDialog(resultString);
   } else if (browser.chrome) {
==== 
//depot/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4#7
 - 
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4
 ====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4    
2009-01-27 19:25:44.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/permissions_dialog.html_m4    
2009-01-28 11:20:43.000000000 +0000
@@ -30,6 +30,8 @@
 
 <html>
 <head>
+  <meta name="viewport" content="width=device-width,user-scalable=no">
+  <title></title>
   <style type="text/css">
 
 m4_ifelse(PRODUCT_OS,~android~,~~,~m4_dnl
@@ -370,7 +372,7 @@
     if (!customName) {
       elem = dom.getElementById("origin-only");
       elem.style.display = "block";
-      if (browser.ie_mobile) {
+      if (browser.ie_mobile || browser.opera) {
         elem.innerHTML = wrapDomain(origin);
       } else {
         setTextContent(elem, origin);
@@ -385,7 +387,7 @@
     } else {
       elem = dom.getElementById("origin");
       elem.style.display = "block";
-      if (browser.ie_mobile) {
+      if (browser.ie_mobile || browser.opera) {
         elem.innerHTML = wrapDomain(origin);
       } else {
         setTextContent(elem, origin);
@@ -418,7 +420,10 @@
       dom.getElementById("checkbox-row").style.display = 'block';
       updateAllowButtonEnabledState();
     }
-    resizeDialogToFitContent();
+
+    // Do not resize on Opera Mobile, let the browser resize automatically
+    if (!(browser.wince && browser.opera))
+      resizeDialogToFitContent();
   }
 
 
==== 
//depot/googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4#6 
- 
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4
 ====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4       
2009-01-27 19:25:44.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/settings_dialog.html_m4       
2009-01-28 11:32:07.000000000 +0000
@@ -30,6 +30,8 @@
 
 <html>
 <head>
+  <meta name="viewport" content="width=device-width,user-scalable=no">
+  <title></title>
   <style type="text/css">
 
 m4_ifelse(PRODUCT_OS,~android~,~~,~m4_dnl
@@ -128,7 +130,14 @@
     }
 
 m4_ifelse(PRODUCT_OS,~wince~,m4_dnl
-~~,~
+~
+m4_ifelse(PRODUCT_BROWSER,~OPERA~,m4_dnl
+~
+    div.radio-buttons {
+      width: 120px;
+    }
+~,~~)
+~,~
     div.radio-buttons {
 m4_ifelse(PRODUCT_OS,~android~,m4_dnl
 ~
@@ -279,9 +288,13 @@
 
   if (!browser.ie_mobile) {
     CustomButton.initializeAll();
-    if (!browser.android) {
+
+    // Do not initialize custom layout on Opera Mobile, let the browser layout
+    // automatically.
+    if (!browser.android && !(browser.wince && browser.opera)) {
       initCustomLayout(layoutSettings);
     }
+
   } else {
     var applyText = dom.getElementById("string-apply");
     if (applyText) {
==== 
//depot/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4#9
 - 
c:\MyDocs\Gears2/googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4
 ====
# action=edit type=text
--- googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4      
2009-01-27 19:25:44.000000000 +0000
+++ googleclient/gears/opensource/gears/ui/common/shortcuts_dialog.html_m4      
2009-01-28 11:26:27.000000000 +0000
@@ -30,6 +30,8 @@
 
 <html>
 <head>
+  <meta name="viewport" content="width=device-width,user-scalable=no">
+  <title></title>
   <style type="text/css">
 
 m4_ifelse(PRODUCT_OS,~android~,~~,~m4_dnl
@@ -277,7 +279,10 @@
   initDialog();
   initLayout();
   initShortcuts(args);
-  resizeDialogToFitContent(dialogMinHeight);
+
+  // Do not resize on Opera Mobile, let the browser resize automatically.
+  if (!(browser.wince && browser.opera))
+    resizeDialogToFitContent(dialogMinHeight);
 
   function initLayout() {
     if (locationsEnabled) {

Reply via email to