firefox-kde.patch
changeset 9 bc5dfe5b853a
child 13 c7935ea2351b
equal deleted inserted replaced
8:19a8c8d53349 9:bc5dfe5b853a
       
     1 diff --git a/browser/app/Makefile.in b/browser/app/Makefile.in
       
     2 --- a/browser/app/Makefile.in
       
     3 +++ b/browser/app/Makefile.in
       
     4 @@ -44,16 +44,17 @@ srcdir		= @srcdir@
       
     5  VPATH		= @srcdir@
       
     6  
       
     7  include $(DEPTH)/config/autoconf.mk
       
     8  
       
     9  DIRS		= profile/extensions
       
    10  
       
    11  PREF_JS_EXPORTS = $(srcdir)/profile/firefox.js \
       
    12  		  $(srcdir)/profile/channel-prefs.js \
       
    13 +		  $(srcdir)/profile/kde.js \
       
    14  		  $(NULL)
       
    15  
       
    16  
       
    17  # hardcode en-US for the moment
       
    18  AB_CD = en-US
       
    19  
       
    20  DEFINES += -DAB_CD=$(AB_CD)
       
    21  
       
    22 diff --git a/browser/base/content/browser-kde.xul b/browser/base/content/browser-kde.xul
       
    23 new file mode 100644
       
    24 --- /dev/null
       
    25 +++ b/browser/base/content/browser-kde.xul
       
    26 @@ -0,0 +1,643 @@
       
    27 +#filter substitution
       
    28 +<?xml version="1.0"?>
       
    29 +# -*- Mode: HTML -*-
       
    30 +#
       
    31 +# ***** BEGIN LICENSE BLOCK *****
       
    32 +# Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
    33 +#
       
    34 +# The contents of this file are subject to the Mozilla Public License Version
       
    35 +# 1.1 (the "License"); you may not use this file except in compliance with
       
    36 +# the License. You may obtain a copy of the License at
       
    37 +# http://www.mozilla.org/MPL/
       
    38 +#
       
    39 +# Software distributed under the License is distributed on an "AS IS" basis,
       
    40 +# WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
    41 +# for the specific language governing rights and limitations under the
       
    42 +# License.
       
    43 +#
       
    44 +# The Original Code is Mozilla Communicator client code, released
       
    45 +# March 31, 1998.
       
    46 +#
       
    47 +# The Initial Developer of the Original Code is
       
    48 +# Netscape Communications Corporation.
       
    49 +# Portions created by the Initial Developer are Copyright (C) 1998-2000
       
    50 +# the Initial Developer. All Rights Reserved.
       
    51 +#
       
    52 +# Contributor(s):
       
    53 +#   Blake Ross <blake@cs.stanford.edu>
       
    54 +#   David Hyatt <hyatt@mozilla.org>
       
    55 +#   Joe Hewitt <hewitt@netscape.com>
       
    56 +#   Pierre Chanial <chanial@noos.fr>
       
    57 +#   Dean Tessman <dean_tessman@hotmail.com>
       
    58 +#   Johnathan Nightingale <johnath@mozilla.com>
       
    59 +#   Dão Gottwald <dao@mozilla.com>
       
    60 +#   Ehsan Akhgari <ehsan.akhgari@gmail.com>
       
    61 +#   Robert Strong <robert.bugzilla@gmail.com>
       
    62 +#
       
    63 +# Alternatively, the contents of this file may be used under the terms of
       
    64 +# either the GNU General Public License Version 2 or later (the "GPL"), or
       
    65 +# the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
    66 +# in which case the provisions of the GPL or the LGPL are applicable instead
       
    67 +# of those above. If you wish to allow use of your version of this file only
       
    68 +# under the terms of either the GPL or the LGPL, and not to allow others to
       
    69 +# use your version of this file under the terms of the MPL, indicate your
       
    70 +# decision by deleting the provisions above and replace them with the notice
       
    71 +# and other provisions required by the GPL or the LGPL. If you do not delete
       
    72 +# the provisions above, a recipient may use your version of this file under
       
    73 +# the terms of any one of the MPL, the GPL or the LGPL.
       
    74 +#
       
    75 +# ***** END LICENSE BLOCK *****
       
    76 +
       
    77 +<?xml-stylesheet href="chrome://browser/content/browser.css" type="text/css"?>
       
    78 +<?xml-stylesheet href="chrome://browser/content/places/places.css" type="text/css"?>
       
    79 +<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
       
    80 +
       
    81 +<?xul-overlay href="chrome://global/content/editMenuOverlay.xul"?>
       
    82 +<?xul-overlay href="chrome://browser/content/baseMenuOverlay.xul"?>
       
    83 +<?xul-overlay href="chrome://browser/content/places/placesOverlay.xul"?>
       
    84 +
       
    85 +# All DTD information is stored in a separate file so that it can be shared by
       
    86 +# hiddenWindow.xul.
       
    87 +#include browser-doctype.inc
       
    88 +
       
    89 +<window id="main-window"
       
    90 +        xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
       
    91 +        xmlns:svg="http://www.w3.org/2000/svg"
       
    92 +        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
       
    93 +        onload="BrowserStartup()" onunload="BrowserShutdown()" onclose="return WindowIsClosing();"
       
    94 +        title="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
       
    95 +        title_normal="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
       
    96 +#ifdef XP_MACOSX
       
    97 +        title_privatebrowsing="&mainWindow.title;@PRE_RELEASE_SUFFIX@&mainWindow.titlemodifiermenuseparator;&mainWindow.titlePrivateBrowsingSuffix;"
       
    98 +        titledefault="&mainWindow.title;@PRE_RELEASE_SUFFIX@"
       
    99 +        titlemodifier=""
       
   100 +        titlemodifier_normal=""
       
   101 +        titlemodifier_privatebrowsing="&mainWindow.titlePrivateBrowsingSuffix;"
       
   102 +#else
       
   103 +        title_privatebrowsing="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@ &mainWindow.titlePrivateBrowsingSuffix;"
       
   104 +        titlemodifier="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@"
       
   105 +        titlemodifier_normal="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@"
       
   106 +        titlemodifier_privatebrowsing="&mainWindow.titlemodifier;@PRE_RELEASE_SUFFIX@ &mainWindow.titlePrivateBrowsingSuffix;"
       
   107 +#endif
       
   108 +        titlemenuseparator="&mainWindow.titlemodifiermenuseparator;"
       
   109 +        lightweightthemes="true"
       
   110 +        lightweightthemesfooter="browser-bottombox"
       
   111 +        windowtype="navigator:browser"
       
   112 +        screenX="4" screenY="4"
       
   113 +        browsingmode="normal"
       
   114 +        toggletoolbar="true"
       
   115 +        persist="screenX screenY width height sizemode"> 
       
   116 +
       
   117 +# All JS files which are not content (only) dependent that browser.xul
       
   118 +# wishes to include *must* go into the global-scripts.inc file
       
   119 +# so that they can be shared by macBrowserOverlay.xul.
       
   120 +#include global-scripts.inc
       
   121 +<script type="application/x-javascript" src="chrome://browser/content/nsContextMenu.js"/>
       
   122 +
       
   123 +#ifdef MOZ_SAFE_BROWSING
       
   124 +<script type="application/x-javascript" src="chrome://browser/content/safebrowsing/sb-loader.js"/>
       
   125 +#endif
       
   126 +<script type="application/x-javascript" src="chrome://global/content/contentAreaUtils.js"/>
       
   127 +
       
   128 +<script type="application/javascript" src="chrome://browser/content/places/editBookmarkOverlay.js"/>
       
   129 +
       
   130 +# All sets except for popupsets (commands, keys, stringbundles and broadcasters) *must* go into the 
       
   131 +# browser-sets.inc file for sharing with hiddenWindow.xul.
       
   132 +#include browser-sets.inc
       
   133 +
       
   134 +  <popupset id="mainPopupSet">
       
   135 +    <menupopup id="backForwardMenu"
       
   136 +               onpopupshowing="return FillHistoryMenu(event.target);"
       
   137 +               oncommand="gotoHistoryIndex(event);"
       
   138 +               onclick="checkForMiddleClick(this, event);"/>
       
   139 +    <tooltip id="aHTMLTooltip" onpopupshowing="return FillInHTMLTooltip(document.tooltipNode);"/>
       
   140 +
       
   141 +    <!-- for search and content formfill/pw manager -->
       
   142 +    <panel type="autocomplete" id="PopupAutoComplete" noautofocus="true" hidden="true"/>
       
   143 +
       
   144 +    <!-- for url bar autocomplete -->
       
   145 +    <panel type="autocomplete-richlistbox" id="PopupAutoCompleteRichResult" noautofocus="true" hidden="true"/>
       
   146 +
       
   147 +    <panel id="editBookmarkPanel"
       
   148 +           orient="vertical"
       
   149 +           ignorekeys="true"
       
   150 +           hidden="true"
       
   151 +           onpopupshown="StarUI.panelShown(event);"
       
   152 +           aria-labelledby="editBookmarkPanelTitle">
       
   153 +      <row id="editBookmarkPanelHeader" align="center" hidden="true">
       
   154 +        <vbox align="center">
       
   155 +          <image id="editBookmarkPanelStarIcon"/>
       
   156 +        </vbox>
       
   157 +        <vbox>
       
   158 +          <label id="editBookmarkPanelTitle"/>
       
   159 +          <description id="editBookmarkPanelDescription"/>
       
   160 +          <hbox>
       
   161 +            <button id="editBookmarkPanelUndoRemoveButton"
       
   162 +                    class="editBookmarkPanelHeaderButton"
       
   163 +                    hidden="true"
       
   164 +                    oncommand="StarUI.undoRemoveBookmarkCommand();"
       
   165 +                    label="&editBookmark.undo.label;"
       
   166 +                    accesskey="&editBookmark.undo.accessKey;"/>
       
   167 +            <button id="editBookmarkPanelRemoveButton"
       
   168 +                    class="editBookmarkPanelHeaderButton"
       
   169 +                    oncommand="StarUI.removeBookmarkButtonCommand();"
       
   170 +                    accesskey="&editBookmark.removeBookmark.accessKey;"/>
       
   171 +            <button id="editBookmarkPanelEditButton"
       
   172 +                    class="editBookmarkPanelHeaderButton"
       
   173 +                    oncommand="StarUI.editButtonCommand();"
       
   174 +                    label="&editBookmark.edit.label;"
       
   175 +                    accesskey="&editBookmark.edit.accessKey;"/>
       
   176 +          </hbox>
       
   177 +        </vbox>
       
   178 +      </row>
       
   179 +      <vbox id="editBookmarkPanelContent" flex="1" hidden="true"/>
       
   180 +      <hbox id="editBookmarkPanelBottomButtons" pack="end">
       
   181 +#ifndef XP_UNIX
       
   182 +        <button id="editBookmarkPanelDoneButton"
       
   183 +                class="editBookmarkPanelBottomButton"
       
   184 +                label="&editBookmark.done.label;"
       
   185 +                default="true"
       
   186 +                oncommand="StarUI.panel.hidePopup();"/>
       
   187 +        <button id="editBookmarkPanelDeleteButton"
       
   188 +                class="editBookmarkPanelBottomButton"
       
   189 +                label="&editBookmark.cancel.label;"
       
   190 +                oncommand="StarUI.cancelButtonOnCommand();"/>
       
   191 +#elif XP_UNIX_GNOME
       
   192 +        <button id="editBookmarkPanelDeleteButton"
       
   193 +                class="editBookmarkPanelBottomButton"
       
   194 +                label="&editBookmark.cancel.label;"
       
   195 +                oncommand="StarUI.cancelButtonOnCommand();"/>
       
   196 +        <button id="editBookmarkPanelDoneButton"
       
   197 +                class="editBookmarkPanelBottomButton"
       
   198 +                label="&editBookmark.done.label;"
       
   199 +                default="true"
       
   200 +                oncommand="StarUI.panel.hidePopup();"/>
       
   201 +#else
       
   202 +        <button id="editBookmarkPanelDoneButton"
       
   203 +                label="&editBookmark.done.label;"
       
   204 +                default="true"
       
   205 +                oncommand="StarUI.panel.hidePopup();"/>
       
   206 +        <button id="editBookmarkPanelDeleteButton"
       
   207 +                label="&editBookmark.cancel.label;"
       
   208 +                oncommand="StarUI.cancelButtonOnCommand();"/>
       
   209 +#endif
       
   210 +      </hbox>
       
   211 +    </panel>
       
   212 +
       
   213 +    <popup id="toolbar-context-menu"
       
   214 +           onpopupshowing="onViewToolbarsPopupShowing(event);">
       
   215 +      <menuseparator/>
       
   216 +      <menuitem command="cmd_CustomizeToolbars"
       
   217 +                label="&viewCustomizeToolbar.label;"
       
   218 +                accesskey="&viewCustomizeToolbar.accesskey;"/>
       
   219 +    </popup>
       
   220 +
       
   221 +    <popup id="blockedPopupOptions" 
       
   222 +           onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
       
   223 +      <menuitem observes="blockedPopupAllowSite"/>
       
   224 +      <menuitem observes="blockedPopupEditSettings"/>
       
   225 +      <menuitem observes="blockedPopupDontShowMessage"/>
       
   226 +      <menuseparator observes="blockedPopupsSeparator"/>
       
   227 +    </popup>
       
   228 +
       
   229 +    <menupopup id="autohide-context"
       
   230 +           onpopupshowing="FullScreen.getAutohide(this.firstChild);">
       
   231 +      <menuitem type="checkbox" label="&fullScreenAutohide.label;"
       
   232 +                accesskey="&fullScreenAutohide.accesskey;"
       
   233 +                oncommand="FullScreen.setAutohide();"/>
       
   234 +      <menuseparator/>
       
   235 +      <menuitem label="&fullScreenExit.label;"
       
   236 +                accesskey="&fullScreenExit.accesskey;"
       
   237 +                oncommand="BrowserFullScreen();"/>
       
   238 +    </menupopup>
       
   239 +
       
   240 +    <popup id="contentAreaContextMenu"
       
   241 +           onpopupshowing="if (event.target != this) return true; updateEditUIVisibility(); gContextMenu = new nsContextMenu(this, window.getBrowser()); return gContextMenu.shouldDisplay;"
       
   242 +           onpopuphiding="if (event.target == this) { gContextMenu = null; updateEditUIVisibility(); }">
       
   243 +#include browser-context.inc
       
   244 +    </popup>
       
   245 +
       
   246 +    <popup id="placesContext"/>
       
   247 +
       
   248 +    <!-- Popup for site identity information -->
       
   249 +    <panel id="identity-popup" position="after_start" hidden="true" noautofocus="true"
       
   250 +           onpopupshown="document.getElementById('identity-popup-more-info-button').focus();"
       
   251 +           level="top">
       
   252 +      <hbox id="identity-popup-container" align="top">
       
   253 +        <image id="identity-popup-icon"/>
       
   254 +        <vbox id="identity-popup-content-box">
       
   255 +          <label id="identity-popup-connectedToLabel"
       
   256 +                 class="identity-popup-label"
       
   257 +                 value="&identity.connectedTo;"/>
       
   258 +          <label id="identity-popup-connectedToLabel2"
       
   259 +                 class="identity-popup-label"
       
   260 +                 value="&identity.unverifiedsite2;"/>
       
   261 +          <description id="identity-popup-content-host"
       
   262 +                       class="identity-popup-description"/>
       
   263 +          <label id="identity-popup-runByLabel"
       
   264 +                 class="identity-popup-label"
       
   265 +                 value="&identity.runBy;"/>
       
   266 +          <description id="identity-popup-content-owner"
       
   267 +                       class="identity-popup-description"/>
       
   268 +          <description id="identity-popup-content-supplemental"
       
   269 +                       class="identity-popup-description"/>
       
   270 +          <description id="identity-popup-content-verifier"
       
   271 +                       class="identity-popup-description"/>
       
   272 +          <hbox id="identity-popup-encryption" flex="1">
       
   273 +            <vbox>
       
   274 +              <image id="identity-popup-encryption-icon"/>
       
   275 +            </vbox>
       
   276 +            <description id="identity-popup-encryption-label" flex="1"
       
   277 +                         class="identity-popup-description"/>
       
   278 +          </hbox>
       
   279 +          <!-- Footer button to open security page info -->
       
   280 +          <hbox pack="end">
       
   281 +            <button id="identity-popup-more-info-button"
       
   282 +                    label="&identity.moreInfoLinkText;"
       
   283 +                    onblur="gIdentityHandler.hideIdentityPopup();"
       
   284 +                    oncommand="gIdentityHandler.handleMoreInfoClick(event);"/>
       
   285 +          </hbox>
       
   286 +        </vbox>
       
   287 +      </hbox>
       
   288 +    </panel>
       
   289 +
       
   290 +    <tooltip id="urlTooltip">
       
   291 +      <label crop="center" flex="1" class="tooltip-label"/>
       
   292 +    </tooltip>
       
   293 +
       
   294 +    <panel id="ctrlTab-panel" class="KUI-panel" hidden="true" norestorefocus="true" level="top">
       
   295 +      <hbox>
       
   296 +        <button class="ctrlTab-preview" flex="1"/>
       
   297 +        <button class="ctrlTab-preview" flex="1"/>
       
   298 +        <button class="ctrlTab-preview" flex="1"/>
       
   299 +        <button class="ctrlTab-preview" flex="1"/>
       
   300 +        <button class="ctrlTab-preview" flex="1"/>
       
   301 +        <button class="ctrlTab-preview" flex="1"/>
       
   302 +      </hbox>
       
   303 +      <hbox pack="center">
       
   304 +        <button id="ctrlTab-showAll" class="ctrlTab-preview" noicon="true"/>
       
   305 +      </hbox>
       
   306 +    </panel>
       
   307 +
       
   308 +    <panel id="allTabs-panel" hidden="true" norestorefocus="true" ignorekeys="true"
       
   309 +# XXX: KUI style disabled, because the transparent background slows down
       
   310 +#      interacting with the panel, esp. the search field.
       
   311 +#           class="KUI-panel"
       
   312 +           onmouseover="allTabs._updateTabCloseButton(event);">
       
   313 +      <hbox id="allTabs-meta" align="center">
       
   314 +        <spacer flex="1"/>
       
   315 +        <textbox id="allTabs-filter"
       
   316 +                 tooltiptext="&allTabs.filter.emptyText;"
       
   317 +                 type="search"
       
   318 +                 oncommand="allTabs.filter();"/>
       
   319 +        <spacer flex="1"/>
       
   320 +        <toolbarbutton class="KUI-panel-closebutton"
       
   321 +                       oncommand="allTabs.close()"
       
   322 +                       tooltiptext="&closeCmd.label;"/>
       
   323 +      </hbox>
       
   324 +      <stack id="allTabs-stack">
       
   325 +        <box id="allTabs-container"/>
       
   326 +        <toolbarbutton id="allTabs-tab-close-button"
       
   327 +                       class="tab-close-button"
       
   328 +                       oncommand="allTabs.closeTab(event);"
       
   329 +                       tooltiptext="&closeCmd.label;"
       
   330 +                       style="visibility:hidden"/>
       
   331 +      </stack>
       
   332 +    </panel>
       
   333 +  </popupset>
       
   334 +
       
   335 +  <!-- Bookmarks and history tooltip -->
       
   336 +  <tooltip id="bhTooltip"/>
       
   337 +
       
   338 +  <toolbox id="navigator-toolbox" class="toolbox-top" mode="icons"
       
   339 +#ifdef WINCE
       
   340 +           defaulticonsize="small" iconsize="small"
       
   341 +#endif
       
   342 +           defaultmode="icons">
       
   343 +    <!-- Menu -->
       
   344 +    <toolbar type="menubar" id="toolbar-menubar" class="chromeclass-menubar" customizable="true"
       
   345 +             defaultset="menubar-items"
       
   346 +             mode="icons" iconsize="small" defaulticonsize="small"
       
   347 +#ifdef XP_WIN
       
   348 +             toolbarname="&menubarCmd.label;"
       
   349 +             accesskey="&menubarCmd.accesskey;"
       
   350 +#endif
       
   351 +             context="toolbar-context-menu">
       
   352 +      <toolbaritem id="menubar-items" align="center">
       
   353 +# The entire main menubar is placed into browser-menubar.inc, so that it can be shared by 
       
   354 +# hiddenWindow.xul.
       
   355 +#include browser-menubar.inc
       
   356 +      </toolbaritem>
       
   357 +    </toolbar>
       
   358 +
       
   359 +    <toolbarpalette id="BrowserToolbarPalette">
       
   360 +
       
   361 +      <toolbaritem id="unified-back-forward-button" class="chromeclass-toolbar-additional"
       
   362 +                   context="backForwardMenu">
       
   363 +        <toolbarbutton id="back-button" class="toolbarbutton-1"
       
   364 +                       label="&backCmd.label;"
       
   365 +                       command="Browser:BackOrBackDuplicate"
       
   366 +                       onclick="checkForMiddleClick(this, event);"
       
   367 +                       tooltiptext="&backButton.tooltip;"/>
       
   368 +        <toolbarbutton id="forward-button" class="toolbarbutton-1"
       
   369 +                       label="&forwardCmd.label;"
       
   370 +                       command="Browser:ForwardOrForwardDuplicate"
       
   371 +                       onclick="checkForMiddleClick(this, event);"
       
   372 +                       tooltiptext="&forwardButton.tooltip;"/>
       
   373 +        <toolbarbutton id="back-forward-dropmarker" type="menu"
       
   374 +                       disabled="true" tooltiptext="&backForwardMenu.tooltip;"
       
   375 +                       onbroadcast="if (this.disabled) this.disabled =
       
   376 +                                      document.getElementById('Browser:Back').hasAttribute('disabled') &amp;&amp;
       
   377 +                                      document.getElementById('Browser:Forward').hasAttribute('disabled');">
       
   378 +          <!-- bug 415444: event.stopPropagation is here for the cloned version of
       
   379 +               this menupopup -->
       
   380 +          <menupopup context=""
       
   381 +                     position="after_start"
       
   382 +                     onpopupshowing="return FillHistoryMenu(event.target);"
       
   383 +                     oncommand="gotoHistoryIndex(event); event.stopPropagation();"
       
   384 +                     onclick="checkForMiddleClick(this, event);"/>
       
   385 +          <observes element="Browser:Back" attribute="disabled"/>
       
   386 +          <observes element="Browser:Forward" attribute="disabled"/>
       
   387 +        </toolbarbutton>
       
   388 +      </toolbaritem>
       
   389 +
       
   390 +      <toolbarbutton id="reload-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   391 +                     label="&reloadCmd.label;"
       
   392 +                     command="Browser:ReloadOrDuplicate"
       
   393 +                     onclick="checkForMiddleClick(this, event);"
       
   394 +                     tooltiptext="&reloadButton.tooltip;"/>
       
   395 +
       
   396 +      <toolbarbutton id="stop-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   397 +                     label="&stopCmd.label;"
       
   398 +                     command="Browser:Stop"
       
   399 +                     tooltiptext="&stopButton.tooltip;"/>
       
   400 +
       
   401 +      <toolbarbutton id="home-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   402 +                     persist="class"
       
   403 +                     label="&homeButton.label;"
       
   404 +                     ondragover="homeButtonObserver.onDragOver(event)"
       
   405 +                     ondragenter="homeButtonObserver.onDragOver(event)"
       
   406 +                     ondrop="homeButtonObserver.onDrop(event)"
       
   407 +                     ondragleave="homeButtonObserver.onDragLeave(event)"
       
   408 +                     onclick="BrowserGoHome(event);"/>
       
   409 +
       
   410 +      <toolbaritem id="urlbar-container" align="center" flex="400" persist="width"
       
   411 +                   title="&locationItem.title;" class="chromeclass-location">
       
   412 +        <textbox id="urlbar" flex="1"
       
   413 +                 bookmarkhistoryemptytext="&urlbar.bookmarkhistory.emptyText;"
       
   414 +                 bookmarkemptytext="&urlbar.bookmark.emptyText;"
       
   415 +                 historyemptytext="&urlbar.history.emptyText;"
       
   416 +                 noneemptytext="&urlbar.none.emptyText;"
       
   417 +                 type="autocomplete"
       
   418 +                 autocompletesearch="history"
       
   419 +                 autocompletepopup="PopupAutoCompleteRichResult"
       
   420 +                 completeselectedindex="true"
       
   421 +                 tabscrolling="true"
       
   422 +                 showcommentcolumn="true"
       
   423 +                 showimagecolumn="true"
       
   424 +                 enablehistory="true"
       
   425 +                 maxrows="6"
       
   426 +                 newlines="stripsurroundingwhitespace"
       
   427 +                 oninput="gBrowser.userTypedValue = this.value;"
       
   428 +                 ontextentered="this.handleCommand(param);"
       
   429 +                 ontextreverted="return this.handleRevert();"
       
   430 +                 pageproxystate="invalid"
       
   431 +                 onsearchbegin="LocationBarHelpers._searchBegin();"
       
   432 +                 onsearchcomplete="LocationBarHelpers._searchComplete();"
       
   433 +                 onfocus="document.getElementById('identity-box').style.MozUserFocus= 'normal'"
       
   434 +                 onblur="setTimeout(function() document.getElementById('identity-box').style.MozUserFocus = '', 0);">
       
   435 +          <!-- Use onclick instead of normal popup= syntax since the popup
       
   436 +               code fires onmousedown, and hence eats our favicon drag events.
       
   437 +               We only add the identity-box button to the tab order when the location bar
       
   438 +               has focus, otherwise pressing F6 focuses it instead of the location bar -->
       
   439 +          <box id="identity-box" role="button"
       
   440 +               onclick="gIdentityHandler.handleIdentityButtonEvent(event);"
       
   441 +               onkeypress="gIdentityHandler.handleIdentityButtonEvent(event);">
       
   442 +            <hbox id="identity-box-inner" align="center">
       
   443 +              <stack id="page-proxy-stack"
       
   444 +                     onclick="PageProxyClickHandler(event);">
       
   445 +                <image id="urlbar-throbber" busy="false"/>
       
   446 +                <image id="page-proxy-favicon" validate="never"
       
   447 +                       pageproxystate="invalid"
       
   448 +                       ondragstart="proxyIconDNDObserver.onDragStart(event);"
       
   449 +                       onerror="this.removeAttribute('src');"/>
       
   450 +              </stack>
       
   451 +              <label id="identity-icon-label" crop="center" flex="1"/>
       
   452 +            </hbox>
       
   453 +          </box>
       
   454 +          <hbox id="urlbar-icons">
       
   455 +            <button type="menu"
       
   456 +                    style="-moz-user-focus: none"
       
   457 +                    class="plain urlbar-icon"
       
   458 +                    id="feed-button"
       
   459 +                    collapsed="true"
       
   460 +                    tooltiptext="&feedButton.tooltip;"
       
   461 +                    onclick="return FeedHandler.onFeedButtonClick(event);">
       
   462 +              <menupopup position="after_end"
       
   463 +                         id="feed-menu"
       
   464 +                         onpopupshowing="return FeedHandler.buildFeedList(this);"
       
   465 +                         oncommand="return FeedHandler.subscribeToFeed(null, event);"
       
   466 +                         onclick="checkForMiddleClick(this, event);"/>
       
   467 +            </button>
       
   468 +            <image id="star-button"
       
   469 +                   class="urlbar-icon"
       
   470 +                   onclick="PlacesStarButton.onClick(event);"/>
       
   471 +            <image id="go-button"
       
   472 +                   class="urlbar-icon"
       
   473 +                   tooltiptext="&goEndCap.tooltip;"
       
   474 +                   onclick="gURLBar.handleCommand(event);"/>
       
   475 +          </hbox>
       
   476 +        </textbox>
       
   477 +      </toolbaritem>
       
   478 +
       
   479 +      <toolbaritem id="search-container" title="&searchItem.title;"
       
   480 +                   align="center" class="chromeclass-toolbar-additional"
       
   481 +                   flex="100" persist="width">
       
   482 +        <searchbar id="searchbar" flex="1"/>
       
   483 +      </toolbaritem>
       
   484 +
       
   485 +      <toolbarbutton id="print-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   486 +                     label="&printButton.label;" command="cmd_print"
       
   487 +                     tooltiptext="&printButton.tooltip;"/>
       
   488 +
       
   489 +      <toolbaritem id="navigator-throbber" title="&throbberItem.title;" align="center" pack="center"
       
   490 +                   mousethrough="always">
       
   491 +        <image/>
       
   492 +      </toolbaritem>
       
   493 +
       
   494 +      <toolbaritem flex="1" id="personal-bookmarks" title="&bookmarksItem.title;">
       
   495 +         <hbox id="bookmarksBarContent" flex="1"
       
   496 +               type="places"
       
   497 +               place="place:folder=TOOLBAR"
       
   498 +               context="placesContext"
       
   499 +               onclick="BookmarksEventHandler.onClick(event);"
       
   500 +               oncommand="BookmarksEventHandler.onCommand(event);"
       
   501 +               onpopupshowing="BookmarksEventHandler.onPopupShowing(event);"
       
   502 +               tooltip="bhTooltip" popupsinherittooltip="true"/>
       
   503 +      </toolbaritem>
       
   504 +
       
   505 +        <toolbarbutton id="downloads-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   506 +                       observes="Tools:Downloads"
       
   507 +                       ondrop="DownloadsButtonDNDObserver.onDrop(event)"
       
   508 +                       ondragover="DownloadsButtonDNDObserver.onDragOver(event)"
       
   509 +                       ondragenter="DownloadsButtonDNDObserver.onDragOver(event)"
       
   510 +                       ondragleave="DownloadsButtonDNDObserver.onDragLeave(event)"
       
   511 +                       label="&downloads.label;"
       
   512 +                       tooltiptext="&downloads.tooltip;"/>
       
   513 +
       
   514 +        <toolbarbutton id="history-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   515 +                       observes="viewHistorySidebar" label="&historyButton.label;"
       
   516 +                       tooltiptext="&historyButton.tooltip;"/>
       
   517 +
       
   518 +        <toolbarbutton id="bookmarks-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   519 +                       observes="viewBookmarksSidebar"
       
   520 +                       tooltiptext="&bookmarksButton.tooltip;"
       
   521 +                       ondrop="bookmarksButtonObserver.onDrop(event)"
       
   522 +                       ondragover="bookmarksButtonObserver.onDragOver(event)"
       
   523 +                       ondragenter="bookmarksButtonObserver.onDragOver(event)"
       
   524 +                       ondragleave="bookmarksButtonObserver.onDragLeave(event)"/>
       
   525 +
       
   526 +        <toolbarbutton id="new-tab-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   527 +                       label="&tabCmd.label;"
       
   528 +                       command="cmd_newNavigatorTab"
       
   529 +                       tooltiptext="&newTabButton.tooltip;"
       
   530 +                       ondrop="newTabButtonObserver.onDrop(event)"
       
   531 +                       ondragover="newTabButtonObserver.onDragOver(event)"
       
   532 +                       ondragenter="newTabButtonObserver.onDragOver(event)"
       
   533 +                       ondragleave="newTabButtonObserver.onDragLeave(event)"/>
       
   534 +
       
   535 +        <toolbarbutton id="new-window-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   536 +                       label="&newNavigatorCmd.label;"
       
   537 +                       command="key_newNavigator"
       
   538 +                       tooltiptext="&newWindowButton.tooltip;"
       
   539 +                       ondrop="newWindowButtonObserver.onDrop(event)"
       
   540 +                       ondragover="newWindowButtonObserver.onDragOver(event)"
       
   541 +                       ondragenter="newWindowButtonObserver.onDragOver(event)"
       
   542 +                       ondragleave="newWindowButtonObserver.onDragLeave(event)"/>
       
   543 +
       
   544 +        <toolbarbutton id="cut-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   545 +                       label="&cutCmd.label;"
       
   546 +                       command="cmd_cut"
       
   547 +                       tooltiptext="&cutButton.tooltip;"/>
       
   548 +
       
   549 +        <toolbarbutton id="copy-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   550 +                       label="&copyCmd.label;"
       
   551 +                       command="cmd_copy"
       
   552 +                       tooltiptext="&copyButton.tooltip;"/>
       
   553 +
       
   554 +        <toolbarbutton id="paste-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   555 +                       label="&pasteCmd.label;"
       
   556 +                       command="cmd_paste"
       
   557 +                       tooltiptext="&pasteButton.tooltip;"/>
       
   558 +        <toolbarbutton id="fullscreen-button" class="toolbarbutton-1 chromeclass-toolbar-additional"
       
   559 +                       observes="View:FullScreen"
       
   560 +                       type="checkbox"
       
   561 +                       label="&fullScreenCmd.label;"
       
   562 +                       tooltiptext="&fullScreenButton.tooltip;"/>
       
   563 +    </toolbarpalette>
       
   564 +
       
   565 +    <toolbar id="nav-bar" class="toolbar-primary chromeclass-toolbar"
       
   566 +             toolbarname="&navbarCmd.label;" accesskey="&navbarCmd.accesskey;"
       
   567 +             fullscreentoolbar="true" mode="icons"
       
   568 +#ifdef WINCE
       
   569 +             iconsize="small" defaulticonsize="small"
       
   570 +#else
       
   571 +             iconsize="large"
       
   572 +#endif
       
   573 +             customizable="true"
       
   574 +#ifdef WINCE
       
   575 +             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,navigator-throbber,fullscreenflex,window-controls"
       
   576 +#else
       
   577 +             defaultset="unified-back-forward-button,reload-button,stop-button,home-button,urlbar-container,search-container,fullscreenflex,window-controls"
       
   578 +#endif
       
   579 +             context="toolbar-context-menu">
       
   580 +      <hbox id="fullscreenflex" flex="1" hidden="true" fullscreencontrol="true"/>
       
   581 +      <hbox id="window-controls" hidden="true" fullscreencontrol="true">
       
   582 +        <toolbarbutton id="minimize-button" class="toolbarbutton-1"
       
   583 +                       tooltiptext="&fullScreenMinimize.tooltip;"
       
   584 +                       oncommand="window.minimize();"/>
       
   585 +
       
   586 +        <toolbarbutton id="restore-button" class="toolbarbutton-1"
       
   587 +                       tooltiptext="&fullScreenRestore.tooltip;"
       
   588 +                       oncommand="BrowserFullScreen();"/>
       
   589 +
       
   590 +        <toolbarbutton id="close-button" class="toolbarbutton-1"
       
   591 +                       tooltiptext="&fullScreenClose.tooltip;"
       
   592 +                       oncommand="BrowserTryToCloseWindow();"/>
       
   593 +      </hbox>
       
   594 +    </toolbar>
       
   595 +
       
   596 +    <toolbarset id="customToolbars" context="toolbar-context-menu"/>
       
   597 +
       
   598 +    <toolbar id="PersonalToolbar"
       
   599 +             mode="icons" iconsize="small" defaulticonsize="small"
       
   600 +             class="chromeclass-directories"
       
   601 +             context="toolbar-context-menu"
       
   602 +             defaultset="personal-bookmarks"
       
   603 +             toolbarname="&personalbarCmd.label;" accesskey="&personalbarCmd.accesskey;"
       
   604 +#ifdef WINCE
       
   605 +             collapsed="true"
       
   606 +#endif
       
   607 +             customizable="true"/>
       
   608 +  </toolbox>
       
   609 +
       
   610 +  <hbox flex="1" id="browser">
       
   611 +    <vbox id="sidebar-box" hidden="true" class="chromeclass-extrachrome">
       
   612 +      <sidebarheader id="sidebar-header" align="center">
       
   613 +        <label id="sidebar-title" persist="value" flex="1" crop="end" control="sidebar"/>
       
   614 +        <image id="sidebar-throbber"/>
       
   615 +        <toolbarbutton class="tabs-closebutton" tooltiptext="&sidebarCloseButton.tooltip;" oncommand="toggleSidebar();"/>
       
   616 +      </sidebarheader>
       
   617 +      <browser id="sidebar" flex="1" autoscroll="false" disablehistory="true"
       
   618 +                style="min-width: 14em; width: 18em; max-width: 36em;"/>
       
   619 +    </vbox>
       
   620 +
       
   621 +    <splitter id="sidebar-splitter" class="chromeclass-extrachrome" hidden="true"/>
       
   622 +    <vbox id="appcontent" flex="1">
       
   623 +      <tabbrowser id="content" disablehistory="true"
       
   624 +                  flex="1" contenttooltip="aHTMLTooltip"
       
   625 +                  contentcontextmenu="contentAreaContextMenu"
       
   626 +                  onnewtab="BrowserOpenTab();"
       
   627 +                  autocompletepopup="PopupAutoComplete"
       
   628 +                  ondrop="contentAreaDNDObserver.onDrop(event)"
       
   629 +                  onclick="return contentAreaClick(event, false);"/>
       
   630 +    </vbox>
       
   631 +  </hbox>
       
   632 +  <panel id="customizeToolbarSheetPopup" noautohide="true">
       
   633 +    <iframe id="customizeToolbarSheetIFrame"
       
   634 +            style="&dialog.style;"
       
   635 +            hidden="true"/>
       
   636 +  </panel>
       
   637 +
       
   638 +  <vbox id="browser-bottombox">
       
   639 +    <findbar browserid="content" id="FindToolbar"/>
       
   640 +  
       
   641 +    <statusbar class="chromeclass-status" id="status-bar"
       
   642 +#ifdef WINCE
       
   643 +               hidden="true"
       
   644 +#endif
       
   645 +               ondrop="contentAreaDNDObserver.onDrop(event)">
       
   646 +      <statusbarpanel id="statusbar-display" label="" flex="1"/>
       
   647 +      <statusbarpanel class="statusbarpanel-progress" collapsed="true" id="statusbar-progresspanel">
       
   648 +        <progressmeter class="progressmeter-statusbar" id="statusbar-icon" mode="normal" value="0"/>
       
   649 +      </statusbarpanel>
       
   650 +      <statusbarpanel id="download-monitor" class="statusbarpanel-iconic-text"
       
   651 +                      tooltiptext="&downloadMonitor2.tooltip;" hidden="true"
       
   652 +                      command="Tools:Downloads"/>
       
   653 +      <statusbarpanel id="security-button" class="statusbarpanel-iconic"
       
   654 +                      hidden="true"
       
   655 +                      onclick="if (event.button == 0 &amp;&amp; event.detail == 1) displaySecurityInfo();"/>
       
   656 +      <statusbarpanel id="page-report-button" type="menu"
       
   657 +                      class="statusbarpanel-menu-iconic"
       
   658 +                      hidden="true"
       
   659 +                      tooltiptext="&pageReportIcon.tooltip;">
       
   660 +        <menupopup onpopupshowing="gPopupBlockerObserver.fillPopupList(event);">
       
   661 +          <menuitem observes="blockedPopupAllowSite"/>
       
   662 +          <menuitem observes="blockedPopupEditSettings"/>
       
   663 +          <menuitem observes="blockedPopupDontShowMessage"/>
       
   664 +          <menuseparator observes="blockedPopupsSeparator"/>
       
   665 +        </menupopup>
       
   666 +      </statusbarpanel>
       
   667 +    </statusbar>
       
   668 +  </vbox>
       
   669 +</window>
       
   670 diff --git a/browser/base/jar.mn b/browser/base/jar.mn
       
   671 --- a/browser/base/jar.mn
       
   672 +++ b/browser/base/jar.mn
       
   673 @@ -17,16 +17,18 @@ browser.jar:
       
   674          content/browser/aboutRobots-icon.png          (content/aboutRobots-icon.png)
       
   675          content/browser/aboutRobots-icon-rtl.png      (content/aboutRobots-icon-rtl.png)
       
   676          content/browser/aboutRobots-widget-left.png   (content/aboutRobots-widget-left.png)
       
   677          content/browser/aboutRobots-widget-right.png  (content/aboutRobots-widget-right.png)
       
   678  *       content/browser/aboutSupport.xhtml            (content/aboutSupport.xhtml)
       
   679  *       content/browser/browser.css                   (content/browser.css)
       
   680  *       content/browser/browser.js                    (content/browser.js)
       
   681  *       content/browser/browser.xul                   (content/browser.xul)
       
   682 +*       content/browser/browser-kde.xul               (content/browser-kde.xul)
       
   683 +%       override chrome://browser/content/browser.xul chrome://browser/content/browser-kde.xul desktop=kde
       
   684  *       content/browser/browser-tabPreviews.xml       (content/browser-tabPreviews.xml)
       
   685  *       content/browser/credits.xhtml                 (content/credits.xhtml)
       
   686  *       content/browser/fullscreen-video.xhtml        (content/fullscreen-video.xhtml)
       
   687  *       content/browser/pageinfo/pageInfo.xul         (content/pageinfo/pageInfo.xul)
       
   688  *       content/browser/pageinfo/pageInfo.js          (content/pageinfo/pageInfo.js)
       
   689  *       content/browser/pageinfo/pageInfo.css         (content/pageinfo/pageInfo.css)
       
   690  *       content/browser/pageinfo/feeds.js             (content/pageinfo/feeds.js)
       
   691  *       content/browser/pageinfo/feeds.xml            (content/pageinfo/feeds.xml)
       
   692 diff --git a/browser/components/build/nsModule.cpp b/browser/components/build/nsModule.cpp
       
   693 --- a/browser/components/build/nsModule.cpp
       
   694 +++ b/browser/components/build/nsModule.cpp
       
   695 @@ -41,17 +41,17 @@
       
   696  #include "nsBrowserCompsCID.h"
       
   697  #include "nsPlacesImportExportService.h"
       
   698  
       
   699  #if defined(XP_WIN)
       
   700  #include "nsWindowsShellService.h"
       
   701  #elif defined(XP_MACOSX)
       
   702  #include "nsMacShellService.h"
       
   703  #elif defined(MOZ_WIDGET_GTK2)
       
   704 -#include "nsGNOMEShellService.h"
       
   705 +#include "nsUnixShellService.h"
       
   706  #endif
       
   707  
       
   708  #ifndef WINCE
       
   709  
       
   710  #include "nsProfileMigrator.h"
       
   711  #if !defined(XP_BEOS)
       
   712  #include "nsDogbertProfileMigrator.h"
       
   713  #endif
       
   714 @@ -85,17 +85,18 @@ using namespace mozilla::browser;
       
   715  /////////////////////////////////////////////////////////////////////////////
       
   716  
       
   717  NS_GENERIC_FACTORY_CONSTRUCTOR(nsPlacesImportExportService)
       
   718  #if defined(XP_WIN)
       
   719  NS_GENERIC_FACTORY_CONSTRUCTOR(nsWindowsShellService)
       
   720  #elif defined(XP_MACOSX)
       
   721  NS_GENERIC_FACTORY_CONSTRUCTOR(nsMacShellService)
       
   722  #elif defined(MOZ_WIDGET_GTK2)
       
   723 -NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
       
   724 +// in nsUnixShellService
       
   725 +//NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsUnixShellService, Init)
       
   726  #endif
       
   727  
       
   728  #ifndef WINCE
       
   729  
       
   730  #if !defined(XP_BEOS)
       
   731  NS_GENERIC_FACTORY_CONSTRUCTOR(nsDogbertProfileMigrator)
       
   732  #endif
       
   733  #if !defined(XP_OS2)
       
   734 @@ -129,17 +130,17 @@ static const nsModuleComponentInfo compo
       
   735      NS_SHELLSERVICE_CID,
       
   736      NS_SHELLSERVICE_CONTRACTID,
       
   737      nsWindowsShellServiceConstructor},
       
   738  
       
   739  #elif defined(MOZ_WIDGET_GTK2)
       
   740    { "Browser Shell Service",
       
   741      NS_SHELLSERVICE_CID,
       
   742      NS_SHELLSERVICE_CONTRACTID,
       
   743 -    nsGNOMEShellServiceConstructor },
       
   744 +    nsUnixShellServiceConstructor },
       
   745  
       
   746  #endif
       
   747  
       
   748  
       
   749    { "Places Import/Export Service",
       
   750      NS_PLACESIMPORTEXPORTSERVICE_CID,
       
   751      NS_PLACESIMPORTEXPORTSERVICE_CONTRACTID,
       
   752      nsPlacesImportExportServiceConstructor},
       
   753 diff --git a/browser/components/shell/src/Makefile.in b/browser/components/shell/src/Makefile.in
       
   754 --- a/browser/components/shell/src/Makefile.in
       
   755 +++ b/browser/components/shell/src/Makefile.in
       
   756 @@ -70,21 +70,22 @@ CPPSRCS = nsWindowsShellService.cpp
       
   757  REQUIRES	+= \
       
   758  		browsercomps \
       
   759  		$(NULL)
       
   760  else
       
   761  ifneq (,$(filter mac cocoa,$(MOZ_WIDGET_TOOLKIT)))
       
   762  CPPSRCS = nsMacShellService.cpp
       
   763  else
       
   764  ifeq ($(MOZ_WIDGET_TOOLKIT), gtk2)
       
   765 -CPPSRCS = nsGNOMEShellService.cpp
       
   766 +CPPSRCS = nsUnixShellService.cpp nsGNOMEShellService.cpp nsKDEShellService.cpp
       
   767  REQUIRES	+= \
       
   768  		mozgnome \
       
   769  		thebes \
       
   770  		$(NULL)
       
   771 +LOCAL_INCLUDES += -I$(topsrcdir)/toolkit/xre
       
   772  endif
       
   773  endif
       
   774  endif
       
   775  
       
   776  ifdef CPPSRCS
       
   777  LIBRARY_NAME = shellservice_s
       
   778  endif
       
   779  
       
   780 diff --git a/browser/components/shell/src/nsKDEShellService.cpp b/browser/components/shell/src/nsKDEShellService.cpp
       
   781 new file mode 100644
       
   782 --- /dev/null
       
   783 +++ b/browser/components/shell/src/nsKDEShellService.cpp
       
   784 @@ -0,0 +1,193 @@
       
   785 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       
   786 +/* ***** BEGIN LICENSE BLOCK *****
       
   787 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
   788 + *
       
   789 + * The contents of this file are subject to the Mozilla Public License Version
       
   790 + * 1.1 (the "License"); you may not use this file except in compliance with
       
   791 + * the License. You may obtain a copy of the License at
       
   792 + * http://www.mozilla.org/MPL/
       
   793 + *
       
   794 + * Software distributed under the License is distributed on an "AS IS" basis,
       
   795 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
   796 + * for the specific language governing rights and limitations under the
       
   797 + * License.
       
   798 + *
       
   799 + * The Original Code is Shell Service.
       
   800 + *
       
   801 + * The Initial Developer of the Original Code is mozilla.org.
       
   802 + * Portions created by the Initial Developer are Copyright (C) 2004
       
   803 + * the Initial Developer. All Rights Reserved.
       
   804 + *
       
   805 + * Contributor(s):
       
   806 + *
       
   807 + * Alternatively, the contents of this file may be used under the terms of
       
   808 + * either the GNU General Public License Version 2 or later (the "GPL"), or
       
   809 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
   810 + * in which case the provisions of the GPL or the LGPL are applicable instead
       
   811 + * of those above. If you wish to allow use of your version of this file only
       
   812 + * under the terms of either the GPL or the LGPL, and not to allow others to
       
   813 + * use your version of this file under the terms of the MPL, indicate your
       
   814 + * decision by deleting the provisions above and replace them with the notice
       
   815 + * and other provisions required by the GPL or the LGPL. If you do not delete
       
   816 + * the provisions above, a recipient may use your version of this file under
       
   817 + * the terms of any one of the MPL, the GPL or the LGPL.
       
   818 + *
       
   819 + * ***** END LICENSE BLOCK ***** */
       
   820 +
       
   821 +#include "nsKDEShellService.h"
       
   822 +#include "nsShellService.h"
       
   823 +#include "nsKDEUtils.h"
       
   824 +#include "nsCOMPtr.h"
       
   825 +#include "nsIPrefService.h"
       
   826 +#include "nsIProcess.h"
       
   827 +#include "nsILocalFile.h"
       
   828 +#include "nsServiceManagerUtils.h"
       
   829 +#include "nsComponentManagerUtils.h"
       
   830 +
       
   831 +nsresult
       
   832 +nsKDEShellService::Init()
       
   833 +    {
       
   834 +    if( !nsKDEUtils::kdeSupport())
       
   835 +        return NS_ERROR_NOT_AVAILABLE;
       
   836 +    return NS_OK;
       
   837 +    }
       
   838 +
       
   839 +NS_IMPL_ISUPPORTS1(nsKDEShellService, nsIShellService)
       
   840 +
       
   841 +NS_IMETHODIMP
       
   842 +nsKDEShellService::IsDefaultBrowser(PRBool aStartupCheck,
       
   843 +                                      PRBool* aIsDefaultBrowser)
       
   844 +    {
       
   845 +    *aIsDefaultBrowser = PR_FALSE;
       
   846 +    if (aStartupCheck)
       
   847 +        mCheckedThisSession = PR_TRUE;
       
   848 +    nsCStringArray command;
       
   849 +    command.AppendCString( NS_LITERAL_CSTRING( "ISDEFAULTBROWSER" ));
       
   850 +    if( nsKDEUtils::command( command ))
       
   851 +        *aIsDefaultBrowser = PR_TRUE;
       
   852 +    return NS_OK;
       
   853 +    }
       
   854 +
       
   855 +NS_IMETHODIMP
       
   856 +nsKDEShellService::SetDefaultBrowser(PRBool aClaimAllTypes,
       
   857 +                                       PRBool aForAllUsers)
       
   858 +    {
       
   859 +    nsCStringArray command;
       
   860 +    command.AppendCString( NS_LITERAL_CSTRING( "SETDEFAULTBROWSER" ));
       
   861 +    command.AppendCString( aClaimAllTypes ? NS_LITERAL_CSTRING( "ALLTYPES" ) : NS_LITERAL_CSTRING( "NORMAL" ));
       
   862 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
   863 +    }
       
   864 +
       
   865 +NS_IMETHODIMP
       
   866 +nsKDEShellService::GetShouldCheckDefaultBrowser(PRBool* aResult)
       
   867 +{
       
   868 +  // If we've already checked, the browser has been started and this is a 
       
   869 +  // new window open, and we don't want to check again.
       
   870 +  if (mCheckedThisSession) {
       
   871 +    *aResult = PR_FALSE;
       
   872 +    return NS_OK;
       
   873 +  }
       
   874 +
       
   875 +  nsCOMPtr<nsIPrefBranch> prefs;
       
   876 +  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
       
   877 +  if (pserve)
       
   878 +    pserve->GetBranch("", getter_AddRefs(prefs));
       
   879 +
       
   880 +  if (prefs)
       
   881 +    prefs->GetBoolPref(PREF_CHECKDEFAULTBROWSER, aResult);
       
   882 +
       
   883 +  return NS_OK;
       
   884 +}
       
   885 +
       
   886 +NS_IMETHODIMP
       
   887 +nsKDEShellService::SetShouldCheckDefaultBrowser(PRBool aShouldCheck)
       
   888 +{
       
   889 +  nsCOMPtr<nsIPrefBranch> prefs;
       
   890 +  nsCOMPtr<nsIPrefService> pserve(do_GetService(NS_PREFSERVICE_CONTRACTID));
       
   891 +  if (pserve)
       
   892 +    pserve->GetBranch("", getter_AddRefs(prefs));
       
   893 +
       
   894 +  if (prefs)
       
   895 +    prefs->SetBoolPref(PREF_CHECKDEFAULTBROWSER, aShouldCheck);
       
   896 +
       
   897 +  return NS_OK;
       
   898 +}
       
   899 +
       
   900 +NS_IMETHODIMP
       
   901 +nsKDEShellService::SetDesktopBackground(nsIDOMElement* aElement, 
       
   902 +                                          PRInt32 aPosition)
       
   903 +    {
       
   904 +    return NS_ERROR_NOT_IMPLEMENTED;
       
   905 +    }
       
   906 +
       
   907 +NS_IMETHODIMP
       
   908 +nsKDEShellService::GetDesktopBackgroundColor(PRUint32 *aColor)
       
   909 +    {
       
   910 +    return NS_ERROR_NOT_IMPLEMENTED;
       
   911 +    }
       
   912 +
       
   913 +NS_IMETHODIMP
       
   914 +nsKDEShellService::SetDesktopBackgroundColor(PRUint32 aColor)
       
   915 +    {
       
   916 +    return NS_ERROR_NOT_IMPLEMENTED;
       
   917 +    }
       
   918 +
       
   919 +NS_IMETHODIMP
       
   920 +nsKDEShellService::OpenApplication(PRInt32 aApplication)
       
   921 +    {
       
   922 +    nsCStringArray command;
       
   923 +    if( aApplication == APPLICATION_MAIL )
       
   924 +        command.AppendCString( NS_LITERAL_CSTRING( "OPENMAIL" ));
       
   925 +    else if( aApplication == APPLICATION_NEWS )
       
   926 +        command.AppendCString( NS_LITERAL_CSTRING( "OPENNEWS" ));
       
   927 +    else
       
   928 +        return NS_ERROR_NOT_IMPLEMENTED;
       
   929 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
   930 +    }
       
   931 +
       
   932 +NS_IMETHODIMP
       
   933 +nsKDEShellService::OpenApplicationWithURI(nsILocalFile* aApplication, const nsACString& aURI)
       
   934 +    {
       
   935 +    nsCStringArray command;
       
   936 +    command.AppendCString( NS_LITERAL_CSTRING( "RUN" ));
       
   937 +    nsCString app;
       
   938 +    nsresult rv = aApplication->GetNativePath( app );
       
   939 +    NS_ENSURE_SUCCESS( rv, rv );
       
   940 +    command.AppendCString( app );
       
   941 +    command.AppendCString( aURI );
       
   942 +    return nsKDEUtils::command( command ) ? NS_OK : NS_ERROR_FAILURE;
       
   943 +    }
       
   944 +
       
   945 +NS_IMETHODIMP
       
   946 +nsKDEShellService::GetDefaultFeedReader(nsILocalFile** _retval)
       
   947 +    {
       
   948 +    *_retval = nsnull;
       
   949 +
       
   950 +    nsCStringArray command;
       
   951 +    command.AppendCString( NS_LITERAL_CSTRING( "GETDEFAULTFEEDREADER" ));
       
   952 +    nsCStringArray output;
       
   953 +    if( !nsKDEUtils::command( command, &output ) || output.Count() != 1 )
       
   954 +        return NS_ERROR_FAILURE;
       
   955 +
       
   956 +    nsCString path;
       
   957 +    path = *output[ 0 ];
       
   958 +    if (path.IsEmpty())
       
   959 +        return NS_ERROR_FAILURE;
       
   960 +
       
   961 +    nsresult rv;
       
   962 +    nsCOMPtr<nsILocalFile> defaultReader =
       
   963 +        do_CreateInstance("@mozilla.org/file/local;1", &rv);
       
   964 +    NS_ENSURE_SUCCESS(rv, rv);
       
   965 +
       
   966 +    rv = defaultReader->InitWithNativePath(path);
       
   967 +    NS_ENSURE_SUCCESS(rv, rv);
       
   968 +
       
   969 +    PRBool exists;
       
   970 +    rv = defaultReader->Exists(&exists);
       
   971 +    NS_ENSURE_SUCCESS(rv, rv);
       
   972 +    if (!exists)
       
   973 +        return NS_ERROR_FAILURE;
       
   974 +
       
   975 +    NS_ADDREF(*_retval = defaultReader);
       
   976 +    return NS_OK;
       
   977 +    }
       
   978 diff --git a/browser/components/shell/src/nsKDEShellService.h b/browser/components/shell/src/nsKDEShellService.h
       
   979 new file mode 100644
       
   980 --- /dev/null
       
   981 +++ b/browser/components/shell/src/nsKDEShellService.h
       
   982 @@ -0,0 +1,59 @@
       
   983 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       
   984 +/* ***** BEGIN LICENSE BLOCK *****
       
   985 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
   986 + *
       
   987 + * The contents of this file are subject to the Mozilla Public License Version
       
   988 + * 1.1 (the "License"); you may not use this file except in compliance with
       
   989 + * the License. You may obtain a copy of the License at
       
   990 + * http://www.mozilla.org/MPL/
       
   991 + *
       
   992 + * Software distributed under the License is distributed on an "AS IS" basis,
       
   993 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
   994 + * for the specific language governing rights and limitations under the
       
   995 + * License.
       
   996 + *
       
   997 + * The Original Code is Shell Service.
       
   998 + *
       
   999 + * The Initial Developer of the Original Code is mozilla.org.
       
  1000 + * Portions created by the Initial Developer are Copyright (C) 2004
       
  1001 + * the Initial Developer. All Rights Reserved.
       
  1002 + *
       
  1003 + * Contributor(s):
       
  1004 + *
       
  1005 + * Alternatively, the contents of this file may be used under the terms of
       
  1006 + * either the GNU General Public License Version 2 or later (the "GPL"), or
       
  1007 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
  1008 + * in which case the provisions of the GPL or the LGPL are applicable instead
       
  1009 + * of those above. If you wish to allow use of your version of this file only
       
  1010 + * under the terms of either the GPL or the LGPL, and not to allow others to
       
  1011 + * use your version of this file under the terms of the MPL, indicate your
       
  1012 + * decision by deleting the provisions above and replace them with the notice
       
  1013 + * and other provisions required by the GPL or the LGPL. If you do not delete
       
  1014 + * the provisions above, a recipient may use your version of this file under
       
  1015 + * the terms of any one of the MPL, the GPL or the LGPL.
       
  1016 + *
       
  1017 + * ***** END LICENSE BLOCK ***** */
       
  1018 +
       
  1019 +#ifndef nskdeshellservice_h____
       
  1020 +#define nskdeshellservice_h____
       
  1021 +
       
  1022 +#include "nsIShellService.h"
       
  1023 +#include "nsStringAPI.h"
       
  1024 +
       
  1025 +class nsKDEShellService : public nsIShellService
       
  1026 +{
       
  1027 +public:
       
  1028 +  nsKDEShellService() : mCheckedThisSession(PR_FALSE) { }
       
  1029 +
       
  1030 +  NS_DECL_ISUPPORTS
       
  1031 +  NS_DECL_NSISHELLSERVICE
       
  1032 +
       
  1033 +  nsresult Init() NS_HIDDEN;
       
  1034 +
       
  1035 +private:
       
  1036 +  ~nsKDEShellService() {}
       
  1037 +
       
  1038 +  PRPackedBool mCheckedThisSession;
       
  1039 +};
       
  1040 +
       
  1041 +#endif // nskdeshellservice_h____
       
  1042 diff --git a/browser/components/shell/src/nsUnixShellService.cpp b/browser/components/shell/src/nsUnixShellService.cpp
       
  1043 new file mode 100644
       
  1044 --- /dev/null
       
  1045 +++ b/browser/components/shell/src/nsUnixShellService.cpp
       
  1046 @@ -0,0 +1,52 @@
       
  1047 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       
  1048 +/* ***** BEGIN LICENSE BLOCK *****
       
  1049 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
  1050 + *
       
  1051 + * The contents of this file are subject to the Mozilla Public License Version
       
  1052 + * 1.1 (the "License"); you may not use this file except in compliance with
       
  1053 + * the License. You may obtain a copy of the License at
       
  1054 + * http://www.mozilla.org/MPL/
       
  1055 + *
       
  1056 + * Software distributed under the License is distributed on an "AS IS" basis,
       
  1057 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
  1058 + * for the specific language governing rights and limitations under the
       
  1059 + * License.
       
  1060 + *
       
  1061 + * The Original Code is Shell Service.
       
  1062 + *
       
  1063 + * The Initial Developer of the Original Code is mozilla.org.
       
  1064 + * Portions created by the Initial Developer are Copyright (C) 2004
       
  1065 + * the Initial Developer. All Rights Reserved.
       
  1066 + *
       
  1067 + * Contributor(s):
       
  1068 + *
       
  1069 + * Alternatively, the contents of this file may be used under the terms of
       
  1070 + * either the GNU General Public License Version 2 or later (the "GPL"), or
       
  1071 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
  1072 + * in which case the provisions of the GPL or the LGPL are applicable instead
       
  1073 + * of those above. If you wish to allow use of your version of this file only
       
  1074 + * under the terms of either the GPL or the LGPL, and not to allow others to
       
  1075 + * use your version of this file under the terms of the MPL, indicate your
       
  1076 + * decision by deleting the provisions above and replace them with the notice
       
  1077 + * and other provisions required by the GPL or the LGPL. If you do not delete
       
  1078 + * the provisions above, a recipient may use your version of this file under
       
  1079 + * the terms of any one of the MPL, the GPL or the LGPL.
       
  1080 + *
       
  1081 + * ***** END LICENSE BLOCK ***** */
       
  1082 +
       
  1083 +#include "nsUnixShellService.h"
       
  1084 +#include "nsGNOMEShellService.h"
       
  1085 +#include "nsKDEShellService.h"
       
  1086 +#include "nsKDEUtils.h"
       
  1087 +#include "nsIGenericFactory.h"
       
  1088 +
       
  1089 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsGNOMEShellService, Init)
       
  1090 +NS_GENERIC_FACTORY_CONSTRUCTOR_INIT(nsKDEShellService, Init)
       
  1091 +
       
  1092 +NS_METHOD
       
  1093 +nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult)
       
  1094 +{
       
  1095 +    if( nsKDEUtils::kdeSupport())
       
  1096 +        return nsKDEShellServiceConstructor( aOuter, aIID, aResult );
       
  1097 +    return nsGNOMEShellServiceConstructor( aOuter, aIID, aResult );
       
  1098 +}
       
  1099 diff --git a/browser/components/shell/src/nsUnixShellService.h b/browser/components/shell/src/nsUnixShellService.h
       
  1100 new file mode 100644
       
  1101 --- /dev/null
       
  1102 +++ b/browser/components/shell/src/nsUnixShellService.h
       
  1103 @@ -0,0 +1,45 @@
       
  1104 +/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
       
  1105 +/* ***** BEGIN LICENSE BLOCK *****
       
  1106 + * Version: MPL 1.1/GPL 2.0/LGPL 2.1
       
  1107 + *
       
  1108 + * The contents of this file are subject to the Mozilla Public License Version
       
  1109 + * 1.1 (the "License"); you may not use this file except in compliance with
       
  1110 + * the License. You may obtain a copy of the License at
       
  1111 + * http://www.mozilla.org/MPL/
       
  1112 + *
       
  1113 + * Software distributed under the License is distributed on an "AS IS" basis,
       
  1114 + * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
       
  1115 + * for the specific language governing rights and limitations under the
       
  1116 + * License.
       
  1117 + *
       
  1118 + * The Original Code is Shell Service.
       
  1119 + *
       
  1120 + * The Initial Developer of the Original Code is mozilla.org.
       
  1121 + * Portions created by the Initial Developer are Copyright (C) 2004
       
  1122 + * the Initial Developer. All Rights Reserved.
       
  1123 + *
       
  1124 + * Contributor(s):
       
  1125 + *
       
  1126 + * Alternatively, the contents of this file may be used under the terms of
       
  1127 + * either the GNU General Public License Version 2 or later (the "GPL"), or
       
  1128 + * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
       
  1129 + * in which case the provisions of the GPL or the LGPL are applicable instead
       
  1130 + * of those above. If you wish to allow use of your version of this file only
       
  1131 + * under the terms of either the GPL or the LGPL, and not to allow others to
       
  1132 + * use your version of this file under the terms of the MPL, indicate your
       
  1133 + * decision by deleting the provisions above and replace them with the notice
       
  1134 + * and other provisions required by the GPL or the LGPL. If you do not delete
       
  1135 + * the provisions above, a recipient may use your version of this file under
       
  1136 + * the terms of any one of the MPL, the GPL or the LGPL.
       
  1137 + *
       
  1138 + * ***** END LICENSE BLOCK ***** */
       
  1139 +
       
  1140 +#ifndef nsunixshellservice_h____
       
  1141 +#define nsunixshellservice_h____
       
  1142 +
       
  1143 +#include "nsIShellService.h"
       
  1144 +
       
  1145 +NS_METHOD
       
  1146 +nsUnixShellServiceConstructor(nsISupports *aOuter, REFNSIID aIID, void **aResult);
       
  1147 +
       
  1148 +#endif // nsunixshellservice_h____