Merge lp:~ken-vandine/chromium-browser/chromium-browser.quantal into lp:~chromium-team/chromium-browser/chromium-browser.quantal
- chromium-browser.quantal
- Merge into chromium-browser.quantal
Status: | Merged | ||||
---|---|---|---|---|---|
Merged at revision: | 747 | ||||
Proposed branch: | lp:~ken-vandine/chromium-browser/chromium-browser.quantal | ||||
Merge into: | lp:~chromium-team/chromium-browser/chromium-browser.quantal | ||||
Diff against target: |
2850 lines (+2555/-102) 15 files modified
debian/apport/chromium-browser.py (+9/-8) debian/changelog (+64/-0) debian/control (+6/-2) debian/patches/1-infobars.patch (+193/-0) debian/patches/2-get-domain-tld.patch (+255/-0) debian/patches/3-chrome-xid.patch (+38/-0) debian/patches/arm.patch (+50/-0) debian/patches/chromeless-window-launch-option.patch (+860/-0) debian/patches/desktop-integration-settings.patch (+1031/-0) debian/patches/dlopen_sonamed_gl.patch (+3/-16) debian/patches/fix-armhf-ftbfs.patch (+3/-27) debian/patches/grd_parse_fix.patch (+12/-0) debian/patches/series (+7/-2) debian/patches/ubuntu_dont_overwrite_default_download_directory.patch (+0/-47) debian/rules (+24/-0) |
||||
To merge this branch: | bzr merge lp:~ken-vandine/chromium-browser/chromium-browser.quantal | ||||
Related bugs: |
|
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Chromium team | Pending | ||
Review via email: mp+113785@code.launchpad.net |
Commit message
Description of the change
Force building with gcc 4.6 to at least get a build into quantal and fix ftbfs (LP: #992212)
- 737. By Ken VanDine
-
* New upstream release from the Stable Channel
* debian/control
- Added build depends binutils-gold, libssl-dev and subversion
* -debian/patches/ ubuntu_ dont_overwrite_ default_ download_ directory. patch
- no longer needed
* debian/rules
- force to build with gcc 4.6 to fix ftbfs (LP: #992212)
- don't build with -Werror
* debian/control
- add build depends for g++-4.6-multilib - 738. By Ken VanDine
-
* debian/
patches/ grd_parse_ fix.patch
- Patched to fix broken XML until we can get a proper fix for
chromium-translation- tools. - 739. By Ken VanDine
-
Bumped standards version to 3.9.3
- 740. By Ken VanDine
-
merged
- 741. By Ken VanDine
-
* debian/rules
- explicitly set arm_float_abi=hard for armhf builds and let the rest
fallback to softfp
- do not use third_party/gold as the linker.
- enable compile-time dependency on gnome-keyring
* debian/patches/ vpx.patch
- patch from debian to fix FTBFS on armel
* debian/patches/ arm.patch
- patch from debian to fix FTBFS on armel - 742. By Ken VanDine
-
Added build depends binutils-gold, libvpx-
dev,libssl- dev and subversion - 743. By Ken VanDine
-
don't build depend on binutils-gold for armel
- 744. By Ken VanDine
-
releasing version 20.0.1132.
47~r144678- 0ubuntu1 - 745. By Ken VanDine
-
* debian/control
- Dropped build depends for libvpx-dev
* debian/apport:
- Update apport hook for python3 (LP: #1013171)
patch made with the help of Edward Donovan - 746. By Ken VanDine
-
releasing version 20.0.1132.
47~r144678- 0ubuntu2 - 747. By Ken VanDine
-
releasing version 20.0.1132.
47~r144678- 0ubuntu3
Preview Diff
1 | === modified file 'debian/apport/chromium-browser.py' | |||
2 | --- debian/apport/chromium-browser.py 2011-05-09 17:41:33 +0000 | |||
3 | +++ debian/apport/chromium-browser.py 2012-08-06 17:52:22 +0000 | |||
4 | @@ -11,6 +11,7 @@ | |||
5 | 11 | the full text of the license. | 11 | the full text of the license. |
6 | 12 | ''' | 12 | ''' |
7 | 13 | 13 | ||
8 | 14 | from __future__ import print_function | ||
9 | 14 | import os, sys, getopt, codecs | 15 | import os, sys, getopt, codecs |
10 | 15 | import time | 16 | import time |
11 | 16 | from stat import * | 17 | from stat import * |
12 | @@ -57,7 +58,7 @@ | |||
13 | 57 | report['RelatedPackagesPolicy'] = '' | 58 | report['RelatedPackagesPolicy'] = '' |
14 | 58 | for pkg in pkgs: | 59 | for pkg in pkgs: |
15 | 59 | script = subprocess.Popen(['apt-cache', 'policy', pkg], stdout=subprocess.PIPE) | 60 | script = subprocess.Popen(['apt-cache', 'policy', pkg], stdout=subprocess.PIPE) |
17 | 60 | report['RelatedPackagesPolicy'] += script.communicate()[0] + "\n" | 61 | report['RelatedPackagesPolicy'] += str(script.communicate()[0]) + "\n" |
18 | 61 | 62 | ||
19 | 62 | def gconf_values(report, keys): | 63 | def gconf_values(report, keys): |
20 | 63 | report['gconf-keys'] = '' | 64 | report['gconf-keys'] = '' |
21 | @@ -67,7 +68,7 @@ | |||
22 | 67 | except OSError: | 68 | except OSError: |
23 | 68 | report['gconf-keys'] = "gconftool-2 not found" | 69 | report['gconf-keys'] = "gconftool-2 not found" |
24 | 69 | return | 70 | return |
26 | 70 | out = script.communicate()[0] | 71 | out = str(script.communicate()[0]) |
27 | 71 | if out == "": | 72 | if out == "": |
28 | 72 | out = "**unset**\n" | 73 | out = "**unset**\n" |
29 | 73 | report['gconf-keys'] += key + " = " + out | 74 | report['gconf-keys'] += key + " = " + out |
30 | @@ -105,7 +106,7 @@ | |||
31 | 105 | # list entensions+versions | 106 | # list entensions+versions |
32 | 106 | report['ChromiumPrefs'] += "extensions/settings =\n" | 107 | report['ChromiumPrefs'] += "extensions/settings =\n" |
33 | 107 | if 'settings' in entry['extensions']: | 108 | if 'settings' in entry['extensions']: |
35 | 108 | for ext in entry['extensions']['settings'].keys(): | 109 | for ext in list(entry['extensions']['settings'].keys()): |
36 | 109 | report['ChromiumPrefs'] += " - '" + ext + "'\n" | 110 | report['ChromiumPrefs'] += " - '" + ext + "'\n" |
37 | 110 | if 'manifest' in entry['extensions']['settings'][ext]: | 111 | if 'manifest' in entry['extensions']['settings'][ext]: |
38 | 111 | for k in [ 'name', 'description', 'version', 'update_url' ]: | 112 | for k in [ 'name', 'description', 'version', 'update_url' ]: |
39 | @@ -243,17 +244,17 @@ | |||
40 | 243 | 244 | ||
41 | 244 | # Disk usage | 245 | # Disk usage |
42 | 245 | script = subprocess.Popen([ 'df', '-Th' ], stdout=subprocess.PIPE) | 246 | script = subprocess.Popen([ 'df', '-Th' ], stdout=subprocess.PIPE) |
44 | 246 | report['DiskUsage'] = script.communicate()[0] + "\n\nInodes:\n" | 247 | report['DiskUsage'] = str(script.communicate()[0]) + "\n\nInodes:\n" |
45 | 247 | script = subprocess.Popen([ 'df', '-ih' ], stdout=subprocess.PIPE) | 248 | script = subprocess.Popen([ 'df', '-ih' ], stdout=subprocess.PIPE) |
47 | 248 | report['DiskUsage'] += script.communicate()[0] | 249 | report['DiskUsage'] += str(script.communicate()[0]) |
48 | 249 | 250 | ||
49 | 250 | ## DEBUGING ## | 251 | ## DEBUGING ## |
50 | 251 | if __name__ == '__main__': | 252 | if __name__ == '__main__': |
51 | 252 | sys.stdout = codecs.getwriter('utf8')(sys.stdout) | 253 | sys.stdout = codecs.getwriter('utf8')(sys.stdout) |
52 | 253 | try: | 254 | try: |
53 | 254 | opts, args = getopt.getopt(sys.argv[1:], "-u:", [ 'user-dir=' ]) | 255 | opts, args = getopt.getopt(sys.argv[1:], "-u:", [ 'user-dir=' ]) |
56 | 255 | except getopt.GetoptError, err: | 256 | except getopt.GetoptError as err: |
57 | 256 | print str(err) | 257 | print(str(err)) |
58 | 257 | sys.exit(2) | 258 | sys.exit(2) |
59 | 258 | 259 | ||
60 | 259 | userdir = None | 260 | userdir = None |
61 | @@ -266,4 +267,4 @@ | |||
62 | 266 | report = {} | 267 | report = {} |
63 | 267 | add_info(report, userdir = userdir) | 268 | add_info(report, userdir = userdir) |
64 | 268 | for key in report: | 269 | for key in report: |
66 | 269 | print '[%s]\n%s\n' % (key, report[key]) | 270 | print('[%s]\n%s\n' % (key, report[key])) |
67 | 270 | 271 | ||
68 | === modified file 'debian/changelog' | |||
69 | --- debian/changelog 2012-06-18 16:37:20 +0000 | |||
70 | +++ debian/changelog 2012-08-06 17:52:22 +0000 | |||
71 | @@ -1,3 +1,67 @@ | |||
72 | 1 | chromium-browser (20.0.1132.47~r144678-0ubuntu3) quantal; urgency=low | ||
73 | 2 | |||
74 | 3 | * debian/patches/1-infobars.patch | ||
75 | 4 | - moved infobars out of experimental, used for webapps | ||
76 | 5 | * debian/patches/2-get-domain-tld.patch | ||
77 | 6 | - Adds API for getting the base domain of a URI, used for webapps | ||
78 | 7 | * debian/patches/3-chrome-xid.patch | ||
79 | 8 | - Get xid, used for webapps | ||
80 | 9 | * debian/patches/chromeless-window-launch-option.patch | ||
81 | 10 | - Adds optional chromeless mode, used for webapps | ||
82 | 11 | * debian/patches/desktop-integration-settings.patch | ||
83 | 12 | - Adds settings for managing sites integrated with the desktop, used | ||
84 | 13 | for webapps | ||
85 | 14 | |||
86 | 15 | -- Ken VanDine <ken.vandine@canonical.com> Mon, 06 Aug 2012 13:40:57 -0400 | ||
87 | 16 | |||
88 | 17 | chromium-browser (20.0.1132.47~r144678-0ubuntu2) quantal; urgency=low | ||
89 | 18 | |||
90 | 19 | * debian/control | ||
91 | 20 | - Dropped build depends for libvpx-dev | ||
92 | 21 | * -debian/patches/vpx.patch | ||
93 | 22 | - dropped, build with internal vpx | ||
94 | 23 | |||
95 | 24 | [ Matthieu Baerts ] | ||
96 | 25 | * debian/apport: | ||
97 | 26 | - Update apport hook for python3 (LP: #1013171) | ||
98 | 27 | patch made with the help of Edward Donovan | ||
99 | 28 | |||
100 | 29 | -- Ken VanDine <ken.vandine@canonical.com> Thu, 12 Jul 2012 15:56:59 -0400 | ||
101 | 30 | |||
102 | 31 | chromium-browser (20.0.1132.47~r144678-0ubuntu1) quantal; urgency=low | ||
103 | 32 | |||
104 | 33 | * New upstream release from the Stable Channel | ||
105 | 34 | * debian/control | ||
106 | 35 | - Added build depends binutils-gold, libvpx-dev,libssl-dev and subversion | ||
107 | 36 | - Bumped standards version to 3.9.3 | ||
108 | 37 | - don't build depend on binutils-gold for armel | ||
109 | 38 | * debian/rules | ||
110 | 39 | - explicitly set arm_float_abi=hard for armhf builds and let the rest | ||
111 | 40 | fallback to softfp | ||
112 | 41 | - do not use third_party/gold as the linker. | ||
113 | 42 | - enable compile-time dependency on gnome-keyring | ||
114 | 43 | * -debian/patches/ubuntu_dont_overwrite_default_download_directory.patch | ||
115 | 44 | - no longer needed | ||
116 | 45 | * debian/patches/grd_parse_fix.patch | ||
117 | 46 | - Patched to fix broken XML until we can get a proper fix for | ||
118 | 47 | chromium-translation-tools. | ||
119 | 48 | * debian/patches/vpx.patch | ||
120 | 49 | - patch from debian to fix FTBFS on armel | ||
121 | 50 | * debian/patches/arm.patch | ||
122 | 51 | - patch from debian to fix FTBFS on armel | ||
123 | 52 | |||
124 | 53 | -- Ken VanDine <ken.vandine@canonical.com> Thu, 12 Jul 2012 14:02:44 -0400 | ||
125 | 54 | |||
126 | 55 | chromium-browser (18.0.1025.168~r134367-0ubuntu2) quantal; urgency=low | ||
127 | 56 | |||
128 | 57 | * debian/rules | ||
129 | 58 | - force to build with gcc 4.6 to fix ftbfs (LP: #992212) | ||
130 | 59 | - don't build with -Werror | ||
131 | 60 | * debian/control | ||
132 | 61 | - add build depends for g++-4.6-multilib | ||
133 | 62 | |||
134 | 63 | -- Ken VanDine <ken.vandine@canonical.com> Fri, 06 Jul 2012 13:51:59 -0400 | ||
135 | 64 | |||
136 | 1 | chromium-browser (18.0.1025.168~r134367-0ubuntu1) quantal; urgency=low | 65 | chromium-browser (18.0.1025.168~r134367-0ubuntu1) quantal; urgency=low |
137 | 2 | 66 | ||
138 | 3 | * debian/rules | 67 | * debian/rules |
139 | 4 | 68 | ||
140 | === modified file 'debian/control' | |||
141 | --- debian/control 2012-03-30 08:38:01 +0000 | |||
142 | +++ debian/control 2012-08-06 17:52:22 +0000 | |||
143 | @@ -13,6 +13,8 @@ | |||
144 | 13 | patchutils (>= 0.2.25), | 13 | patchutils (>= 0.2.25), |
145 | 14 | libc6-dev-i386 [amd64], | 14 | libc6-dev-i386 [amd64], |
146 | 15 | g++-multilib [amd64], | 15 | g++-multilib [amd64], |
147 | 16 | g++-4.6-multilib, | ||
148 | 17 | binutils-gold [!armel], | ||
149 | 16 | hardening-wrapper, | 18 | hardening-wrapper, |
150 | 17 | python, | 19 | python, |
151 | 18 | bison, | 20 | bison, |
152 | @@ -48,8 +50,10 @@ | |||
153 | 48 | libdbus-glib-1-dev, | 50 | libdbus-glib-1-dev, |
154 | 49 | libgnome-keyring-dev, | 51 | libgnome-keyring-dev, |
155 | 50 | libudev-dev, | 52 | libudev-dev, |
158 | 51 | libgconf2-dev | 53 | libgconf2-dev, |
159 | 52 | Standards-Version: 3.8.3 | 54 | libssl-dev, |
160 | 55 | subversion | ||
161 | 56 | Standards-Version: 3.9.3 | ||
162 | 53 | 57 | ||
163 | 54 | Package: chromium-browser | 58 | Package: chromium-browser |
164 | 55 | Architecture: any | 59 | Architecture: any |
165 | 56 | 60 | ||
166 | === added file 'debian/patches/1-infobars.patch' | |||
167 | --- debian/patches/1-infobars.patch 1970-01-01 00:00:00 +0000 | |||
168 | +++ debian/patches/1-infobars.patch 2012-08-06 17:52:22 +0000 | |||
169 | @@ -0,0 +1,193 @@ | |||
170 | 1 | Index: src/chrome/browser/infobars/infobar_extension_apitest.cc | ||
171 | 2 | =================================================================== | ||
172 | 3 | --- src.orig/chrome/browser/infobars/infobar_extension_apitest.cc 2012-07-07 00:59:54.000000000 -0400 | ||
173 | 4 | +++ src/chrome/browser/infobars/infobar_extension_apitest.cc 2012-07-16 15:33:42.371644366 -0400 | ||
174 | 5 | @@ -15,9 +15,5 @@ | ||
175 | 6 | #endif | ||
176 | 7 | |||
177 | 8 | IN_PROC_BROWSER_TEST_F(ExtensionApiTest, DISABLED_Infobars) { | ||
178 | 9 | - // TODO(finnur): Remove once infobars are no longer experimental (bug 39511). | ||
179 | 10 | - CommandLine::ForCurrentProcess()->AppendSwitch( | ||
180 | 11 | - switches::kEnableExperimentalExtensionApis); | ||
181 | 12 | - | ||
182 | 13 | ASSERT_TRUE(RunExtensionTest("infobars")) << message_; | ||
183 | 14 | } | ||
184 | 15 | Index: src/chrome/browser/infobars/infobar_extension_api.h | ||
185 | 16 | =================================================================== | ||
186 | 17 | --- src.orig/chrome/browser/infobars/infobar_extension_api.h 2012-07-07 00:59:54.000000000 -0400 | ||
187 | 18 | +++ src/chrome/browser/infobars/infobar_extension_api.h 2012-07-16 15:33:42.371644366 -0400 | ||
188 | 19 | @@ -11,7 +11,7 @@ | ||
189 | 20 | class ShowInfoBarFunction : public SyncExtensionFunction { | ||
190 | 21 | virtual ~ShowInfoBarFunction() {} | ||
191 | 22 | virtual bool RunImpl() OVERRIDE; | ||
192 | 23 | - DECLARE_EXTENSION_FUNCTION_NAME("experimental.infobars.show") | ||
193 | 24 | + DECLARE_EXTENSION_FUNCTION_NAME("infobars.show") | ||
194 | 25 | }; | ||
195 | 26 | |||
196 | 27 | #endif // CHROME_BROWSER_INFOBARS_INFOBAR_EXTENSION_API_H_ | ||
197 | 28 | Index: src/chrome/common/extensions_api_resources.grd | ||
198 | 29 | =================================================================== | ||
199 | 30 | --- src.orig/chrome/common/extensions_api_resources.grd 2012-07-07 01:01:18.000000000 -0400 | ||
200 | 31 | +++ src/chrome/common/extensions_api_resources.grd 2012-07-16 15:33:42.371644366 -0400 | ||
201 | 32 | @@ -28,7 +28,6 @@ | ||
202 | 33 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_DOWNLOADS" file="extensions\api\experimental.downloads.json" type="BINDATA" /> | ||
203 | 34 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_FONTSSETTINGS" file="extensions\api\experimental.fontSettings.json" type="BINDATA" /> | ||
204 | 35 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_IDENTITY" file="extensions\api\experimental.identity.json" type="BINDATA" /> | ||
205 | 36 | - <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INFOBARS" file="extensions\api\experimental.infobars.json" type="BINDATA" /> | ||
206 | 37 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INPUT_UI" file="extensions\api\experimental.input.ui.json" type="BINDATA" /> | ||
207 | 38 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_INPUT_VIRTUALKEYBOARD" file="extensions\api\experimental.input.virtualKeyboard.json" type="BINDATA" /> | ||
208 | 39 | <include name="IDR_EXTENSION_API_JSON_EXPERIMENTAL_KEYBINDING" file="extensions\api\experimental.keybinding.json" type="BINDATA" /> | ||
209 | 40 | @@ -45,6 +44,7 @@ | ||
210 | 41 | <include name="IDR_EXTENSION_API_JSON_HISTORY" file="extensions\api\history.json" type="BINDATA" /> | ||
211 | 42 | <include name="IDR_EXTENSION_API_JSON_I18N" file="extensions\api\i18n.json" type="BINDATA" /> | ||
212 | 43 | <include name="IDR_EXTENSION_API_JSON_INPUT_IME" file="extensions\api\input.ime.json" type="BINDATA" /> | ||
213 | 44 | + <include name="IDR_EXTENSION_API_JSON_INFOBARS" file="extensions\api\infobars.json" type="BINDATA" /> | ||
214 | 45 | <include name="IDR_EXTENSION_API_JSON_IDLE" file="extensions\api\idle.json" type="BINDATA" /> | ||
215 | 46 | <include name="IDR_EXTENSION_API_JSON_INPUTMETHODPRIVATE" file="extensions\api\inputMethodPrivate.json" type="BINDATA" /> | ||
216 | 47 | <include name="IDR_EXTENSION_API_JSON_MANAGEDMODEPRIVATE" file="extensions\api\managedModePrivate.json" type="BINDATA" /> | ||
217 | 48 | Index: src/chrome/common/extensions/extension_permission_set.cc | ||
218 | 49 | =================================================================== | ||
219 | 50 | --- src.orig/chrome/common/extensions/extension_permission_set.cc 2012-07-07 01:01:17.000000000 -0400 | ||
220 | 51 | +++ src/chrome/common/extensions/extension_permission_set.cc 2012-07-16 15:33:42.371644366 -0400 | ||
221 | 52 | @@ -47,6 +47,7 @@ | ||
222 | 53 | "devtools", | ||
223 | 54 | "extension", | ||
224 | 55 | "i18n", | ||
225 | 56 | + "infobars", | ||
226 | 57 | "omnibox", | ||
227 | 58 | "pageAction", | ||
228 | 59 | "pageActions", | ||
229 | 60 | Index: src/chrome/common/extensions/api/infobars.json | ||
230 | 61 | =================================================================== | ||
231 | 62 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
232 | 63 | +++ src/chrome/common/extensions/api/infobars.json 2012-07-16 15:38:08.703653129 -0400 | ||
233 | 64 | @@ -0,0 +1,51 @@ | ||
234 | 65 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
235 | 66 | +// Use of this source code is governed by a BSD-style license that can be | ||
236 | 67 | +// found in the LICENSE file. | ||
237 | 68 | + | ||
238 | 69 | +[ | ||
239 | 70 | + { | ||
240 | 71 | + "namespace": "infobars", | ||
241 | 72 | + "dependencies": [ "windows" ], | ||
242 | 73 | + "types": [], | ||
243 | 74 | + "functions": [ | ||
244 | 75 | + { | ||
245 | 76 | + "name": "show", | ||
246 | 77 | + "type": "function", | ||
247 | 78 | + "description": "Shows an infobar in the specified tab. The infobar will be closed automatically when the tab navigates. Use window.close() to close the infobar before then.", | ||
248 | 79 | + "parameters": [ | ||
249 | 80 | + { | ||
250 | 81 | + "name": "details", | ||
251 | 82 | + "type": "object", | ||
252 | 83 | + "properties": { | ||
253 | 84 | + "tabId": { | ||
254 | 85 | + "type": "integer", | ||
255 | 86 | + "description": "The tab id for the tab to display the infobar in." | ||
256 | 87 | + }, | ||
257 | 88 | + "path": { | ||
258 | 89 | + "type": "string", | ||
259 | 90 | + "description": "The html file that contains the infobar." | ||
260 | 91 | + }, | ||
261 | 92 | + "height": { | ||
262 | 93 | + "type": "integer", | ||
263 | 94 | + "description": "The height (in pixels) of the infobar to show. If omitted, the default infobar height will be used.", | ||
264 | 95 | + "optional": true, | ||
265 | 96 | + "minimum": 0, | ||
266 | 97 | + "maximum": 72 | ||
267 | 98 | + } | ||
268 | 99 | + } | ||
269 | 100 | + }, | ||
270 | 101 | + { | ||
271 | 102 | + "type": "function", | ||
272 | 103 | + "name": "callback", | ||
273 | 104 | + "optional": true, | ||
274 | 105 | + "parameters": [ | ||
275 | 106 | + { | ||
276 | 107 | + "name": "window", "$ref": "Window", "description": "Contains details about the window in which the infobar was created." | ||
277 | 108 | + } | ||
278 | 109 | + ] | ||
279 | 110 | + } | ||
280 | 111 | + ] | ||
281 | 112 | + } | ||
282 | 113 | + ] | ||
283 | 114 | + } | ||
284 | 115 | +] | ||
285 | 116 | Index: src/chrome/common/extensions/api/extension_api.cc | ||
286 | 117 | =================================================================== | ||
287 | 118 | --- src.orig/chrome/common/extensions/api/extension_api.cc 2012-07-07 01:01:17.000000000 -0400 | ||
288 | 119 | +++ src/chrome/common/extensions/api/extension_api.cc 2012-07-16 15:33:42.375644366 -0400 | ||
289 | 120 | @@ -297,8 +297,6 @@ | ||
290 | 121 | IDR_EXTENSION_API_JSON_EXPERIMENTAL_FONTSSETTINGS)); | ||
291 | 122 | RegisterSchema("experimental.identity", ReadFromResource( | ||
292 | 123 | IDR_EXTENSION_API_JSON_EXPERIMENTAL_IDENTITY)); | ||
293 | 124 | - RegisterSchema("experimental.infobars", ReadFromResource( | ||
294 | 125 | - IDR_EXTENSION_API_JSON_EXPERIMENTAL_INFOBARS)); | ||
295 | 126 | RegisterSchema("experimental.input.ui", ReadFromResource( | ||
296 | 127 | IDR_EXTENSION_API_JSON_EXPERIMENTAL_INPUT_UI)); | ||
297 | 128 | RegisterSchema("experimental.input.virtualKeyboard", ReadFromResource( | ||
298 | 129 | @@ -331,6 +329,8 @@ | ||
299 | 130 | IDR_EXTENSION_API_JSON_I18N)); | ||
300 | 131 | RegisterSchema("idle", ReadFromResource( | ||
301 | 132 | IDR_EXTENSION_API_JSON_IDLE)); | ||
302 | 133 | + RegisterSchema("infobars",ReadFromResource( | ||
303 | 134 | + IDR_EXTENSION_API_JSON_INFOBARS)); | ||
304 | 135 | RegisterSchema("experimental.input.ime", ReadFromResource( | ||
305 | 136 | IDR_EXTENSION_API_JSON_INPUT_IME)); | ||
306 | 137 | RegisterSchema("inputMethodPrivate", ReadFromResource( | ||
307 | 138 | Index: src/chrome/common/extensions/api/experimental.infobars.json | ||
308 | 139 | =================================================================== | ||
309 | 140 | --- src.orig/chrome/common/extensions/api/experimental.infobars.json 2012-07-07 01:01:17.000000000 -0400 | ||
310 | 141 | +++ /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
311 | 142 | @@ -1,51 +0,0 @@ | ||
312 | 143 | -// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
313 | 144 | -// Use of this source code is governed by a BSD-style license that can be | ||
314 | 145 | -// found in the LICENSE file. | ||
315 | 146 | - | ||
316 | 147 | -[ | ||
317 | 148 | - { | ||
318 | 149 | - "namespace": "experimental.infobars", | ||
319 | 150 | - "dependencies": [ "windows" ], | ||
320 | 151 | - "types": [], | ||
321 | 152 | - "functions": [ | ||
322 | 153 | - { | ||
323 | 154 | - "name": "show", | ||
324 | 155 | - "type": "function", | ||
325 | 156 | - "description": "Shows an infobar in the specified tab. The infobar will be closed automatically when the tab navigates. Use window.close() to close the infobar before then.", | ||
326 | 157 | - "parameters": [ | ||
327 | 158 | - { | ||
328 | 159 | - "name": "details", | ||
329 | 160 | - "type": "object", | ||
330 | 161 | - "properties": { | ||
331 | 162 | - "tabId": { | ||
332 | 163 | - "type": "integer", | ||
333 | 164 | - "description": "The tab id for the tab to display the infobar in." | ||
334 | 165 | - }, | ||
335 | 166 | - "path": { | ||
336 | 167 | - "type": "string", | ||
337 | 168 | - "description": "The html file that contains the infobar." | ||
338 | 169 | - }, | ||
339 | 170 | - "height": { | ||
340 | 171 | - "type": "integer", | ||
341 | 172 | - "description": "The height (in pixels) of the infobar to show. If omitted, the default infobar height will be used.", | ||
342 | 173 | - "optional": true, | ||
343 | 174 | - "minimum": 0, | ||
344 | 175 | - "maximum": 72 | ||
345 | 176 | - } | ||
346 | 177 | - } | ||
347 | 178 | - }, | ||
348 | 179 | - { | ||
349 | 180 | - "type": "function", | ||
350 | 181 | - "name": "callback", | ||
351 | 182 | - "optional": true, | ||
352 | 183 | - "parameters": [ | ||
353 | 184 | - { | ||
354 | 185 | - "name": "window", "$ref": "Window", "description": "Contains details about the window in which the infobar was created." | ||
355 | 186 | - } | ||
356 | 187 | - ] | ||
357 | 188 | - } | ||
358 | 189 | - ] | ||
359 | 190 | - } | ||
360 | 191 | - ] | ||
361 | 192 | - } | ||
362 | 193 | -] | ||
363 | 0 | 194 | ||
364 | === added file 'debian/patches/2-get-domain-tld.patch' | |||
365 | --- debian/patches/2-get-domain-tld.patch 1970-01-01 00:00:00 +0000 | |||
366 | +++ debian/patches/2-get-domain-tld.patch 2012-08-06 17:52:22 +0000 | |||
367 | @@ -0,0 +1,255 @@ | |||
368 | 1 | Index: src/chrome/browser/extensions/api/tld/tld_api.cc | ||
369 | 2 | =================================================================== | ||
370 | 3 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
371 | 4 | +++ src/chrome/browser/extensions/api/tld/tld_api.cc 2012-07-16 15:39:31.611655856 -0400 | ||
372 | 5 | @@ -0,0 +1,88 @@ | ||
373 | 6 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
374 | 7 | +// Use of this source code is governed by a BSD-style license that can be | ||
375 | 8 | +// found in the LICENSE file. | ||
376 | 9 | + | ||
377 | 10 | +#include "chrome/browser/extensions/api/tld/tld_api.h" | ||
378 | 11 | + | ||
379 | 12 | +#include "base/time.h" | ||
380 | 13 | +#include "base/values.h" | ||
381 | 14 | +#include "chrome/browser/extensions/extension_service.h" | ||
382 | 15 | +#include "chrome/common/extensions/extension.h" | ||
383 | 16 | +#include "chrome/common/extensions/extension_constants.h" | ||
384 | 17 | +#include "googleurl/src/gurl.h" | ||
385 | 18 | +#include "googleurl/src/url_parse.h" | ||
386 | 19 | +#include "googleurl/src/url_util.h" | ||
387 | 20 | +#include "net/base/registry_controlled_domain.h" | ||
388 | 21 | + | ||
389 | 22 | +namespace { | ||
390 | 23 | +const char kInvalidUriError[] = "Invalid or unsupported URI"; | ||
391 | 24 | + | ||
392 | 25 | +bool IsValidUrl(const GURL& url) { | ||
393 | 26 | + return url.is_valid() && url.IsStandard() && | ||
394 | 27 | + !url.SchemeIsFile() && !url.SchemeIsFileSystem(); | ||
395 | 28 | +} | ||
396 | 29 | +} // namespace | ||
397 | 30 | + | ||
398 | 31 | +bool TldGetBaseDomainFunction::RunImpl() { | ||
399 | 32 | + EXTENSION_FUNCTION_VALIDATE(args_->GetSize() == 1); | ||
400 | 33 | + | ||
401 | 34 | + std::string uri; | ||
402 | 35 | + EXTENSION_FUNCTION_VALIDATE(args_->GetString(0, &uri)); | ||
403 | 36 | + | ||
404 | 37 | + // We might delegate all the url validity check to GetDomainAndRegistry | ||
405 | 38 | + // but try to be more explicit about the errors in some cases. | ||
406 | 39 | + const GURL url(uri); | ||
407 | 40 | + if (!IsValidUrl(url)) { | ||
408 | 41 | + error_ = kInvalidUriError; | ||
409 | 42 | + return false; | ||
410 | 43 | + } | ||
411 | 44 | + | ||
412 | 45 | + std::string tld = | ||
413 | 46 | + net::RegistryControlledDomainService::GetDomainAndRegistry(url); | ||
414 | 47 | + | ||
415 | 48 | + result_.reset(Value::CreateStringValue(tld)); | ||
416 | 49 | + | ||
417 | 50 | + return true; | ||
418 | 51 | +} | ||
419 | 52 | + | ||
420 | 53 | + | ||
421 | 54 | +bool TldGetPublicSuffix::RunImpl() { | ||
422 | 55 | + EXTENSION_FUNCTION_VALIDATE(args_->GetSize() == 2); | ||
423 | 56 | + | ||
424 | 57 | + std::string uri; | ||
425 | 58 | + EXTENSION_FUNCTION_VALIDATE(!args_->GetString(0, &uri)); | ||
426 | 59 | + | ||
427 | 60 | + // We might delegate all the url validity check to GetDomainAndRegistry | ||
428 | 61 | + // or GetRegistryLength but try to be more explicit about the errors in | ||
429 | 62 | + // some cases. | ||
430 | 63 | + const GURL url(uri); | ||
431 | 64 | + if (!IsValidUrl(url)) { | ||
432 | 65 | + error_ = kInvalidUriError; | ||
433 | 66 | + return false; | ||
434 | 67 | + } | ||
435 | 68 | + | ||
436 | 69 | + std::string suffix; | ||
437 | 70 | + | ||
438 | 71 | + size_t reg_len = | ||
439 | 72 | + net::RegistryControlledDomainService::GetRegistryLength(url, true); | ||
440 | 73 | + | ||
441 | 74 | + if (std::string::npos == reg_len || 0 == reg_len) | ||
442 | 75 | + return false; | ||
443 | 76 | + | ||
444 | 77 | + std::string tld = | ||
445 | 78 | + net::RegistryControlledDomainService::GetDomainAndRegistry(url); | ||
446 | 79 | + | ||
447 | 80 | + if (!tld.empty () && tld.size() > reg_len) | ||
448 | 81 | + suffix = tld.substr(tld.size() - reg_len - 1, reg_len); | ||
449 | 82 | + | ||
450 | 83 | + // An empty suffix is a acceptable value since the URL might be | ||
451 | 84 | + // "properly formed" but might fall into cases such as: | ||
452 | 85 | + // * http://co.uk/file.html | ||
453 | 86 | + // * http://<IP address>/file.html | ||
454 | 87 | + // which are described by GetRegistryLength to return 0 (i.e. a valid value). | ||
455 | 88 | + result_.reset(Value::CreateStringValue(suffix)); | ||
456 | 89 | + | ||
457 | 90 | + return true; | ||
458 | 91 | +} | ||
459 | 92 | + | ||
460 | 93 | + | ||
461 | 94 | Index: src/chrome/browser/extensions/api/tld/tld_api.h | ||
462 | 95 | =================================================================== | ||
463 | 96 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
464 | 97 | +++ src/chrome/browser/extensions/api/tld/tld_api.h 2012-07-16 15:39:31.611655856 -0400 | ||
465 | 98 | @@ -0,0 +1,26 @@ | ||
466 | 99 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
467 | 100 | +// Use of this source code is governed by a BSD-style license that can be | ||
468 | 101 | +// found in the LICENSE file. | ||
469 | 102 | + | ||
470 | 103 | +#ifndef CHROME_BROWSER_EXTENSIONS_API_TLD_TLD_API_H_ | ||
471 | 104 | +#define CHROME_BROWSER_EXTENSIONS_API_TLD_TLD_API_H_ | ||
472 | 105 | +#pragma once | ||
473 | 106 | + | ||
474 | 107 | +#include "chrome/browser/extensions/extension_function.h" | ||
475 | 108 | + | ||
476 | 109 | +class TldGetBaseDomainFunction : public SyncExtensionFunction { | ||
477 | 110 | + public: | ||
478 | 111 | + virtual ~TldGetBaseDomainFunction() {} | ||
479 | 112 | + virtual bool RunImpl() OVERRIDE; | ||
480 | 113 | + DECLARE_EXTENSION_FUNCTION_NAME("tld.getBaseDomain"); | ||
481 | 114 | +}; | ||
482 | 115 | + | ||
483 | 116 | +class TldGetPublicSuffix : public SyncExtensionFunction { | ||
484 | 117 | + public: | ||
485 | 118 | + virtual ~TldGetPublicSuffix() {} | ||
486 | 119 | + virtual bool RunImpl() OVERRIDE; | ||
487 | 120 | + DECLARE_EXTENSION_FUNCTION_NAME("tld.getPublicSuffix"); | ||
488 | 121 | +}; | ||
489 | 122 | + | ||
490 | 123 | +#endif // CHROME_BROWSER_EXTENSIONS_API_TLD_TLD_API_H_ | ||
491 | 124 | + | ||
492 | 125 | Index: src/chrome/browser/extensions/extension_function_registry.cc | ||
493 | 126 | =================================================================== | ||
494 | 127 | --- src.orig/chrome/browser/extensions/extension_function_registry.cc 2012-07-07 00:59:55.000000000 -0400 | ||
495 | 128 | +++ src/chrome/browser/extensions/extension_function_registry.cc 2012-07-16 15:40:22.239657522 -0400 | ||
496 | 129 | @@ -19,6 +19,7 @@ | ||
497 | 130 | #include "chrome/browser/extensions/api/runtime/runtime_api.h" | ||
498 | 131 | #include "chrome/browser/extensions/api/serial/serial_api.h" | ||
499 | 132 | #include "chrome/browser/extensions/api/socket/socket_api.h" | ||
500 | 133 | +#include "chrome/browser/extensions/api/tld/tld_api.h" | ||
501 | 134 | #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" | ||
502 | 135 | #include "chrome/browser/extensions/api/web_request/web_request_api.h" | ||
503 | 136 | #include "chrome/browser/extensions/execute_code_in_tab_function.h" | ||
504 | 137 | @@ -166,6 +167,10 @@ | ||
505 | 138 | RegisterFunction<MoveBookmarkFunction>(); | ||
506 | 139 | RegisterFunction<UpdateBookmarkFunction>(); | ||
507 | 140 | |||
508 | 141 | + // TLD. | ||
509 | 142 | + RegisterFunction<TldGetBaseDomainFunction>(); | ||
510 | 143 | + RegisterFunction<TldGetPublicSuffix>(); | ||
511 | 144 | + | ||
512 | 145 | // Infobars. | ||
513 | 146 | RegisterFunction<ShowInfoBarFunction>(); | ||
514 | 147 | |||
515 | 148 | Index: src/chrome/chrome_browser_extensions.gypi | ||
516 | 149 | =================================================================== | ||
517 | 150 | --- src.orig/chrome/chrome_browser_extensions.gypi 2012-07-07 01:00:10.000000000 -0400 | ||
518 | 151 | +++ src/chrome/chrome_browser_extensions.gypi 2012-07-16 15:39:31.611655856 -0400 | ||
519 | 152 | @@ -156,6 +156,8 @@ | ||
520 | 153 | 'browser/extensions/api/terminal/terminal_extension_helper.h', | ||
521 | 154 | 'browser/extensions/api/terminal/terminal_private_api.cc', | ||
522 | 155 | 'browser/extensions/api/terminal/terminal_private_api.h', | ||
523 | 156 | + 'browser/extensions/api/tld/tld_api.cc', | ||
524 | 157 | + 'browser/extensions/api/tld/tld_api.h', | ||
525 | 158 | 'browser/extensions/api/usb/usb_api.cc', | ||
526 | 159 | 'browser/extensions/api/usb/usb_api.h', | ||
527 | 160 | 'browser/extensions/api/usb/usb_device_resource.cc', | ||
528 | 161 | Index: src/chrome/common/extensions_api_resources.grd | ||
529 | 162 | =================================================================== | ||
530 | 163 | --- src.orig/chrome/common/extensions_api_resources.grd 2012-07-16 15:33:42.000000000 -0400 | ||
531 | 164 | +++ src/chrome/common/extensions_api_resources.grd 2012-07-16 15:39:31.611655856 -0400 | ||
532 | 165 | @@ -63,6 +63,7 @@ | ||
533 | 166 | <include name="IDR_EXTENSION_API_JSON_TABS" file="extensions\api\tabs.json" type="BINDATA" /> | ||
534 | 167 | <include name="IDR_EXTENSION_API_JSON_TERMINALPRIVATE" file="extensions\api\terminalPrivate.json" type="BINDATA" /> | ||
535 | 168 | <include name="IDR_EXTENSION_API_JSON_TEST" file="extensions\api\test.json" type="BINDATA" /> | ||
536 | 169 | + <include name="IDR_EXTENSION_API_JSON_TLD" file="extensions\api\tld.json" type="BINDATA" /> | ||
537 | 170 | <include name="IDR_EXTENSION_API_JSON_TOPSITES" file="extensions\api\topSites.json" type="BINDATA" /> | ||
538 | 171 | <include name="IDR_EXTENSION_API_JSON_TTS" file="extensions\api\tts.json" type="BINDATA" /> | ||
539 | 172 | <include name="IDR_EXTENSION_API_JSON_TTSENGINE" file="extensions\api\ttsEngine.json" type="BINDATA" /> | ||
540 | 173 | Index: src/chrome/common/extensions/extension_permission_set.cc | ||
541 | 174 | =================================================================== | ||
542 | 175 | --- src.orig/chrome/common/extensions/extension_permission_set.cc 2012-07-16 15:33:42.000000000 -0400 | ||
543 | 176 | +++ src/chrome/common/extensions/extension_permission_set.cc 2012-07-16 15:40:49.303658414 -0400 | ||
544 | 177 | @@ -53,6 +53,7 @@ | ||
545 | 178 | "pageActions", | ||
546 | 179 | "permissions", | ||
547 | 180 | "test", | ||
548 | 181 | + "tld", | ||
549 | 182 | "types" | ||
550 | 183 | }; | ||
551 | 184 | const size_t kNumNonPermissionModuleNames = | ||
552 | 185 | Index: src/chrome/common/extensions/api/extension_api.cc | ||
553 | 186 | =================================================================== | ||
554 | 187 | --- src.orig/chrome/common/extensions/api/extension_api.cc 2012-07-16 15:33:42.000000000 -0400 | ||
555 | 188 | +++ src/chrome/common/extensions/api/extension_api.cc 2012-07-16 15:39:31.611655856 -0400 | ||
556 | 189 | @@ -369,6 +369,8 @@ | ||
557 | 190 | IDR_EXTENSION_API_JSON_TERMINALPRIVATE)); | ||
558 | 191 | RegisterSchema("test", ReadFromResource( | ||
559 | 192 | IDR_EXTENSION_API_JSON_TEST)); | ||
560 | 193 | + RegisterSchema("tld", ReadFromResource( | ||
561 | 194 | + IDR_EXTENSION_API_JSON_TLD)); | ||
562 | 195 | RegisterSchema("topSites", ReadFromResource( | ||
563 | 196 | IDR_EXTENSION_API_JSON_TOPSITES)); | ||
564 | 197 | RegisterSchema("ttsEngine", ReadFromResource( | ||
565 | 198 | Index: src/chrome/common/extensions/api/tld.json | ||
566 | 199 | =================================================================== | ||
567 | 200 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
568 | 201 | +++ src/chrome/common/extensions/api/tld.json 2012-07-16 15:39:31.615655856 -0400 | ||
569 | 202 | @@ -0,0 +1,53 @@ | ||
570 | 203 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
571 | 204 | +// Use of this source code is governed by a BSD-style license that can be | ||
572 | 205 | +// found in the LICENSE file. | ||
573 | 206 | + | ||
574 | 207 | +[ | ||
575 | 208 | + { | ||
576 | 209 | + "namespace": "tld", | ||
577 | 210 | + "nodoc": "true", | ||
578 | 211 | + "types": [], | ||
579 | 212 | + "functions": [ | ||
580 | 213 | + { | ||
581 | 214 | + "name": "getBaseDomain", | ||
582 | 215 | + "type": "function", | ||
583 | 216 | + "description": "Returns the base domain of a URI; that is, the public suffix with a given number of additional domain name parts.", | ||
584 | 217 | + "nodoc": "true", | ||
585 | 218 | + "parameters": [ | ||
586 | 219 | + { | ||
587 | 220 | + "name": "uri", | ||
588 | 221 | + "type": "string" | ||
589 | 222 | + }, | ||
590 | 223 | + { | ||
591 | 224 | + "type": "function", | ||
592 | 225 | + "name": "callback", | ||
593 | 226 | + "parameters": [ | ||
594 | 227 | + {"name": "domain", "type": "string", "description": "The base domain name of the associated URI if any"} | ||
595 | 228 | + ] | ||
596 | 229 | + } | ||
597 | 230 | + ] | ||
598 | 231 | + } | ||
599 | 232 | + , | ||
600 | 233 | + { | ||
601 | 234 | + "name": "getPublicSuffix", | ||
602 | 235 | + "type": "function", | ||
603 | 236 | + "description": "Returns the public suffix of the domain part of a URI.", | ||
604 | 237 | + "nodoc": "true", | ||
605 | 238 | + "parameters": [ | ||
606 | 239 | + { | ||
607 | 240 | + "name": "uri", | ||
608 | 241 | + "type": "string" | ||
609 | 242 | + }, | ||
610 | 243 | + { | ||
611 | 244 | + "type": "function", | ||
612 | 245 | + "name": "callback", | ||
613 | 246 | + "parameters": [ | ||
614 | 247 | + {"name": "suffix", "type": "string", "description": "The public suffix of the associated URI if any"} | ||
615 | 248 | + ] | ||
616 | 249 | + } | ||
617 | 250 | + ] | ||
618 | 251 | + } | ||
619 | 252 | + ] | ||
620 | 253 | + } | ||
621 | 254 | + | ||
622 | 255 | +] | ||
623 | 0 | 256 | ||
624 | === added file 'debian/patches/3-chrome-xid.patch' | |||
625 | --- debian/patches/3-chrome-xid.patch 1970-01-01 00:00:00 +0000 | |||
626 | +++ debian/patches/3-chrome-xid.patch 2012-08-06 17:52:22 +0000 | |||
627 | @@ -0,0 +1,38 @@ | |||
628 | 1 | Index: src/chrome/browser/ui/gtk/browser_window_gtk.cc | ||
629 | 2 | =================================================================== | ||
630 | 3 | --- src.orig/chrome/browser/ui/gtk/browser_window_gtk.cc 2012-07-07 01:00:04.000000000 -0400 | ||
631 | 4 | +++ src/chrome/browser/ui/gtk/browser_window_gtk.cc 2012-07-16 15:41:21.991659488 -0400 | ||
632 | 5 | @@ -150,6 +150,12 @@ | ||
633 | 6 | // gtk_window_get_position() after the last GTK configure-event signal. | ||
634 | 7 | const int kDebounceTimeoutMilliseconds = 100; | ||
635 | 8 | |||
636 | 9 | +// A window property will be set to reflect the session_id of the | ||
637 | 10 | +// associated browser window. The session_id is unique among browsers | ||
638 | 11 | +// for a given session and actually corresponds to the window.id found | ||
639 | 12 | +// in the extensions api. | ||
640 | 13 | +char kSessionIdPropertyName[] = "CHROMIUM_LINUX_SESSION_ID_PROPERTY"; | ||
641 | 14 | + | ||
642 | 15 | // Ubuntu patches their verrsion of GTK+ so that there is always a | ||
643 | 16 | // gripper in the bottom right corner of the window. We dynamically | ||
644 | 17 | // look up this symbol because it's a non-standard Ubuntu extension to | ||
645 | 18 | @@ -422,6 +428,20 @@ | ||
646 | 19 | InitWidgets(); | ||
647 | 20 | } | ||
648 | 21 | |||
649 | 22 | + // Add a specific property to inform an interested third party | ||
650 | 23 | + // of our session id. Interesting in the context of an extension | ||
651 | 24 | + // where the session id corresponds to the window.id and is a way | ||
652 | 25 | + // to uniquely identify a window based on that (from within a given | ||
653 | 26 | + // extension). | ||
654 | 27 | + gulong session_id = browser_->session_id().id(); | ||
655 | 28 | + gdk_property_change(GTK_WIDGET(window_)->window, | ||
656 | 29 | + gdk_atom_intern(kSessionIdPropertyName, FALSE), | ||
657 | 30 | + gdk_atom_intern("CARDINAL", FALSE), | ||
658 | 31 | + 32, | ||
659 | 32 | + GDK_PROP_MODE_REPLACE, | ||
660 | 33 | + (guchar *)&session_id, | ||
661 | 34 | + 1); | ||
662 | 35 | + | ||
663 | 36 | ConnectAccelerators(); | ||
664 | 37 | |||
665 | 38 | // Set the initial background color of widgets. | ||
666 | 0 | 39 | ||
667 | === added file 'debian/patches/arm.patch' | |||
668 | --- debian/patches/arm.patch 1970-01-01 00:00:00 +0000 | |||
669 | +++ debian/patches/arm.patch 2012-08-06 17:52:22 +0000 | |||
670 | @@ -0,0 +1,50 @@ | |||
671 | 1 | Index: src/skia/skia.gyp | ||
672 | 2 | =================================================================== | ||
673 | 3 | --- src.orig/skia/skia.gyp 2012-05-19 16:54:19.000000000 +0200 | ||
674 | 4 | +++ src/skia/skia.gyp 2012-06-20 14:34:13.131318952 +0200 | ||
675 | 5 | @@ -1157,9 +1157,11 @@ | ||
676 | 6 | [ 'target_arch == "arm" and armv7 != 1', { | ||
677 | 7 | 'sources': [ | ||
678 | 8 | '../third_party/skia/src/opts/SkBlitRow_opts_none.cpp', | ||
679 | 9 | + '../third_party/skia/src/opts/SkUtils_opts_none.cpp', | ||
680 | 10 | ], | ||
681 | 11 | 'sources!': [ | ||
682 | 12 | '../third_party/skia/src/opts/SkBlitRow_opts_arm.cpp', | ||
683 | 13 | + '../third_party/skia/src/opts/opts_check_arm.cpp', | ||
684 | 14 | ], | ||
685 | 15 | }], | ||
686 | 16 | ], | ||
687 | 17 | Index: src/ui/base/resource/data_pack.cc | ||
688 | 18 | =================================================================== | ||
689 | 19 | --- src.orig/ui/base/resource/data_pack.cc 2012-05-19 16:55:37.000000000 +0200 | ||
690 | 20 | +++ src/ui/base/resource/data_pack.cc 2012-06-20 14:38:32.507316901 +0200 | ||
691 | 21 | @@ -130,9 +130,11 @@ | ||
692 | 22 | // 2) Verify the entries are within the appropriate bounds. There's an extra | ||
693 | 23 | // entry after the last item which gives us the length of the last item. | ||
694 | 24 | for (size_t i = 0; i < resource_count_ + 1; ++i) { | ||
695 | 25 | + uint32 t; | ||
696 | 26 | const DataPackEntry* entry = reinterpret_cast<const DataPackEntry*>( | ||
697 | 27 | mmap_->data() + kHeaderLength + (i * sizeof(DataPackEntry))); | ||
698 | 28 | - if (entry->file_offset > mmap_->length()) { | ||
699 | 29 | + memcpy(&t, &entry->file_offset, 32/8); | ||
700 | 30 | + if (t > mmap_->length()) { | ||
701 | 31 | LOG(ERROR) << "Entry #" << i << " in data pack points off end of file. " | ||
702 | 32 | << "Was the file corrupted?"; | ||
703 | 33 | UMA_HISTOGRAM_ENUMERATION("DataPack.Load", ENTRY_NOT_FOUND, | ||
704 | 34 | Index: src/v8/src/arm/macro-assembler-arm.cc | ||
705 | 35 | =================================================================== | ||
706 | 36 | --- src.orig/v8/src/arm/macro-assembler-arm.cc 2012-05-19 16:57:27.000000000 +0200 | ||
707 | 37 | +++ src/v8/src/arm/macro-assembler-arm.cc 2012-06-20 14:35:27.339318363 +0200 | ||
708 | 38 | @@ -61,9 +61,9 @@ | ||
709 | 39 | // We do not support thumb inter-working with an arm architecture not supporting | ||
710 | 40 | // the blx instruction (below v5t). If you know what CPU you are compiling for | ||
711 | 41 | // you can use -march=armv7 or similar. | ||
712 | 42 | -#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS) | ||
713 | 43 | -# error "For thumb inter-working we require an architecture which supports blx" | ||
714 | 44 | -#endif | ||
715 | 45 | +//#if defined(USE_THUMB_INTERWORK) && !defined(CAN_USE_THUMB_INSTRUCTIONS) | ||
716 | 46 | +//# error "For thumb inter-working we require an architecture which supports blx" | ||
717 | 47 | +//#endif | ||
718 | 48 | |||
719 | 49 | |||
720 | 50 | // Using bx does not yield better code, so use it only when required | ||
721 | 0 | 51 | ||
722 | === added file 'debian/patches/chromeless-window-launch-option.patch' | |||
723 | --- debian/patches/chromeless-window-launch-option.patch 1970-01-01 00:00:00 +0000 | |||
724 | +++ debian/patches/chromeless-window-launch-option.patch 2012-08-06 17:52:22 +0000 | |||
725 | @@ -0,0 +1,860 @@ | |||
726 | 1 | Index: src/chrome/browser/ui/gtk/browser_window_gtk.cc | ||
727 | 2 | =================================================================== | ||
728 | 3 | --- src.orig/chrome/browser/ui/gtk/browser_window_gtk.cc 2012-07-11 23:49:59.216259275 -0400 | ||
729 | 4 | +++ src/chrome/browser/ui/gtk/browser_window_gtk.cc 2012-07-11 23:49:59.232259276 -0400 | ||
730 | 5 | @@ -412,6 +412,8 @@ | ||
731 | 6 | SetWindowCustomClass(window_, | ||
732 | 7 | std::string(gdk_get_program_class()) + | ||
733 | 8 | " (" + user_data_dir + ")"); | ||
734 | 9 | + } else if (browser_->is_chromeless_mode()) { | ||
735 | 10 | + SetWindowCustomClass(window_, web_app::GetWMClassFromAppName("chromeless")); | ||
736 | 11 | } | ||
737 | 12 | |||
738 | 13 | // For popups, we initialize widgets then set the window geometry, because | ||
739 | 14 | @@ -980,7 +982,7 @@ | ||
740 | 15 | } | ||
741 | 16 | |||
742 | 17 | void BrowserWindowGtk::SetFocusToLocationBar(bool select_all) { | ||
743 | 18 | - if (!IsFullscreen()) | ||
744 | 19 | + if (!IsFullscreen() && IsToolbarSupported()) | ||
745 | 20 | GetLocationBar()->FocusLocation(select_all); | ||
746 | 21 | } | ||
747 | 22 | |||
748 | 23 | @@ -2546,7 +2548,7 @@ | ||
749 | 24 | |||
750 | 25 | bool BrowserWindowGtk::UseCustomFrame() const { | ||
751 | 26 | // We don't use the custom frame for app mode windows or app window popups. | ||
752 | 27 | - return use_custom_frame_pref_.GetValue() && !browser_->is_app(); | ||
753 | 28 | + return use_custom_frame_pref_.GetValue() && !browser_->is_app() && !browser_->is_chromeless_mode(); | ||
754 | 29 | } | ||
755 | 30 | |||
756 | 31 | bool BrowserWindowGtk::BoundsMatchMonitorSize() { | ||
757 | 32 | Index: src/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc | ||
758 | 33 | =================================================================== | ||
759 | 34 | --- src.orig/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc 2012-07-07 01:00:04.000000000 -0400 | ||
760 | 35 | +++ src/chrome/browser/ui/gtk/tabs/tab_strip_gtk.cc 2012-07-11 23:49:59.232259276 -0400 | ||
761 | 36 | @@ -777,9 +777,11 @@ | ||
762 | 37 | g_signal_connect(tabstrip_.get(), "drag-data-received", | ||
763 | 38 | G_CALLBACK(OnDragDataReceivedThunk), this); | ||
764 | 39 | |||
765 | 40 | - newtab_button_.reset(MakeNewTabButton()); | ||
766 | 41 | - newtab_surface_bounds_.SetRect(0, 0, newtab_button_->SurfaceWidth(), | ||
767 | 42 | - newtab_button_->SurfaceHeight()); | ||
768 | 43 | + if (window_ && window_->browser() && ! window_->browser()->is_chromeless_mode()) { | ||
769 | 44 | + newtab_button_.reset(MakeNewTabButton()); | ||
770 | 45 | + newtab_surface_bounds_.SetRect(0, 0, newtab_button_->SurfaceWidth(), | ||
771 | 46 | + newtab_button_->SurfaceHeight()); | ||
772 | 47 | + } | ||
773 | 48 | |||
774 | 49 | gtk_widget_show_all(tabstrip_.get()); | ||
775 | 50 | |||
776 | 51 | @@ -1451,6 +1453,9 @@ | ||
777 | 52 | |||
778 | 53 | void TabStripGtk::LayoutNewTabButton(double last_tab_right, | ||
779 | 54 | double unselected_width) { | ||
780 | 55 | + if (window_ && window_->browser() && window_->browser()->is_chromeless_mode()) | ||
781 | 56 | + return; | ||
782 | 57 | + | ||
783 | 58 | GtkWidget* toplevel = gtk_widget_get_ancestor(widget(), GTK_TYPE_WINDOW); | ||
784 | 59 | bool is_maximized = false; | ||
785 | 60 | if (toplevel) { | ||
786 | 61 | @@ -1504,8 +1509,10 @@ | ||
787 | 62 | int available_width = tabstrip_allocation.width; | ||
788 | 63 | if (available_width_for_tabs_ < 0) { | ||
789 | 64 | available_width = bounds_.width(); | ||
790 | 65 | - available_width -= | ||
791 | 66 | + if (newtab_button_.get() != NULL) { | ||
792 | 67 | + available_width -= | ||
793 | 68 | (kNewTabButtonHOffset + newtab_button_->WidgetAllocation().width); | ||
794 | 69 | + } | ||
795 | 70 | } else { | ||
796 | 71 | // Interesting corner case: if |available_width_for_tabs_| > the result | ||
797 | 72 | // of the calculation in the conditional arm above, the strip is in | ||
798 | 73 | @@ -2062,9 +2069,11 @@ | ||
799 | 74 | event->area.height = bounds_.height(); | ||
800 | 75 | gdk_region_union_with_rect(event->region, &event->area); | ||
801 | 76 | |||
802 | 77 | - // Paint the New Tab button. | ||
803 | 78 | - gtk_container_propagate_expose(GTK_CONTAINER(tabstrip_.get()), | ||
804 | 79 | - newtab_button_->widget(), event); | ||
805 | 80 | + if (newtab_button_.get() != NULL) { | ||
806 | 81 | + // Paint the New Tab button. | ||
807 | 82 | + gtk_container_propagate_expose(GTK_CONTAINER(tabstrip_.get()), | ||
808 | 83 | + newtab_button_->widget(), event); | ||
809 | 84 | + } | ||
810 | 85 | |||
811 | 86 | // Paint the tabs in reverse order, so they stack to the left. | ||
812 | 87 | TabGtk* selected_tab = NULL; | ||
813 | 88 | @@ -2257,6 +2266,9 @@ | ||
814 | 89 | } | ||
815 | 90 | |||
816 | 91 | void TabStripGtk::SetNewTabButtonBackground() { | ||
817 | 92 | + if (newtab_button_.get() == NULL) { | ||
818 | 93 | + return; | ||
819 | 94 | + } | ||
820 | 95 | SkColor color = theme_service_->GetColor( | ||
821 | 96 | ThemeService::COLOR_BUTTON_BACKGROUND); | ||
822 | 97 | SkBitmap* background = theme_service_->GetBitmapNamed( | ||
823 | 98 | Index: src/chrome/browser/ui/browser.h | ||
824 | 99 | =================================================================== | ||
825 | 100 | --- src.orig/chrome/browser/ui/browser.h 2012-07-07 01:00:04.000000000 -0400 | ||
826 | 101 | +++ src/chrome/browser/ui/browser.h 2012-07-11 23:49:59.236259276 -0400 | ||
827 | 102 | @@ -194,6 +194,9 @@ | ||
828 | 103 | // window is created by this function call. | ||
829 | 104 | static Browser* Create(Profile* profile); | ||
830 | 105 | |||
831 | 106 | + // Like Create, but creates a chromeless browser. | ||
832 | 107 | + static Browser* CreateChromeless(Profile * profile); | ||
833 | 108 | + | ||
834 | 109 | // Like Create, but creates a browser of the specified parameters. | ||
835 | 110 | static Browser* CreateWithParams(const CreateParams& params); | ||
836 | 111 | |||
837 | 112 | @@ -868,6 +871,7 @@ | ||
838 | 113 | bool is_type_popup() const { return type_ == TYPE_POPUP; } | ||
839 | 114 | bool is_type_panel() const { return type_ == TYPE_PANEL; } | ||
840 | 115 | |||
841 | 116 | + bool is_chromeless_mode() const; | ||
842 | 117 | bool is_app() const; | ||
843 | 118 | bool is_devtools() const; | ||
844 | 119 | |||
845 | 120 | @@ -1355,6 +1359,8 @@ | ||
846 | 121 | // Type of app (host or child). See description of AppType. | ||
847 | 122 | AppType app_type_; | ||
848 | 123 | |||
849 | 124 | + bool is_chromeless_mode_; | ||
850 | 125 | + | ||
851 | 126 | // Unique identifier of this browser for session restore. This id is only | ||
852 | 127 | // unique within the current session, and is not guaranteed to be unique | ||
853 | 128 | // across sessions. | ||
854 | 129 | Index: src/chrome/browser/ui/browser_init.h | ||
855 | 130 | =================================================================== | ||
856 | 131 | --- src.orig/chrome/browser/ui/browser_init.h 2012-07-07 01:00:03.000000000 -0400 | ||
857 | 132 | +++ src/chrome/browser/ui/browser_init.h 2012-07-11 23:49:59.236259276 -0400 | ||
858 | 133 | @@ -159,6 +159,11 @@ | ||
859 | 134 | FRIEND_TEST_ALL_PREFIXES(BrowserTest, RestorePinnedTabs); | ||
860 | 135 | FRIEND_TEST_ALL_PREFIXES(BrowserTest, AppIdSwitch); | ||
861 | 136 | |||
862 | 137 | + // If the process was launched with the chromeless command line flag, | ||
863 | 138 | + // e.g. --chromeless=http://www.google.com/ return true. | ||
864 | 139 | + // In this case |url| is populated if they're non-null. | ||
865 | 140 | + bool IsChromelessLaunch(std::string* url); | ||
866 | 141 | + | ||
867 | 142 | // If the process was launched with the web application command line flags, | ||
868 | 143 | // e.g. --app=http://www.google.com/ or --app_id=... return true. | ||
869 | 144 | // In this case |app_url| or |app_id| are populated if they're non-null. | ||
870 | 145 | Index: src/chrome/browser/ui/browser_init.cc | ||
871 | 146 | =================================================================== | ||
872 | 147 | --- src.orig/chrome/browser/ui/browser_init.cc 2012-07-07 01:00:08.000000000 -0400 | ||
873 | 148 | +++ src/chrome/browser/ui/browser_init.cc 2012-07-11 23:49:59.236259276 -0400 | ||
874 | 149 | @@ -972,6 +972,16 @@ | ||
875 | 150 | return true; | ||
876 | 151 | } | ||
877 | 152 | |||
878 | 153 | +bool BrowserInit::LaunchWithProfile::IsChromelessLaunch(std::string* url) | ||
879 | 154 | +{ | ||
880 | 155 | + if (command_line_.HasSwitch(switches::kChromeless)) { | ||
881 | 156 | + if (url) | ||
882 | 157 | + *url = command_line_.GetSwitchValueASCII(switches::kChromeless); | ||
883 | 158 | + return true; | ||
884 | 159 | + } | ||
885 | 160 | + return false; | ||
886 | 161 | +} | ||
887 | 162 | + | ||
888 | 163 | bool BrowserInit::LaunchWithProfile::IsAppLaunch(std::string* app_url, | ||
889 | 164 | std::string* app_id) { | ||
890 | 165 | if (command_line_.HasSwitch(switches::kApp)) { | ||
891 | 166 | @@ -1084,6 +1094,12 @@ | ||
892 | 167 | return; | ||
893 | 168 | } | ||
894 | 169 | |||
895 | 170 | + if (IsChromelessLaunch(NULL)) { | ||
896 | 171 | + // Open user-specified URLs like pinned tabs and startup tabs. | ||
897 | 172 | + if (ProcessSpecifiedURLs(urls_to_open)) | ||
898 | 173 | + return; | ||
899 | 174 | + } | ||
900 | 175 | + | ||
901 | 176 | if (process_startup && ProcessStartupURLs(urls_to_open)) { | ||
902 | 177 | // ProcessStartupURLs processed the urls, nothing else to do. | ||
903 | 178 | return; | ||
904 | 179 | @@ -1179,7 +1195,8 @@ | ||
905 | 180 | // mode. Also, no pages should be opened automatically if the session | ||
906 | 181 | // crashed. Otherwise it might trigger another crash, locking the user out of | ||
907 | 182 | // chrome. The crash infobar is shown in this case. | ||
908 | 183 | - if (!IncognitoModePrefs::ShouldLaunchIncognito(command_line_, | ||
909 | 184 | + if (!IsChromelessLaunch(NULL) && | ||
910 | 185 | + !IncognitoModePrefs::ShouldLaunchIncognito(command_line_, | ||
911 | 186 | profile_->GetPrefs()) && | ||
912 | 187 | !HasPendingUncleanExit(profile_)) { | ||
913 | 188 | tabs = PinnedTabCodec::ReadPinnedTabs(profile_); | ||
914 | 189 | @@ -1256,6 +1273,11 @@ | ||
915 | 190 | if (!profile_ && browser) | ||
916 | 191 | profile_ = browser->profile(); | ||
917 | 192 | |||
918 | 193 | + if (IsChromelessLaunch(NULL)) { | ||
919 | 194 | + g_message("OPenTabsInBrowser: %p chromeless create", browser); | ||
920 | 195 | + browser = Browser::CreateChromeless(profile_); | ||
921 | 196 | + } | ||
922 | 197 | + | ||
923 | 198 | if (!browser || !browser->is_type_tabbed()) { | ||
924 | 199 | browser = Browser::Create(profile_); | ||
925 | 200 | } else { | ||
926 | 201 | @@ -1325,6 +1347,13 @@ | ||
927 | 202 | if (!browser || !profile_ || browser->tab_count() == 0) | ||
928 | 203 | return; | ||
929 | 204 | |||
930 | 205 | + // We consider that being in a chromeless launch, we are to minimize as much as | ||
931 | 206 | + // possible the most obvious "classic" Chromium behavior. | ||
932 | 207 | + if (IsChromelessLaunch(NULL)) | ||
933 | 208 | + { | ||
934 | 209 | + return; | ||
935 | 210 | + } | ||
936 | 211 | + | ||
937 | 212 | TabContentsWrapper* tab_contents = browser->GetSelectedTabContentsWrapper(); | ||
938 | 213 | AddCrashedInfoBarIfNecessary(browser, tab_contents); | ||
939 | 214 | |||
940 | 215 | Index: src/chrome/browser/ui/gtk/global_menu_bar.cc | ||
941 | 216 | =================================================================== | ||
942 | 217 | --- src.orig/chrome/browser/ui/gtk/global_menu_bar.cc 2012-07-07 01:00:04.000000000 -0400 | ||
943 | 218 | +++ src/chrome/browser/ui/gtk/global_menu_bar.cc 2012-07-11 23:49:59.236259276 -0400 | ||
944 | 219 | @@ -23,35 +23,43 @@ | ||
945 | 220 | #include "ui/base/gtk/menu_label_accelerator_util.h" | ||
946 | 221 | #include "ui/base/l10n/l10n_util.h" | ||
947 | 222 | |||
948 | 223 | +typedef bool (*GlobalMenuBarVisibilityHandler) (Browser * browser); | ||
949 | 224 | + | ||
950 | 225 | struct GlobalMenuBarCommand { | ||
951 | 226 | int str_id; | ||
952 | 227 | int command; | ||
953 | 228 | int tag; | ||
954 | 229 | + GlobalMenuBarVisibilityHandler visibility_handler; | ||
955 | 230 | }; | ||
956 | 231 | |||
957 | 232 | namespace { | ||
958 | 233 | |||
959 | 234 | +static bool GlobalMenuBarVisibilityHandler_NotInChromelessMode( | ||
960 | 235 | + Browser * browser) { | ||
961 | 236 | + return browser && !browser->is_chromeless_mode(); | ||
962 | 237 | +} | ||
963 | 238 | + | ||
964 | 239 | const int MENU_SEPARATOR =-1; | ||
965 | 240 | const int MENU_END = -2; | ||
966 | 241 | const int MENU_DISABLED_LABEL = -3; | ||
967 | 242 | |||
968 | 243 | GlobalMenuBarCommand file_menu[] = { | ||
969 | 244 | - { IDS_NEW_TAB, IDC_NEW_TAB }, | ||
970 | 245 | - { IDS_NEW_WINDOW, IDC_NEW_WINDOW }, | ||
971 | 246 | - { IDS_NEW_INCOGNITO_WINDOW, IDC_NEW_INCOGNITO_WINDOW }, | ||
972 | 247 | - { IDS_REOPEN_CLOSED_TABS_LINUX, IDC_RESTORE_TAB }, | ||
973 | 248 | - { IDS_OPEN_FILE_LINUX, IDC_OPEN_FILE }, | ||
974 | 249 | - { IDS_OPEN_LOCATION_LINUX, IDC_FOCUS_LOCATION }, | ||
975 | 250 | + { IDS_NEW_TAB, IDC_NEW_TAB, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
976 | 251 | + { IDS_NEW_WINDOW, IDC_NEW_WINDOW, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
977 | 252 | + { IDS_NEW_INCOGNITO_WINDOW, IDC_NEW_INCOGNITO_WINDOW, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
978 | 253 | + { IDS_REOPEN_CLOSED_TABS_LINUX, IDC_RESTORE_TAB, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
979 | 254 | + { IDS_OPEN_FILE_LINUX, IDC_OPEN_FILE, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
980 | 255 | + { IDS_OPEN_LOCATION_LINUX, IDC_FOCUS_LOCATION, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
981 | 256 | |||
982 | 257 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
983 | 258 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
984 | 259 | |||
985 | 260 | - { IDS_CREATE_SHORTCUTS, IDC_CREATE_SHORTCUTS }, | ||
986 | 261 | + { IDS_CREATE_SHORTCUTS, IDC_CREATE_SHORTCUTS, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
987 | 262 | |||
988 | 263 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
989 | 264 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
990 | 265 | |||
991 | 266 | { IDS_CLOSE_WINDOW_LINUX, IDC_CLOSE_WINDOW }, | ||
992 | 267 | { IDS_CLOSE_TAB_LINUX, IDC_CLOSE_TAB }, | ||
993 | 268 | - { IDS_SAVE_PAGE, IDC_SAVE_PAGE }, | ||
994 | 269 | + { IDS_SAVE_PAGE, IDC_SAVE_PAGE, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
995 | 270 | |||
996 | 271 | { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
997 | 272 | |||
998 | 273 | @@ -69,17 +77,17 @@ | ||
999 | 274 | |||
1000 | 275 | { IDS_FIND, IDC_FIND }, | ||
1001 | 276 | |||
1002 | 277 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1003 | 278 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1004 | 279 | |||
1005 | 280 | - { IDS_PREFERENCES, IDC_OPTIONS }, | ||
1006 | 281 | + { IDS_PREFERENCES, IDC_OPTIONS, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1007 | 282 | |||
1008 | 283 | { MENU_END, MENU_END } | ||
1009 | 284 | }; | ||
1010 | 285 | |||
1011 | 286 | GlobalMenuBarCommand view_menu[] = { | ||
1012 | 287 | - { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR }, | ||
1013 | 288 | + { IDS_SHOW_BOOKMARK_BAR, IDC_SHOW_BOOKMARK_BAR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1014 | 289 | |||
1015 | 290 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1016 | 291 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1017 | 292 | |||
1018 | 293 | { IDS_STOP_MENU_LINUX, IDC_STOP }, | ||
1019 | 294 | { IDS_RELOAD_MENU_LINUX, IDC_RELOAD }, | ||
1020 | 295 | @@ -95,48 +103,48 @@ | ||
1021 | 296 | }; | ||
1022 | 297 | |||
1023 | 298 | GlobalMenuBarCommand history_menu[] = { | ||
1024 | 299 | - { IDS_HISTORY_HOME_LINUX, IDC_HOME }, | ||
1025 | 300 | - { IDS_HISTORY_BACK_LINUX, IDC_BACK }, | ||
1026 | 301 | - { IDS_HISTORY_FORWARD_LINUX, IDC_FORWARD }, | ||
1027 | 302 | + { IDS_HISTORY_HOME_LINUX, IDC_HOME, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1028 | 303 | + { IDS_HISTORY_BACK_LINUX, IDC_BACK, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1029 | 304 | + { IDS_HISTORY_FORWARD_LINUX, IDC_FORWARD, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1030 | 305 | |||
1031 | 306 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1032 | 307 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1033 | 308 | |||
1034 | 309 | { IDS_HISTORY_VISITED_LINUX, MENU_DISABLED_LABEL, | ||
1035 | 310 | - GlobalMenuBar::TAG_MOST_VISITED_HEADER }, | ||
1036 | 311 | + GlobalMenuBar::TAG_MOST_VISITED_HEADER, GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1037 | 312 | |||
1038 | 313 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1039 | 314 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1040 | 315 | |||
1041 | 316 | { IDS_HISTORY_CLOSED_LINUX, MENU_DISABLED_LABEL, | ||
1042 | 317 | - GlobalMenuBar::TAG_RECENTLY_CLOSED_HEADER }, | ||
1043 | 318 | + GlobalMenuBar::TAG_RECENTLY_CLOSED_HEADER, GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1044 | 319 | |||
1045 | 320 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1046 | 321 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1047 | 322 | |||
1048 | 323 | - { IDS_SHOWFULLHISTORY_LINK, IDC_SHOW_HISTORY }, | ||
1049 | 324 | + { IDS_SHOWFULLHISTORY_LINK, IDC_SHOW_HISTORY, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1050 | 325 | |||
1051 | 326 | { MENU_END, MENU_END } | ||
1052 | 327 | }; | ||
1053 | 328 | |||
1054 | 329 | GlobalMenuBarCommand tools_menu[] = { | ||
1055 | 330 | - { IDS_SHOW_DOWNLOADS, IDC_SHOW_DOWNLOADS }, | ||
1056 | 331 | - { IDS_SHOW_HISTORY, IDC_SHOW_HISTORY }, | ||
1057 | 332 | - { IDS_SHOW_EXTENSIONS, IDC_MANAGE_EXTENSIONS }, | ||
1058 | 333 | + { IDS_SHOW_DOWNLOADS, IDC_SHOW_DOWNLOADS, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1059 | 334 | + { IDS_SHOW_HISTORY, IDC_SHOW_HISTORY, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1060 | 335 | + { IDS_SHOW_EXTENSIONS, IDC_MANAGE_EXTENSIONS, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1061 | 336 | |||
1062 | 337 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1063 | 338 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1064 | 339 | |||
1065 | 340 | - { IDS_TASK_MANAGER, IDC_TASK_MANAGER }, | ||
1066 | 341 | - { IDS_CLEAR_BROWSING_DATA, IDC_CLEAR_BROWSING_DATA }, | ||
1067 | 342 | + { IDS_TASK_MANAGER, IDC_TASK_MANAGER, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1068 | 343 | + { IDS_CLEAR_BROWSING_DATA, IDC_CLEAR_BROWSING_DATA, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1069 | 344 | |||
1070 | 345 | - { MENU_SEPARATOR, MENU_SEPARATOR }, | ||
1071 | 346 | + { MENU_SEPARATOR, MENU_SEPARATOR, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1072 | 347 | |||
1073 | 348 | - { IDS_VIEW_SOURCE, IDC_VIEW_SOURCE }, | ||
1074 | 349 | - { IDS_DEV_TOOLS, IDC_DEV_TOOLS }, | ||
1075 | 350 | - { IDS_DEV_TOOLS_CONSOLE, IDC_DEV_TOOLS_CONSOLE }, | ||
1076 | 351 | + { IDS_VIEW_SOURCE, IDC_VIEW_SOURCE, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1077 | 352 | + { IDS_DEV_TOOLS, IDC_DEV_TOOLS, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1078 | 353 | + { IDS_DEV_TOOLS_CONSOLE, IDC_DEV_TOOLS_CONSOLE, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1079 | 354 | |||
1080 | 355 | { MENU_END, MENU_END } | ||
1081 | 356 | }; | ||
1082 | 357 | |||
1083 | 358 | GlobalMenuBarCommand help_menu[] = { | ||
1084 | 359 | - { IDS_FEEDBACK, IDC_FEEDBACK }, | ||
1085 | 360 | + { IDS_FEEDBACK, IDC_FEEDBACK, int(), GlobalMenuBarVisibilityHandler_NotInChromelessMode }, | ||
1086 | 361 | { IDS_HELP_PAGE , IDC_HELP_PAGE }, | ||
1087 | 362 | { MENU_END, MENU_END } | ||
1088 | 363 | }; | ||
1089 | 364 | @@ -190,8 +198,10 @@ | ||
1090 | 365 | } | ||
1091 | 366 | |||
1092 | 367 | pref_change_registrar_.Init(browser_->profile()->GetPrefs()); | ||
1093 | 368 | - pref_change_registrar_.Add(prefs::kShowBookmarkBar, this); | ||
1094 | 369 | - OnBookmarkBarVisibilityChanged(); | ||
1095 | 370 | + if (! browser_->is_chromeless_mode()) { | ||
1096 | 371 | + pref_change_registrar_.Add(prefs::kShowBookmarkBar, this); | ||
1097 | 372 | + OnBookmarkBarVisibilityChanged(); | ||
1098 | 373 | + } | ||
1099 | 374 | } | ||
1100 | 375 | |||
1101 | 376 | GlobalMenuBar::~GlobalMenuBar() { | ||
1102 | 377 | @@ -214,8 +224,22 @@ | ||
1103 | 378 | std::map<int, GtkWidget*>* id_to_menu_item, | ||
1104 | 379 | GlobalMenuBarCommand* commands, | ||
1105 | 380 | GlobalMenuOwner* owner) { | ||
1106 | 381 | + // first pass to count the number of "visible" items | ||
1107 | 382 | + size_t count = 0; | ||
1108 | 383 | + for (int i = 0; commands[i].str_id != MENU_END; ++i) { | ||
1109 | 384 | + if (!commands[i].visibility_handler || commands[i].visibility_handler(browser_)) { | ||
1110 | 385 | + count++; | ||
1111 | 386 | + } | ||
1112 | 387 | + } | ||
1113 | 388 | + if (0 == count) { | ||
1114 | 389 | + return; | ||
1115 | 390 | + } | ||
1116 | 391 | + | ||
1117 | 392 | GtkWidget* menu = gtk_menu_new(); | ||
1118 | 393 | for (int i = 0; commands[i].str_id != MENU_END; ++i) { | ||
1119 | 394 | + if (commands[i].visibility_handler && !commands[i].visibility_handler(browser_)) { | ||
1120 | 395 | + continue; | ||
1121 | 396 | + } | ||
1122 | 397 | GtkWidget* menu_item = BuildMenuItem( | ||
1123 | 398 | commands[i].str_id, commands[i].command, commands[i].tag, | ||
1124 | 399 | id_to_menu_item, menu); | ||
1125 | 400 | Index: src/chrome/browser/ui/browser.cc | ||
1126 | 401 | =================================================================== | ||
1127 | 402 | --- src.orig/chrome/browser/ui/browser.cc 2012-07-07 01:00:04.000000000 -0400 | ||
1128 | 403 | +++ src/chrome/browser/ui/browser.cc 2012-07-12 01:02:11.796401815 -0400 | ||
1129 | 404 | @@ -375,6 +375,7 @@ | ||
1130 | 405 | ALLOW_THIS_IN_INITIALIZER_LIST( | ||
1131 | 406 | tab_strip_model_(new TabStripModel(this, profile))), | ||
1132 | 407 | command_updater_(this), | ||
1133 | 408 | + is_chromeless_mode_(false), | ||
1134 | 409 | app_type_(APP_TYPE_HOST), | ||
1135 | 410 | chrome_updater_factory_(this), | ||
1136 | 411 | is_attempting_to_close_browser_(false), | ||
1137 | 412 | @@ -538,6 +539,15 @@ | ||
1138 | 413 | } | ||
1139 | 414 | |||
1140 | 415 | // static | ||
1141 | 416 | +Browser* Browser::CreateChromeless(Profile * profile) | ||
1142 | 417 | +{ | ||
1143 | 418 | + Browser* browser = new Browser(TYPE_TABBED, profile); | ||
1144 | 419 | + browser->is_chromeless_mode_ = true; | ||
1145 | 420 | + browser->InitBrowserWindow(); | ||
1146 | 421 | + return browser; | ||
1147 | 422 | +} | ||
1148 | 423 | + | ||
1149 | 424 | +// static | ||
1150 | 425 | Browser* Browser::CreateWithParams(const CreateParams& params) { | ||
1151 | 426 | if (!params.app_name.empty()) | ||
1152 | 427 | RegisterAppPrefs(params.app_name, params.profile); | ||
1153 | 428 | @@ -624,6 +634,10 @@ | ||
1154 | 429 | return find_bar_controller_.get() != NULL; | ||
1155 | 430 | } | ||
1156 | 431 | |||
1157 | 432 | +bool Browser::is_chromeless_mode () const { | ||
1158 | 433 | + return is_chromeless_mode_; | ||
1159 | 434 | +} | ||
1160 | 435 | + | ||
1161 | 436 | bool Browser::is_app() const { | ||
1162 | 437 | return !app_name_.empty(); | ||
1163 | 438 | } | ||
1164 | 439 | @@ -1162,7 +1176,7 @@ | ||
1165 | 440 | #else | ||
1166 | 441 | int string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT; | ||
1167 | 442 | // Don't append the app name to window titles on app frames and app popups | ||
1168 | 443 | - if (is_app()) | ||
1169 | 444 | + if (is_app() || is_chromeless_mode()) | ||
1170 | 445 | string_id = IDS_BROWSER_WINDOW_TITLE_FORMAT_NO_LOGO; | ||
1171 | 446 | return l10n_util::GetStringFUTF16(string_id, title); | ||
1172 | 447 | #endif | ||
1173 | 448 | @@ -1230,7 +1244,7 @@ | ||
1174 | 449 | tab_restore_service->BrowserClosing(tab_restore_service_delegate()); | ||
1175 | 450 | #endif | ||
1176 | 451 | |||
1177 | 452 | - if (tab_restore_service && is_type_tabbed() && tab_count()) | ||
1178 | 453 | + if (tab_restore_service && is_type_tabbed() && !is_chromeless_mode() && tab_count()) | ||
1179 | 454 | tab_restore_service->BrowserClosing(tab_restore_service_delegate()); | ||
1180 | 455 | |||
1181 | 456 | // TODO(sky): convert session/tab restore to use notification. | ||
1182 | 457 | @@ -1683,6 +1697,9 @@ | ||
1183 | 458 | void Browser::NewTab() { | ||
1184 | 459 | content::RecordAction(UserMetricsAction("NewTab")); | ||
1185 | 460 | |||
1186 | 461 | + if (is_chromeless_mode()) | ||
1187 | 462 | + return; | ||
1188 | 463 | + | ||
1189 | 464 | if (is_type_tabbed()) { | ||
1190 | 465 | AddBlankTab(true); | ||
1191 | 466 | GetSelectedWebContents()->GetView()->RestoreFocus(); | ||
1192 | 467 | @@ -2962,7 +2979,8 @@ | ||
1193 | 468 | |||
1194 | 469 | void Browser::TabRestoreServiceChanged(TabRestoreService* service) { | ||
1195 | 470 | command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, | ||
1196 | 471 | - !service->entries().empty()); | ||
1197 | 472 | + !service->entries().empty() | ||
1198 | 473 | + && !is_chromeless_mode()); | ||
1199 | 474 | } | ||
1200 | 475 | |||
1201 | 476 | void Browser::TabRestoreServiceDestroyed(TabRestoreService* service) { | ||
1202 | 477 | @@ -3124,7 +3142,7 @@ | ||
1203 | 478 | void Browser::CreateHistoricalTab(TabContentsWrapper* contents) { | ||
1204 | 479 | // We don't create historical tabs for incognito windows or windows without | ||
1205 | 480 | // profiles. | ||
1206 | 481 | - if (!profile() || profile()->IsOffTheRecord()) | ||
1207 | 482 | + if (!profile() || profile()->IsOffTheRecord() || is_chromeless_mode()) | ||
1208 | 483 | return; | ||
1209 | 484 | |||
1210 | 485 | // We don't create historical tabs for print preview tabs. | ||
1211 | 486 | @@ -3833,7 +3851,7 @@ | ||
1212 | 487 | const history::HistoryAddPageArgs& add_page_args, | ||
1213 | 488 | content::NavigationType navigation_type) { | ||
1214 | 489 | // Don't update history if running as app. | ||
1215 | 490 | - return !IsApplication(); | ||
1216 | 491 | + return !IsApplication() && !is_chromeless_mode(); | ||
1217 | 492 | } | ||
1218 | 493 | |||
1219 | 494 | bool Browser::ShouldCreateWebContents( | ||
1220 | 495 | @@ -4377,6 +4395,8 @@ | ||
1221 | 496 | // All browser commands whose state isn't set automagically some other way | ||
1222 | 497 | // (like Back & Forward with initial page load) must have their state | ||
1223 | 498 | // initialized here, otherwise they will be forever disabled. | ||
1224 | 499 | + bool started_in_chromeless = | ||
1225 | 500 | + CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeless); | ||
1226 | 501 | |||
1227 | 502 | // Navigation commands | ||
1228 | 503 | command_updater_.UpdateCommandEnabled(IDC_RELOAD, true); | ||
1229 | 504 | @@ -4384,10 +4404,10 @@ | ||
1230 | 505 | |||
1231 | 506 | // Window management commands | ||
1232 | 507 | command_updater_.UpdateCommandEnabled(IDC_CLOSE_WINDOW, true); | ||
1233 | 508 | - command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, true); | ||
1234 | 509 | + command_updater_.UpdateCommandEnabled(IDC_NEW_TAB, !started_in_chromeless); | ||
1235 | 510 | command_updater_.UpdateCommandEnabled(IDC_CLOSE_TAB, true); | ||
1236 | 511 | - command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); | ||
1237 | 512 | - command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, false); | ||
1238 | 513 | + command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, !started_in_chromeless); | ||
1239 | 514 | + command_updater_.UpdateCommandEnabled(IDC_RESTORE_TAB, !started_in_chromeless); | ||
1240 | 515 | command_updater_.UpdateCommandEnabled(IDC_EXIT, true); | ||
1241 | 516 | command_updater_.UpdateCommandEnabled(IDC_DEBUG_FRAME_TOGGLE, true); | ||
1242 | 517 | |||
1243 | 518 | @@ -4442,23 +4462,27 @@ | ||
1244 | 519 | UpdateOpenFileState(); | ||
1245 | 520 | command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); | ||
1246 | 521 | UpdateCommandsForDevTools(); | ||
1247 | 522 | - command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); | ||
1248 | 523 | - command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, true); | ||
1249 | 524 | - command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); | ||
1250 | 525 | + command_updater_.UpdateCommandEnabled(IDC_TASK_MANAGER, !started_in_chromeless); | ||
1251 | 526 | + command_updater_.UpdateCommandEnabled(IDC_SHOW_HISTORY, !started_in_chromeless); | ||
1252 | 527 | + command_updater_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, !started_in_chromeless); | ||
1253 | 528 | command_updater_.UpdateCommandEnabled(IDC_HELP_PAGE, true); | ||
1254 | 529 | - command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, true); | ||
1255 | 530 | + command_updater_.UpdateCommandEnabled(IDC_BOOKMARKS_MENU, !started_in_chromeless); | ||
1256 | 531 | |||
1257 | 532 | #if defined(OS_CHROMEOS) | ||
1258 | 533 | command_updater_.UpdateCommandEnabled(IDC_SHOW_KEYBOARD_OVERLAY, true); | ||
1259 | 534 | #endif | ||
1260 | 535 | command_updater_.UpdateCommandEnabled( | ||
1261 | 536 | - IDC_SHOW_SYNC_SETUP, profile_->GetOriginalProfile()->IsSyncAccessible()); | ||
1262 | 537 | + IDC_SHOW_SYNC_SETUP, | ||
1263 | 538 | + profile_->GetOriginalProfile()->IsSyncAccessible() | ||
1264 | 539 | + && !started_in_chromeless); | ||
1265 | 540 | |||
1266 | 541 | // Initialize other commands based on the window type. | ||
1267 | 542 | bool normal_window = is_type_tabbed(); | ||
1268 | 543 | |||
1269 | 544 | // Navigation commands | ||
1270 | 545 | - command_updater_.UpdateCommandEnabled(IDC_HOME, normal_window); | ||
1271 | 546 | + command_updater_.UpdateCommandEnabled(IDC_HOME, | ||
1272 | 547 | + normal_window | ||
1273 | 548 | + && !started_in_chromeless); | ||
1274 | 549 | |||
1275 | 550 | // Window management commands | ||
1276 | 551 | // TODO(rohitrao): Disable fullscreen on non-Lion? | ||
1277 | 552 | @@ -4493,7 +4517,9 @@ | ||
1278 | 553 | command_updater_.UpdateCommandEnabled(IDC_FIND_PREVIOUS, !is_devtools()); | ||
1279 | 554 | |||
1280 | 555 | // Show various bits of UI | ||
1281 | 556 | - command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, normal_window); | ||
1282 | 557 | + command_updater_.UpdateCommandEnabled(IDC_CLEAR_BROWSING_DATA, | ||
1283 | 558 | + normal_window && | ||
1284 | 559 | + !started_in_chromeless); | ||
1285 | 560 | |||
1286 | 561 | // The upgrade entry and the view incompatibility entry should always be | ||
1287 | 562 | // enabled. Whether they are visible is a separate matter determined on menu | ||
1288 | 563 | @@ -4519,14 +4545,20 @@ | ||
1289 | 564 | } | ||
1290 | 565 | |||
1291 | 566 | void Browser::UpdateCommandsForIncognitoAvailability() { | ||
1292 | 567 | + bool started_in_chromeless = | ||
1293 | 568 | + CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeless) | ||
1294 | 569 | + || is_chromeless_mode(); | ||
1295 | 570 | + | ||
1296 | 571 | IncognitoModePrefs::Availability incognito_availability = | ||
1297 | 572 | IncognitoModePrefs::GetAvailability(profile_->GetPrefs()); | ||
1298 | 573 | command_updater_.UpdateCommandEnabled( | ||
1299 | 574 | IDC_NEW_WINDOW, | ||
1300 | 575 | - incognito_availability != IncognitoModePrefs::FORCED); | ||
1301 | 576 | + incognito_availability != IncognitoModePrefs::FORCED && | ||
1302 | 577 | + !started_in_chromeless); | ||
1303 | 578 | command_updater_.UpdateCommandEnabled( | ||
1304 | 579 | IDC_NEW_INCOGNITO_WINDOW, | ||
1305 | 580 | - incognito_availability != IncognitoModePrefs::DISABLED); | ||
1306 | 581 | + incognito_availability != IncognitoModePrefs::DISABLED && | ||
1307 | 582 | + !started_in_chromeless); | ||
1308 | 583 | |||
1309 | 584 | // Bookmark manager and settings page/subpages are forced to open in normal | ||
1310 | 585 | // mode. For this reason we disable these commands when incognito is forced. | ||
1311 | 586 | @@ -4534,18 +4566,22 @@ | ||
1312 | 587 | incognito_availability != IncognitoModePrefs::FORCED; | ||
1313 | 588 | command_updater_.UpdateCommandEnabled( | ||
1314 | 589 | IDC_SHOW_BOOKMARK_MANAGER, | ||
1315 | 590 | - browser_defaults::bookmarks_enabled && command_enabled); | ||
1316 | 591 | + browser_defaults::bookmarks_enabled && | ||
1317 | 592 | + command_enabled && !started_in_chromeless); | ||
1318 | 593 | ExtensionService* extension_service = profile()->GetExtensionService(); | ||
1319 | 594 | bool enable_extensions = | ||
1320 | 595 | extension_service && extension_service->extensions_enabled(); | ||
1321 | 596 | command_updater_.UpdateCommandEnabled(IDC_MANAGE_EXTENSIONS, | ||
1322 | 597 | - enable_extensions && command_enabled); | ||
1323 | 598 | + enable_extensions && command_enabled | ||
1324 | 599 | + && !started_in_chromeless); | ||
1325 | 600 | |||
1326 | 601 | const bool show_main_ui = IsShowingMainUI(window_ && window_->IsFullscreen()); | ||
1327 | 602 | command_updater_.UpdateCommandEnabled(IDC_IMPORT_SETTINGS, | ||
1328 | 603 | - show_main_ui && command_enabled); | ||
1329 | 604 | + show_main_ui && command_enabled | ||
1330 | 605 | + && !started_in_chromeless); | ||
1331 | 606 | command_updater_.UpdateCommandEnabled(IDC_OPTIONS, | ||
1332 | 607 | - show_main_ui && command_enabled); | ||
1333 | 608 | + show_main_ui && command_enabled | ||
1334 | 609 | + && !started_in_chromeless); | ||
1335 | 610 | } | ||
1336 | 611 | |||
1337 | 612 | void Browser::UpdateCommandsForTabState() { | ||
1338 | 613 | @@ -4565,16 +4601,19 @@ | ||
1339 | 614 | |||
1340 | 615 | // Window management commands | ||
1341 | 616 | command_updater_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, | ||
1342 | 617 | - !is_app() && CanDuplicateContentsAt(active_index())); | ||
1343 | 618 | + !is_chromeless_mode() && !is_app() | ||
1344 | 619 | + && CanDuplicateContentsAt(active_index())); | ||
1345 | 620 | |||
1346 | 621 | // Page-related commands | ||
1347 | 622 | window_->SetStarredState( | ||
1348 | 623 | current_tab_wrapper->bookmark_tab_helper()->is_starred()); | ||
1349 | 624 | command_updater_.UpdateCommandEnabled(IDC_VIEW_SOURCE, | ||
1350 | 625 | - current_tab->GetController().CanViewSource()); | ||
1351 | 626 | + current_tab->GetController().CanViewSource() | ||
1352 | 627 | + && !is_chromeless_mode()); | ||
1353 | 628 | command_updater_.UpdateCommandEnabled(IDC_EMAIL_PAGE_LOCATION, | ||
1354 | 629 | - toolbar_model_->ShouldDisplayURL() && current_tab->GetURL().is_valid()); | ||
1355 | 630 | - if (is_devtools()) | ||
1356 | 631 | + toolbar_model_->ShouldDisplayURL() && current_tab->GetURL().is_valid() | ||
1357 | 632 | + && !is_chromeless_mode()); | ||
1358 | 633 | + if (is_devtools() || is_chromeless_mode()) | ||
1359 | 634 | command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, false); | ||
1360 | 635 | |||
1361 | 636 | // Changing the encoding is not possible on Chrome-internal webpages. | ||
1362 | 637 | @@ -4588,7 +4627,8 @@ | ||
1363 | 638 | // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | ||
1364 | 639 | #if !defined(OS_MACOSX) | ||
1365 | 640 | command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, | ||
1366 | 641 | - web_app::IsValidUrl(current_tab->GetURL())); | ||
1367 | 642 | + web_app::IsValidUrl(current_tab->GetURL()) | ||
1368 | 643 | + && !is_chromeless_mode()); | ||
1369 | 644 | #endif | ||
1370 | 645 | |||
1371 | 646 | UpdateCommandsForContentRestrictionState(); | ||
1372 | 647 | @@ -4620,9 +4660,14 @@ | ||
1373 | 648 | } | ||
1374 | 649 | |||
1375 | 650 | void Browser::UpdateCommandsForBookmarkEditing() { | ||
1376 | 651 | + bool started_in_chromeless = | ||
1377 | 652 | + CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeless) | ||
1378 | 653 | + || is_chromeless_mode(); | ||
1379 | 654 | + | ||
1380 | 655 | bool enabled = | ||
1381 | 656 | profile_->GetPrefs()->GetBoolean(prefs::kEditBookmarksEnabled) && | ||
1382 | 657 | - browser_defaults::bookmarks_enabled; | ||
1383 | 658 | + browser_defaults::bookmarks_enabled && | ||
1384 | 659 | + !started_in_chromeless; | ||
1385 | 660 | |||
1386 | 661 | command_updater_.UpdateCommandEnabled(IDC_BOOKMARK_PAGE, | ||
1387 | 662 | enabled && is_type_tabbed()); | ||
1388 | 663 | @@ -4748,7 +4793,12 @@ | ||
1389 | 664 | if (local_state) | ||
1390 | 665 | enabled = local_state->GetBoolean(prefs::kAllowFileSelectionDialogs); | ||
1391 | 666 | |||
1392 | 667 | - command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, enabled); | ||
1393 | 668 | + bool started_in_chromeless = | ||
1394 | 669 | + CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeless) | ||
1395 | 670 | + || is_chromeless_mode(); | ||
1396 | 671 | + | ||
1397 | 672 | + command_updater_.UpdateCommandEnabled(IDC_OPEN_FILE, | ||
1398 | 673 | + enabled && !started_in_chromeless); | ||
1399 | 674 | } | ||
1400 | 675 | |||
1401 | 676 | void Browser::UpdateReloadStopState(bool is_loading, bool force) { | ||
1402 | 677 | @@ -4863,7 +4913,8 @@ | ||
1403 | 678 | // on the Mac. Be sure to remove both ifdefs. http://crbug.com/13148 | ||
1404 | 679 | #if !defined(OS_MACOSX) | ||
1405 | 680 | command_updater_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, | ||
1406 | 681 | - web_app::IsValidUrl(contents->GetURL())); | ||
1407 | 682 | + web_app::IsValidUrl(contents->GetURL()) | ||
1408 | 683 | + && !is_chromeless_mode()); | ||
1409 | 684 | #endif | ||
1410 | 685 | window_->UpdateTitleBar(); | ||
1411 | 686 | } | ||
1412 | 687 | @@ -5211,20 +5262,20 @@ | ||
1413 | 688 | |||
1414 | 689 | unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; | ||
1415 | 690 | |||
1416 | 691 | - if (is_type_tabbed()) | ||
1417 | 692 | + if (is_type_tabbed() && !is_chromeless_mode()) | ||
1418 | 693 | features |= FEATURE_BOOKMARKBAR; | ||
1419 | 694 | |||
1420 | 695 | if (!hide_ui_for_fullscreen) { | ||
1421 | 696 | - if (!is_type_tabbed()) | ||
1422 | 697 | + if (!is_type_tabbed() && !is_chromeless_mode()) | ||
1423 | 698 | features |= FEATURE_TITLEBAR; | ||
1424 | 699 | |||
1425 | 700 | if (is_type_tabbed()) | ||
1426 | 701 | features |= FEATURE_TABSTRIP; | ||
1427 | 702 | |||
1428 | 703 | - if (is_type_tabbed()) | ||
1429 | 704 | + if (is_type_tabbed() && !is_chromeless_mode()) | ||
1430 | 705 | features |= FEATURE_TOOLBAR; | ||
1431 | 706 | |||
1432 | 707 | - if (!is_app()) | ||
1433 | 708 | + if (!is_app() && !is_chromeless_mode()) | ||
1434 | 709 | features |= FEATURE_LOCATIONBAR; | ||
1435 | 710 | } | ||
1436 | 711 | return !!(features & feature); | ||
1437 | 712 | Index: src/chrome/browser/extensions/extension_module.h | ||
1438 | 713 | =================================================================== | ||
1439 | 714 | --- src.orig/chrome/browser/extensions/extension_module.h 2012-07-07 00:59:55.000000000 -0400 | ||
1440 | 715 | +++ src/chrome/browser/extensions/extension_module.h 2012-07-11 23:49:59.240259276 -0400 | ||
1441 | 716 | @@ -46,4 +46,10 @@ | ||
1442 | 717 | virtual bool RunImpl() OVERRIDE; | ||
1443 | 718 | }; | ||
1444 | 719 | |||
1445 | 720 | +class IsChromelessWindowFunction : public SyncExtensionFunction { | ||
1446 | 721 | + protected: | ||
1447 | 722 | + virtual bool RunImpl() OVERRIDE; | ||
1448 | 723 | + DECLARE_EXTENSION_FUNCTION_NAME("extension.isChromelessWindow"); | ||
1449 | 724 | +}; | ||
1450 | 725 | + | ||
1451 | 726 | #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_MODULE_H__ | ||
1452 | 727 | Index: src/chrome/browser/extensions/extension_module.cc | ||
1453 | 728 | =================================================================== | ||
1454 | 729 | --- src.orig/chrome/browser/extensions/extension_module.cc 2012-07-07 00:59:55.000000000 -0400 | ||
1455 | 730 | +++ src/chrome/browser/extensions/extension_module.cc 2012-07-11 23:49:59.240259276 -0400 | ||
1456 | 731 | @@ -6,9 +6,27 @@ | ||
1457 | 732 | |||
1458 | 733 | #include <string> | ||
1459 | 734 | |||
1460 | 735 | +#if defined(OS_LINUX) && defined(TOOLKIT_GTK) | ||
1461 | 736 | +#include <gdk/gdk.h> | ||
1462 | 737 | +#include <gdk/gdkx.h> | ||
1463 | 738 | +#endif | ||
1464 | 739 | + | ||
1465 | 740 | #include "chrome/browser/extensions/extension_prefs.h" | ||
1466 | 741 | #include "chrome/browser/extensions/extension_service.h" | ||
1467 | 742 | +#include "chrome/browser/ui/browser.h" | ||
1468 | 743 | +#include "chrome/browser/ui/browser_window.h" | ||
1469 | 744 | #include "chrome/browser/profiles/profile.h" | ||
1470 | 745 | +#include "chrome/common/chrome_switches.h" | ||
1471 | 746 | + | ||
1472 | 747 | +#if defined(OS_LINUX) && defined(TOOLKIT_GTK) | ||
1473 | 748 | + | ||
1474 | 749 | +namespace { | ||
1475 | 750 | + | ||
1476 | 751 | +const char kNoCurrentWindowError[] = "No current window"; | ||
1477 | 752 | + | ||
1478 | 753 | +} // namespace { | ||
1479 | 754 | + | ||
1480 | 755 | +#endif | ||
1481 | 756 | |||
1482 | 757 | ExtensionPrefs* SetUpdateUrlDataFunction::extension_prefs() { | ||
1483 | 758 | return profile()->GetExtensionService()->extension_prefs(); | ||
1484 | 759 | @@ -39,3 +57,18 @@ | ||
1485 | 760 | ext_service->AllowFileAccess(extension))); | ||
1486 | 761 | return true; | ||
1487 | 762 | } | ||
1488 | 763 | + | ||
1489 | 764 | +bool IsChromelessWindowFunction::RunImpl() { | ||
1490 | 765 | + Browser* browser = GetCurrentBrowser(); | ||
1491 | 766 | + if (!browser || !browser->window() || !browser->window()->GetNativeHandle()) { | ||
1492 | 767 | + error_ = kNoCurrentWindowError; | ||
1493 | 768 | + return false; | ||
1494 | 769 | + } | ||
1495 | 770 | + // TODO: quite brittle, what about tab moves/undock? | ||
1496 | 771 | + // rather rely on proper browser_window type. | ||
1497 | 772 | + // TODO: should be run on a specific thread? | ||
1498 | 773 | + const CommandLine& browser_command_line = *CommandLine::ForCurrentProcess(); | ||
1499 | 774 | + result_.reset(Value::CreateBooleanValue( | ||
1500 | 775 | + browser_command_line.HasSwitch(switches::kChromeless))); | ||
1501 | 776 | + return true; | ||
1502 | 777 | +} | ||
1503 | 778 | Index: src/chrome/common/extensions/api/extension.json | ||
1504 | 779 | =================================================================== | ||
1505 | 780 | --- src.orig/chrome/common/extensions/api/extension.json 2012-07-07 01:01:17.000000000 -0400 | ||
1506 | 781 | +++ src/chrome/common/extensions/api/extension.json 2012-07-11 23:49:59.240259276 -0400 | ||
1507 | 782 | @@ -205,6 +205,24 @@ | ||
1508 | 783 | } | ||
1509 | 784 | }, | ||
1510 | 785 | { | ||
1511 | 786 | + "name": "isChromelessWindow", | ||
1512 | 787 | + "type": "function", | ||
1513 | 788 | + "description": "Checks is a given extension runs part of a chromeless window.", | ||
1514 | 789 | + "parameters": [ | ||
1515 | 790 | + { | ||
1516 | 791 | + "type": "function", | ||
1517 | 792 | + "name": "callback", | ||
1518 | 793 | + "parameters": [ | ||
1519 | 794 | + { | ||
1520 | 795 | + "name": "isChromelessWindow", | ||
1521 | 796 | + "type": "boolean", | ||
1522 | 797 | + "description": "True if the extension runs part of a chromeless window, false otherwise." | ||
1523 | 798 | + } | ||
1524 | 799 | + ] | ||
1525 | 800 | + } | ||
1526 | 801 | + ] | ||
1527 | 802 | + }, | ||
1528 | 803 | + { | ||
1529 | 804 | "name": "isAllowedIncognitoAccess", | ||
1530 | 805 | "type": "function", | ||
1531 | 806 | "description": "Retrieves the state of the extension's access to Incognito-mode (as determined by the user-controlled 'Allowed in Incognito' checkbox.", | ||
1532 | 807 | Index: src/chrome/common/chrome_switches.h | ||
1533 | 808 | =================================================================== | ||
1534 | 809 | --- src.orig/chrome/common/chrome_switches.h 2012-07-07 01:01:17.000000000 -0400 | ||
1535 | 810 | +++ src/chrome/common/chrome_switches.h 2012-07-11 23:49:59.244259276 -0400 | ||
1536 | 811 | @@ -53,6 +53,7 @@ | ||
1537 | 812 | extern const char kCheckForUpdateIntervalSec[]; | ||
1538 | 813 | extern const char kCheckCloudPrintConnectorPolicy[]; | ||
1539 | 814 | extern const char kChromeFrameShutdownDelay[]; | ||
1540 | 815 | +extern const char kChromeless[]; | ||
1541 | 816 | extern const char kChromeVersion[]; | ||
1542 | 817 | extern const char kCipherSuiteBlacklist[]; | ||
1543 | 818 | extern const char kClearTokenService[]; | ||
1544 | 819 | Index: src/chrome/common/chrome_switches.cc | ||
1545 | 820 | =================================================================== | ||
1546 | 821 | --- src.orig/chrome/common/chrome_switches.cc 2012-07-07 01:01:18.000000000 -0400 | ||
1547 | 822 | +++ src/chrome/common/chrome_switches.cc 2012-07-11 23:49:59.244259276 -0400 | ||
1548 | 823 | @@ -138,6 +138,9 @@ | ||
1549 | 824 | // Chrome Frame automation channel is closed. | ||
1550 | 825 | const char kChromeFrameShutdownDelay[] = "chrome-frame-shutdown-delay"; | ||
1551 | 826 | |||
1552 | 827 | +// Specifies a given URL to be opened in a chromeless mode. | ||
1553 | 828 | +const char kChromeless[] = "chromeless"; | ||
1554 | 829 | + | ||
1555 | 830 | // Tells chrome to load the specified version of chrome.dll on Windows. If this | ||
1556 | 831 | // version cannot be loaded, Chrome will exit. | ||
1557 | 832 | const char kChromeVersion[] = "chrome-version"; | ||
1558 | 833 | alex@alex-Gazelle-Professional:~/dev/work/chromium/r20.0.1132.47/src$ svn diff chrome/browser/sessions/session_service.cc | ||
1559 | 834 | Index: chrome/browser/sessions/session_service.cc | ||
1560 | 835 | =================================================================== | ||
1561 | 836 | --- src.orig/chrome/browser/sessions/session_service.cc (revision 136242) | ||
1562 | 837 | +++ src/chrome/browser/sessions/session_service.cc (working copy) | ||
1563 | 838 | @@ -32,6 +32,7 @@ | ||
1564 | 839 | #include "chrome/browser/ui/browser_window.h" | ||
1565 | 840 | #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | ||
1566 | 841 | #include "chrome/common/chrome_notification_types.h" | ||
1567 | 842 | +#include "chrome/common/chrome_switches.h" | ||
1568 | 843 | #include "chrome/common/extensions/extension.h" | ||
1569 | 844 | #include "content/public/browser/navigation_details.h" | ||
1570 | 845 | #include "content/public/browser/navigation_entry.h" | ||
1571 | 846 | @@ -579,6 +580,14 @@ | ||
1572 | 847 | if (browser->profile() != profile() || | ||
1573 | 848 | !should_track_changes_for_browser_type(browser->type(), app_type)) | ||
1574 | 849 | return; | ||
1575 | 850 | + | ||
1576 | 851 | + // Do not track changes for chromeless windows so that | ||
1577 | 852 | + // it won't be considered for restoration during a 'normal' browser | ||
1578 | 853 | + // instance. | ||
1579 | 854 | + if (browser->is_chromeless_mode() || | ||
1580 | 855 | + CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeless)) { | ||
1581 | 856 | + return; | ||
1582 | 857 | + } | ||
1583 | 858 | |||
1584 | 859 | RestoreIfNecessary(std::vector<GURL>(), browser); | ||
1585 | 860 | SetWindowType(browser->session_id(), browser->type(), app_type); | ||
1586 | 0 | 861 | ||
1587 | === added file 'debian/patches/desktop-integration-settings.patch' | |||
1588 | --- debian/patches/desktop-integration-settings.patch 1970-01-01 00:00:00 +0000 | |||
1589 | +++ debian/patches/desktop-integration-settings.patch 2012-08-06 17:52:22 +0000 | |||
1590 | @@ -0,0 +1,1031 @@ | |||
1591 | 1 | Index: src/chrome/chrome_browser.gypi | ||
1592 | 2 | =================================================================== | ||
1593 | 3 | --- src.orig/chrome/chrome_browser.gypi 2012-07-31 14:30:37.000000000 -0400 | ||
1594 | 4 | +++ src/chrome/chrome_browser.gypi 2012-07-31 14:34:57.786804291 -0400 | ||
1595 | 5 | @@ -3803,6 +3803,8 @@ | ||
1596 | 6 | 'browser/ui/webui/options2/cookies_view_handler2.h', | ||
1597 | 7 | 'browser/ui/webui/options2/core_options_handler2.cc', | ||
1598 | 8 | 'browser/ui/webui/options2/core_options_handler2.h', | ||
1599 | 9 | + 'browser/ui/webui/options2/desktop_integration_settings_handler2.cc', | ||
1600 | 10 | + 'browser/ui/webui/options2/desktop_integration_settings_handler2.h', | ||
1601 | 11 | 'browser/ui/webui/options2/font_settings_handler2.cc', | ||
1602 | 12 | 'browser/ui/webui/options2/font_settings_handler2.h', | ||
1603 | 13 | 'browser/ui/webui/options2/font_settings_utils2.h', | ||
1604 | 14 | Index: src/chrome/app/generated_resources.grd | ||
1605 | 15 | =================================================================== | ||
1606 | 16 | --- src.orig/chrome/app/generated_resources.grd 2012-07-31 14:30:37.000000000 -0400 | ||
1607 | 17 | +++ src/chrome/app/generated_resources.grd 2012-07-31 14:34:57.794804290 -0400 | ||
1608 | 18 | @@ -10402,6 +10402,9 @@ | ||
1609 | 19 | <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT"> | ||
1610 | 20 | Web content | ||
1611 | 21 | </message> | ||
1612 | 22 | + <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_INTEGRATION"> | ||
1613 | 23 | + Desktop Integration | ||
1614 | 24 | + </message> | ||
1615 | 25 | <message name="IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY"> | ||
1616 | 26 | HTTPS/SSL | ||
1617 | 27 | </message> | ||
1618 | 28 | @@ -16033,6 +16036,35 @@ | ||
1619 | 29 | </message> | ||
1620 | 30 | </if> | ||
1621 | 31 | |||
1622 | 32 | + <!-- Desktop integration --> | ||
1623 | 33 | + <message name="IDS_PROMPT_INTEGRATION_ENABLE_BUTTON_LABEL" desc="The text to be displayed on the checkbox that enables desktop integration."> | ||
1624 | 34 | + Prompt integration options for any website | ||
1625 | 35 | + </message> | ||
1626 | 36 | + <message name="IDS_DESKTOP_INTEGRATION_SETTINGS_EXCEPTIONS_BUTTON_LABEL" desc="The text to be displayed on the button that drives integration exceptions."> | ||
1627 | 37 | + Exceptions... | ||
1628 | 38 | + </message> | ||
1629 | 39 | + <message name="IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_TITLE" desc="Title for the desktop integration overlay."> | ||
1630 | 40 | + Integration prompt exceptions | ||
1631 | 41 | + </message> | ||
1632 | 42 | + <message name="IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_DESCRIPTION" desc="Description for the desktop integration overlay."> | ||
1633 | 43 | + These websites won't prompt any integration options | ||
1634 | 44 | + </message> | ||
1635 | 45 | + <message name="IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_COLUMN_DESCRIPTION" desc="Description of the desktop integration overlay's integrated websites list column."> | ||
1636 | 46 | + Website domains | ||
1637 | 47 | + </message> | ||
1638 | 48 | + <message name="IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_BUTTON" | ||
1639 | 49 | + desc="The label for the add button for adding a integration websites"> | ||
1640 | 50 | + Add | ||
1641 | 51 | + </message> | ||
1642 | 52 | + <message name="IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_TEXT" | ||
1643 | 53 | + desc="The description text for the add overlay for adding a integration websites"> | ||
1644 | 54 | + Website domain name (e.g. www.html5rocks.com) | ||
1645 | 55 | + </message> | ||
1646 | 56 | + <message name="IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_TITLE" | ||
1647 | 57 | + desc="Title for add overlay for adding a integration websites"> | ||
1648 | 58 | + Add Integrated Website | ||
1649 | 59 | + </message> | ||
1650 | 60 | + | ||
1651 | 61 | <!-- Manage Profile Dialog --> | ||
1652 | 62 | <message name="IDS_PROFILES_MANAGE_TITLE" desc="Title of the manage profile dialog"> | ||
1653 | 63 | Edit user | ||
1654 | 64 | Index: src/chrome/browser/resources/options2/options.html | ||
1655 | 65 | =================================================================== | ||
1656 | 66 | --- src.orig/chrome/browser/resources/options2/options.html 2012-07-31 14:30:37.000000000 -0400 | ||
1657 | 67 | +++ src/chrome/browser/resources/options2/options.html 2012-07-31 14:35:18.746804981 -0400 | ||
1658 | 68 | @@ -19,6 +19,7 @@ | ||
1659 | 69 | <link rel="stylesheet" href="clear_browser_data_overlay.css"> | ||
1660 | 70 | <link rel="stylesheet" href="content_settings.css"> | ||
1661 | 71 | <link rel="stylesheet" href="cookies_view.css"> | ||
1662 | 72 | +<link rel="stylesheet" href="desktop_integration_overlay.css"> | ||
1663 | 73 | <link rel="stylesheet" href="font_settings.css"> | ||
1664 | 74 | <if expr="pp_ifdef('enable_register_protocol_handler')"> | ||
1665 | 75 | <link rel="stylesheet" href="handler_options.css"> | ||
1666 | 76 | @@ -87,6 +88,7 @@ | ||
1667 | 77 | <include src="font_settings.html"> | ||
1668 | 78 | <include src="home_page_overlay.html"> | ||
1669 | 79 | <include src="import_data_overlay.html"> | ||
1670 | 80 | + <include src="desktop_integration_overlay.html"> | ||
1671 | 81 | <include src="instant_confirm_overlay.html"> | ||
1672 | 82 | <include src="language_options.html"> | ||
1673 | 83 | <include src="manage_profile_overlay.html"> | ||
1674 | 84 | @@ -117,6 +119,7 @@ | ||
1675 | 85 | <include src="autofill_edit_creditcard_overlay.html"> | ||
1676 | 86 | <include src="content_settings_exceptions_area.html"> | ||
1677 | 87 | <include src="cookies_view.html"> | ||
1678 | 88 | + <include src="desktop_integration_add_website_overlay.html"> | ||
1679 | 89 | <include src="language_add_language_overlay.html"> | ||
1680 | 90 | <if expr="pp_ifdef('chromeos')"> | ||
1681 | 91 | <include src="chromeos/internet_detail.html"> | ||
1682 | 92 | Index: src/chrome/browser/resources/options2/options.js | ||
1683 | 93 | =================================================================== | ||
1684 | 94 | --- src.orig/chrome/browser/resources/options2/options.js 2012-07-31 14:30:37.000000000 -0400 | ||
1685 | 95 | +++ src/chrome/browser/resources/options2/options.js 2012-07-31 14:34:57.794804290 -0400 | ||
1686 | 96 | @@ -13,6 +13,8 @@ | ||
1687 | 97 | var ContentSettingsExceptionsArea = | ||
1688 | 98 | options.contentSettings.ContentSettingsExceptionsArea; | ||
1689 | 99 | var CookiesView = options.CookiesView; | ||
1690 | 100 | +var DesktopIntegrationOverlay = options.DesktopIntegrationOverlay; | ||
1691 | 101 | +var AddDesktopIntegrationWebsiteOverlay = options.AddDesktopIntegrationWebsiteOverlay; | ||
1692 | 102 | var FontSettings = options.FontSettings; | ||
1693 | 103 | var HandlerOptions = options.HandlerOptions; | ||
1694 | 104 | var HomePageOverlay = options.HomePageOverlay; | ||
1695 | 105 | @@ -84,6 +86,13 @@ | ||
1696 | 106 | OptionsPage.registerOverlay(FontSettings.getInstance(), | ||
1697 | 107 | BrowserOptions.getInstance(), | ||
1698 | 108 | [$('fontSettingsCustomizeFontsButton')]); | ||
1699 | 109 | + if (cr.isLinux && !cr.isChromeos) { | ||
1700 | 110 | + OptionsPage.registerOverlay(AddDesktopIntegrationWebsiteOverlay.getInstance(), | ||
1701 | 111 | + DesktopIntegrationOverlay.getInstance()); | ||
1702 | 112 | + OptionsPage.registerOverlay(DesktopIntegrationOverlay.getInstance(), | ||
1703 | 113 | + BrowserOptions.getInstance(), | ||
1704 | 114 | + [$('desktop-integration-button')]); | ||
1705 | 115 | + } | ||
1706 | 116 | if (HandlerOptions && $('manage-handlers-button')) { | ||
1707 | 117 | OptionsPage.registerOverlay(HandlerOptions.getInstance(), | ||
1708 | 118 | ContentSettings.getInstance(), | ||
1709 | 119 | Index: src/chrome/browser/resources/options2/desktop_integration_add_website_overlay.html | ||
1710 | 120 | =================================================================== | ||
1711 | 121 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1712 | 122 | +++ src/chrome/browser/resources/options2/desktop_integration_add_website_overlay.html 2012-07-31 14:34:57.794804290 -0400 | ||
1713 | 123 | @@ -0,0 +1,16 @@ | ||
1714 | 124 | +<div id="add-desktop-integration-website-overlay-page" class="page" hidden> | ||
1715 | 125 | + <div class="close-button"></div> | ||
1716 | 126 | + <h1 i18n-content="add_desktop_website_title"></h1> | ||
1717 | 127 | + | ||
1718 | 128 | + <div class="content-area"> | ||
1719 | 129 | + <span i18n-content="add_desktop_website_input_label"></span> | ||
1720 | 130 | + <input id="website-url-field" type="url" data-type="url" | ||
1721 | 131 | + class="weakrtl favicon-cell hbox stretch"> | ||
1722 | 132 | + </div> | ||
1723 | 133 | + | ||
1724 | 134 | + <div class="action-area button-strip"> | ||
1725 | 135 | + <button id="add-integration-website-overlay-cancel-button" i18n-content="cancel"> | ||
1726 | 136 | + </button> | ||
1727 | 137 | + <button id="add-integration-website-overlay-ok-button" i18n-content="ok"></button> | ||
1728 | 138 | + </div> | ||
1729 | 139 | +</div> | ||
1730 | 140 | Index: src/chrome/browser/resources/options2/desktop_integration_add_website_overlay.js | ||
1731 | 141 | =================================================================== | ||
1732 | 142 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1733 | 143 | +++ src/chrome/browser/resources/options2/desktop_integration_add_website_overlay.js 2012-07-31 14:34:57.794804290 -0400 | ||
1734 | 144 | @@ -0,0 +1,44 @@ | ||
1735 | 145 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
1736 | 146 | +// Use of this source code is governed by a BSD-style license that can be | ||
1737 | 147 | +// found in the LICENSE file. | ||
1738 | 148 | + | ||
1739 | 149 | +/////////////////////////////////////////////////////////////////////////////// | ||
1740 | 150 | +// AddDesktopIntegrationWebsiteOverlay class: | ||
1741 | 151 | + | ||
1742 | 152 | +cr.define('options', function() { | ||
1743 | 153 | + /** @const */ var OptionsPage = options.OptionsPage; | ||
1744 | 154 | + | ||
1745 | 155 | + /** | ||
1746 | 156 | + * @constructor | ||
1747 | 157 | + */ | ||
1748 | 158 | + function AddDesktopIntegrationWebsiteOverlay() { | ||
1749 | 159 | + OptionsPage.call(this, 'addDesktopIntegrationWebsite', | ||
1750 | 160 | + localStrings.getString('add_button'), | ||
1751 | 161 | + 'add-desktop-integration-website-overlay-page'); | ||
1752 | 162 | + } | ||
1753 | 163 | + | ||
1754 | 164 | + cr.addSingletonGetter(AddDesktopIntegrationWebsiteOverlay); | ||
1755 | 165 | + | ||
1756 | 166 | + AddDesktopIntegrationWebsiteOverlay.prototype = { | ||
1757 | 167 | + // Inherit AddDesktopIntegrationWebsiteOverlay from OptionsPage. | ||
1758 | 168 | + __proto__: OptionsPage.prototype, | ||
1759 | 169 | + | ||
1760 | 170 | + /** | ||
1761 | 171 | + * Initializes AddDesktopIntegrationWebsiteOverlay page. | ||
1762 | 172 | + * Calls base class implementation to starts preference initialization. | ||
1763 | 173 | + */ | ||
1764 | 174 | + initializePage: function() { | ||
1765 | 175 | + // Call base class implementation to starts preference initialization. | ||
1766 | 176 | + OptionsPage.prototype.initializePage.call(this); | ||
1767 | 177 | + | ||
1768 | 178 | + // Set up the cancel button. | ||
1769 | 179 | + $('add-integration-website-overlay-cancel-button').onclick = function(e) { | ||
1770 | 180 | + OptionsPage.closeOverlay(); | ||
1771 | 181 | + }; | ||
1772 | 182 | + }, | ||
1773 | 183 | + }; | ||
1774 | 184 | + | ||
1775 | 185 | + return { | ||
1776 | 186 | + AddDesktopIntegrationWebsiteOverlay: AddDesktopIntegrationWebsiteOverlay | ||
1777 | 187 | + }; | ||
1778 | 188 | +}); | ||
1779 | 189 | Index: src/chrome/browser/resources/options2/options_bundle.js | ||
1780 | 190 | =================================================================== | ||
1781 | 191 | --- src.orig/chrome/browser/resources/options2/options_bundle.js 2012-07-31 14:30:37.000000000 -0400 | ||
1782 | 192 | +++ src/chrome/browser/resources/options2/options_bundle.js 2012-07-31 14:34:57.794804290 -0400 | ||
1783 | 193 | @@ -72,6 +72,8 @@ | ||
1784 | 194 | <include src="content_settings_ui.js"></include> | ||
1785 | 195 | <include src="cookies_list.js"></include> | ||
1786 | 196 | <include src="cookies_view.js"></include> | ||
1787 | 197 | +<include src="desktop_integration_add_website_overlay.js"></include> | ||
1788 | 198 | +<include src="desktop_integration_overlay.js"></include> | ||
1789 | 199 | <include src="font_settings.js"></include> | ||
1790 | 200 | <if expr="pp_ifdef('enable_register_protocol_handler')"> | ||
1791 | 201 | <include src="handler_options.js"></include> | ||
1792 | 202 | Index: src/chrome/browser/resources/options2/browser_options.html | ||
1793 | 203 | =================================================================== | ||
1794 | 204 | --- src.orig/chrome/browser/resources/options2/browser_options.html 2012-07-31 14:30:37.000000000 -0400 | ||
1795 | 205 | +++ src/chrome/browser/resources/options2/browser_options.html 2012-07-31 14:34:57.794804290 -0400 | ||
1796 | 206 | @@ -37,7 +37,7 @@ | ||
1797 | 207 | <if expr="not pp_ifdef('toolkit_views') and is_posix and not is_macosx"> | ||
1798 | 208 | <button id="themes-gallery" i18n-content="themesGallery"></button> | ||
1799 | 209 | <button id="themes-GTK-button" | ||
1800 | 210 | - i18n-content="themesGTKButton"></button> | ||
1801 | 211 | + i18n-content="themesGTKButton"></button> | ||
1802 | 212 | <button id="themes-reset" | ||
1803 | 213 | i18n-content="themesSetClassic"></button> | ||
1804 | 214 | </if> | ||
1805 | 215 | @@ -356,6 +356,22 @@ | ||
1806 | 216 | </if> | ||
1807 | 217 | </div> | ||
1808 | 218 | </section> | ||
1809 | 219 | + | ||
1810 | 220 | +<if expr="is_linux and not pp_ifdef('chromeos')"> | ||
1811 | 221 | + <section id="desktop-integration-section"> | ||
1812 | 222 | + <h3 i18n-content="advancedSectionTitleIntegration"></h3> | ||
1813 | 223 | + <div class="checkbox"> | ||
1814 | 224 | + <label> | ||
1815 | 225 | + <input id="promptIntegrationForAnyWebsite" pref="desktop_integration_prompt.enabled" | ||
1816 | 226 | + metric="Options_PromptIntegration" type="checkbox"> | ||
1817 | 227 | + <span i18n-content="promptIntegrationEnableIntegration"></span> | ||
1818 | 228 | + </label> | ||
1819 | 229 | + </div> | ||
1820 | 230 | + <button id="desktop-integration-button" | ||
1821 | 231 | + i18n-content="desktopIntegrationExceptionsSettingsButton"></button> | ||
1822 | 232 | + </section> | ||
1823 | 233 | +</if> | ||
1824 | 234 | + | ||
1825 | 235 | <if expr="not pp_ifdef('chromeos')"> | ||
1826 | 236 | <section> | ||
1827 | 237 | <h3 i18n-content="advancedSectionTitleNetwork"></h3> | ||
1828 | 238 | Index: src/chrome/browser/resources/options2/desktop_integration_overlay.html | ||
1829 | 239 | =================================================================== | ||
1830 | 240 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1831 | 241 | +++ src/chrome/browser/resources/options2/desktop_integration_overlay.html 2012-07-31 14:34:57.798804289 -0400 | ||
1832 | 242 | @@ -0,0 +1,31 @@ | ||
1833 | 243 | +<div id="desktop-integration-area" class="page" hidden> | ||
1834 | 244 | + | ||
1835 | 245 | + <div class="close-button"></div> | ||
1836 | 246 | + <h1 i18n-content="desktopIntegrationPage"></h1> | ||
1837 | 247 | + | ||
1838 | 248 | + <span i18n-content="desktopIntegrationInfoText"></span> | ||
1839 | 249 | + | ||
1840 | 250 | + <div id="desktop-integration-column-headers"> | ||
1841 | 251 | + <div id="desktop-integration-description-column" i18n-content="desktopIntegrationColumnDescription"> | ||
1842 | 252 | + </div> | ||
1843 | 253 | + </div> | ||
1844 | 254 | + | ||
1845 | 255 | + <div class="content-area"> | ||
1846 | 256 | + <list id="domains-list"></list> | ||
1847 | 257 | + | ||
1848 | 258 | + <div class="desktop-integration-lower-left"> | ||
1849 | 259 | + <button id="desktop-integration-add-button" | ||
1850 | 260 | + i18n-content="add_button"></button> | ||
1851 | 261 | + </div> | ||
1852 | 262 | + </div> | ||
1853 | 263 | + | ||
1854 | 264 | + <div class="action-area"> | ||
1855 | 265 | + <div class="button-strip"> | ||
1856 | 266 | + <button id="desktop-integrations-overlay-confirm" | ||
1857 | 267 | + i18n-content="ok"> | ||
1858 | 268 | + </button> | ||
1859 | 269 | + </div> | ||
1860 | 270 | + </div> | ||
1861 | 271 | + | ||
1862 | 272 | +</div> | ||
1863 | 273 | + | ||
1864 | 274 | Index: src/chrome/browser/resources/options2/desktop_integration_overlay.js | ||
1865 | 275 | =================================================================== | ||
1866 | 276 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
1867 | 277 | +++ src/chrome/browser/resources/options2/desktop_integration_overlay.js 2012-07-31 14:34:57.798804289 -0400 | ||
1868 | 278 | @@ -0,0 +1,201 @@ | ||
1869 | 279 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
1870 | 280 | +// Use of this source code is governed by a BSD-style license that can be | ||
1871 | 281 | +// found in the LICENSE file. | ||
1872 | 282 | + | ||
1873 | 283 | +cr.define('options', function() { | ||
1874 | 284 | + /** @const */ var ArrayDataModel = cr.ui.ArrayDataModel; | ||
1875 | 285 | + /** @const */ var DeletableItemList = options.DeletableItemList; | ||
1876 | 286 | + /** @const */ var DeletableItem = options.DeletableItem; | ||
1877 | 287 | + | ||
1878 | 288 | + /** | ||
1879 | 289 | + * Creates a new exceptions list item. | ||
1880 | 290 | + * @constructor | ||
1881 | 291 | + * @extends {options.DeletableItem} | ||
1882 | 292 | + */ | ||
1883 | 293 | + function IntegratedWebsitesListItem(domain) { | ||
1884 | 294 | + var el = cr.doc.createElement('div'); | ||
1885 | 295 | + el.__proto__ = IntegratedWebsitesListItem.prototype; | ||
1886 | 296 | + el.domain = domain; | ||
1887 | 297 | + el.decorate(); | ||
1888 | 298 | + return el; | ||
1889 | 299 | + } | ||
1890 | 300 | + | ||
1891 | 301 | + IntegratedWebsitesListItem.prototype = { | ||
1892 | 302 | + __proto__: DeletableItem.prototype, | ||
1893 | 303 | + | ||
1894 | 304 | + /** | ||
1895 | 305 | + * Called when an element is decorated as a list item. | ||
1896 | 306 | + */ | ||
1897 | 307 | + decorate: function() { | ||
1898 | 308 | + DeletableItem.prototype.decorate.call(this); | ||
1899 | 309 | + | ||
1900 | 310 | + // The stored label. | ||
1901 | 311 | + var label = this.ownerDocument.createElement('div'); | ||
1902 | 312 | + label.className = 'domain-name'; | ||
1903 | 313 | + label.textContent = this.domain; | ||
1904 | 314 | + this.contentElement.appendChild(label); | ||
1905 | 315 | + | ||
1906 | 316 | + this.deletable = true; | ||
1907 | 317 | + }, | ||
1908 | 318 | + }; | ||
1909 | 319 | + | ||
1910 | 320 | + /** | ||
1911 | 321 | + * Creates a integrated websites list. | ||
1912 | 322 | + * @constructor | ||
1913 | 323 | + * @extends {cr.ui.List} | ||
1914 | 324 | + */ | ||
1915 | 325 | + var IntegratedWebsitesList = cr.ui.define('list'); | ||
1916 | 326 | + | ||
1917 | 327 | + IntegratedWebsitesList.prototype = { | ||
1918 | 328 | + __proto__: DeletableItemList.prototype, | ||
1919 | 329 | + | ||
1920 | 330 | + /** | ||
1921 | 331 | + * Called when an element is decorated as a list. | ||
1922 | 332 | + */ | ||
1923 | 333 | + decorate: function() { | ||
1924 | 334 | + DeletableItemList.prototype.decorate.call(this); | ||
1925 | 335 | + this.reset(); | ||
1926 | 336 | + }, | ||
1927 | 337 | + | ||
1928 | 338 | + /** @inheritDoc */ | ||
1929 | 339 | + createItem: function(domain) { | ||
1930 | 340 | + return new IntegratedWebsitesListItem(domain); | ||
1931 | 341 | + }, | ||
1932 | 342 | + | ||
1933 | 343 | + /* | ||
1934 | 344 | + * Adds a website domain name to the list of allowed integrated websites. | ||
1935 | 345 | + * @param {string} domain domain name of the website to add. | ||
1936 | 346 | + */ | ||
1937 | 347 | + addWebsite: function(domain) { | ||
1938 | 348 | + if (!domain || this.dataModel.indexOf(domain) >= 0) { | ||
1939 | 349 | + return; | ||
1940 | 350 | + } | ||
1941 | 351 | + this.dataModel.push(url); | ||
1942 | 352 | + this.redraw(); | ||
1943 | 353 | + chrome.send('addIntegrationSite', [domain]); | ||
1944 | 354 | + }, | ||
1945 | 355 | + | ||
1946 | 356 | + /** | ||
1947 | 357 | + * Forces a revailidation of the list content. Content added while the list | ||
1948 | 358 | + * is hidden is not properly rendered when the list becomes visible. In | ||
1949 | 359 | + * addition, deleting a single item from the list results in a stale cache | ||
1950 | 360 | + * requiring an invalidation. | ||
1951 | 361 | + */ | ||
1952 | 362 | + refresh: function() { | ||
1953 | 363 | + // TODO(kevers): Investigate if the root source of the problems can be | ||
1954 | 364 | + // fixed in cr.ui.list. | ||
1955 | 365 | + this.invalidate(); | ||
1956 | 366 | + this.redraw(); | ||
1957 | 367 | + }, | ||
1958 | 368 | + | ||
1959 | 369 | + /** | ||
1960 | 370 | + * Sets the integrated websites in the js model. | ||
1961 | 371 | + * @param {Object} entries A list of dictionaries of values, each dictionary | ||
1962 | 372 | + * represents an exception. | ||
1963 | 373 | + */ | ||
1964 | 374 | + setIntegratedWebsites: function(entries) { | ||
1965 | 375 | + var integratedWebsites = null; | ||
1966 | 376 | + try { | ||
1967 | 377 | + integratedWebsites = JSON.parse(entries); | ||
1968 | 378 | + } catch(e) { | ||
1969 | 379 | + console.log("Error while parsing integrated websites json: " + entries); | ||
1970 | 380 | + return; | ||
1971 | 381 | + } | ||
1972 | 382 | + // TODO hightlight domains differently based on permission | ||
1973 | 383 | + var domains = []; | ||
1974 | 384 | + domains = domains.concat(integratedWebsites['allowed']); | ||
1975 | 385 | + domains = domains.concat(integratedWebsites['dontask']); | ||
1976 | 386 | + this.dataModel = new ArrayDataModel(domains); | ||
1977 | 387 | + this.refresh(); | ||
1978 | 388 | + }, | ||
1979 | 389 | + | ||
1980 | 390 | + /** | ||
1981 | 391 | + * Removes all integration scripts from the js model. | ||
1982 | 392 | + */ | ||
1983 | 393 | + reset: function() { | ||
1984 | 394 | + this.dataModel = new ArrayDataModel([]); | ||
1985 | 395 | + }, | ||
1986 | 396 | + | ||
1987 | 397 | + /** @inheritDoc */ | ||
1988 | 398 | + deleteItemAtIndex: function(index) { | ||
1989 | 399 | + if (index >= 0) { | ||
1990 | 400 | + var args = [this.dataModel.item(index)]; | ||
1991 | 401 | + chrome.send('removeIntegrationSite', args); | ||
1992 | 402 | + this.dataModel.splice(index, 1); | ||
1993 | 403 | + } | ||
1994 | 404 | + }, | ||
1995 | 405 | + | ||
1996 | 406 | + /** | ||
1997 | 407 | + * The length of the list. | ||
1998 | 408 | + */ | ||
1999 | 409 | + get length() { | ||
2000 | 410 | + return null != this.dataModel ? this.dataModel.length : 0; | ||
2001 | 411 | + }, | ||
2002 | 412 | + }; | ||
2003 | 413 | + | ||
2004 | 414 | + var OptionsPage = options.OptionsPage; | ||
2005 | 415 | + | ||
2006 | 416 | + /** | ||
2007 | 417 | + * DesktopIntegrationOverlay class | ||
2008 | 418 | + * Encapsulated handling of the 'Desktop integration' page. | ||
2009 | 419 | + * @class | ||
2010 | 420 | + */ | ||
2011 | 421 | + function DesktopIntegrationOverlay() { | ||
2012 | 422 | + OptionsPage.call(this, 'desktopIntegrationOverlay', | ||
2013 | 423 | + templateData.desktopIntegrationPage, | ||
2014 | 424 | + 'desktop-integration-area'); | ||
2015 | 425 | + } | ||
2016 | 426 | + | ||
2017 | 427 | + cr.addSingletonGetter(DesktopIntegrationOverlay); | ||
2018 | 428 | + | ||
2019 | 429 | + DesktopIntegrationOverlay.prototype = { | ||
2020 | 430 | + __proto__: OptionsPage.prototype, | ||
2021 | 431 | + | ||
2022 | 432 | + /** | ||
2023 | 433 | + * Initialize the page. | ||
2024 | 434 | + */ | ||
2025 | 435 | + initializePage: function() { | ||
2026 | 436 | + OptionsPage.prototype.initializePage.call(this); | ||
2027 | 437 | + | ||
2028 | 438 | + var integrationList = $('domains-list'); | ||
2029 | 439 | + IntegratedWebsitesList.decorate(integrationList); | ||
2030 | 440 | + $('desktop-integrations-overlay-confirm').onclick = | ||
2031 | 441 | + OptionsPage.closeOverlay.bind(OptionsPage); | ||
2032 | 442 | + | ||
2033 | 443 | + // Set up add button. | ||
2034 | 444 | + $('desktop-integration-add-button').onclick = function(e) { | ||
2035 | 445 | + OptionsPage.navigateToPage('addDesktopIntegrationWebsite'); | ||
2036 | 446 | + }; | ||
2037 | 447 | + | ||
2038 | 448 | + // Listen to add website dialog ok button. | ||
2039 | 449 | + var addWebsiteOkButton = $('add-integration-website-overlay-ok-button'); | ||
2040 | 450 | + addWebsiteOkButton.addEventListener('click', | ||
2041 | 451 | + this.handleAddWebsiteOkButtonClick_.bind(this)); | ||
2042 | 452 | + }, | ||
2043 | 453 | + | ||
2044 | 454 | + handleAddWebsiteOkButtonClick_: function () { | ||
2045 | 455 | + var website = $('website-url-field').value; | ||
2046 | 456 | + $('domains-list').addWebsite(String(website)); | ||
2047 | 457 | + OptionsPage.closeOverlay(); | ||
2048 | 458 | + }, | ||
2049 | 459 | + | ||
2050 | 460 | + /** | ||
2051 | 461 | + * Called by the options page when this page has been shown. | ||
2052 | 462 | + */ | ||
2053 | 463 | + didShowPage: function() { | ||
2054 | 464 | + chrome.send('updateIntegratedWebsitesList'); | ||
2055 | 465 | + }, | ||
2056 | 466 | + }; | ||
2057 | 467 | + | ||
2058 | 468 | + DesktopIntegrationOverlay.setIntegratedWebsites = function(entries) { | ||
2059 | 469 | + $('domains-list').setIntegratedWebsites(entries); | ||
2060 | 470 | + }; | ||
2061 | 471 | + | ||
2062 | 472 | + // Export | ||
2063 | 473 | + return { | ||
2064 | 474 | + IntegratedWebsitesListItem: IntegratedWebsitesListItem, | ||
2065 | 475 | + IntegratedWebsitesList: IntegratedWebsitesList, | ||
2066 | 476 | + DesktopIntegrationOverlay: DesktopIntegrationOverlay | ||
2067 | 477 | + }; | ||
2068 | 478 | +}); | ||
2069 | 479 | + | ||
2070 | 480 | Index: src/chrome/browser/resources/options2/desktop_integration_overlay.css | ||
2071 | 481 | =================================================================== | ||
2072 | 482 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2073 | 483 | +++ src/chrome/browser/resources/options2/desktop_integration_overlay.css 2012-07-31 14:34:57.798804289 -0400 | ||
2074 | 484 | @@ -0,0 +1,71 @@ | ||
2075 | 485 | +/* Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
2076 | 486 | + * Use of this source code is governed by a BSD-style license that can be | ||
2077 | 487 | + * found in the LICENSE file. */ | ||
2078 | 488 | + | ||
2079 | 489 | +#desktop-integration-options { | ||
2080 | 490 | + min-width: 550px; | ||
2081 | 491 | +} | ||
2082 | 492 | + | ||
2083 | 493 | +#desktop-integration-options list { | ||
2084 | 494 | + min-height: 172px; | ||
2085 | 495 | +} | ||
2086 | 496 | + | ||
2087 | 497 | +.desktop-integration-list-item { | ||
2088 | 498 | + -webkit-box-flex: 1; | ||
2089 | 499 | + -webkit-padding-start: 8px; | ||
2090 | 500 | + overflow: hidden; | ||
2091 | 501 | + text-overflow: ellipsis; | ||
2092 | 502 | +} | ||
2093 | 503 | + | ||
2094 | 504 | +.desktop-integration-lower-left button { | ||
2095 | 505 | + min-width: 70px; | ||
2096 | 506 | +} | ||
2097 | 507 | + | ||
2098 | 508 | +.desktop-integration-lower-left { | ||
2099 | 509 | + -webkit-box-flex: 0; | ||
2100 | 510 | + -webkit-padding-start: 12px; | ||
2101 | 511 | + padding-bottom: 10px; | ||
2102 | 512 | +} | ||
2103 | 513 | + | ||
2104 | 514 | +#desktop-integration-column-headers { | ||
2105 | 515 | + -webkit-margin-start: 17px; | ||
2106 | 516 | + display: -webkit-box; | ||
2107 | 517 | + margin-top: 17px; | ||
2108 | 518 | +} | ||
2109 | 519 | + | ||
2110 | 520 | +#desktop-integration-column-headers > div { | ||
2111 | 521 | + font-weight: bold; | ||
2112 | 522 | +} | ||
2113 | 523 | + | ||
2114 | 524 | +#desktop-integration-pattern-column { | ||
2115 | 525 | + -webkit-box-flex: 1; | ||
2116 | 526 | +} | ||
2117 | 527 | + | ||
2118 | 528 | +#desktop-integration-behavior-column { | ||
2119 | 529 | + width: 145px; | ||
2120 | 530 | +} | ||
2121 | 531 | + | ||
2122 | 532 | +#desktop-integration-area list { | ||
2123 | 533 | + margin-bottom: 10px; | ||
2124 | 534 | + margin-top: 4px; | ||
2125 | 535 | +} | ||
2126 | 536 | + | ||
2127 | 537 | +#domains-list { | ||
2128 | 538 | + -webkit-box-flex: 1; | ||
2129 | 539 | + outline: none; | ||
2130 | 540 | + padding: 1px 0 0; | ||
2131 | 541 | + width: 100%; | ||
2132 | 542 | +} | ||
2133 | 543 | + | ||
2134 | 544 | +#domains-list .domain-name { | ||
2135 | 545 | + -webkit-box-flex: 1; | ||
2136 | 546 | + overflow: hidden; | ||
2137 | 547 | + text-overflow: ellipsis; | ||
2138 | 548 | + white-space: nowrap; | ||
2139 | 549 | +} | ||
2140 | 550 | + | ||
2141 | 551 | +#domains-list li { | ||
2142 | 552 | + -webkit-padding-start: 12px; | ||
2143 | 553 | + padding-bottom: 2px; | ||
2144 | 554 | + padding-top: 2px; | ||
2145 | 555 | +} | ||
2146 | 556 | Index: src/chrome/browser/resources/options2/browser_options.js | ||
2147 | 557 | =================================================================== | ||
2148 | 558 | --- src.orig/chrome/browser/resources/options2/browser_options.js 2012-07-31 14:30:37.000000000 -0400 | ||
2149 | 559 | +++ src/chrome/browser/resources/options2/browser_options.js 2012-07-31 14:34:57.798804289 -0400 | ||
2150 | 560 | @@ -397,6 +397,23 @@ | ||
2151 | 561 | [String(event.target.options[event.target.selectedIndex].value)]); | ||
2152 | 562 | }; | ||
2153 | 563 | |||
2154 | 564 | + // Desktop integration section | ||
2155 | 565 | + if (cr.isLinux && !cr.isChromeOS) { | ||
2156 | 566 | + var updateButtonState = function () { | ||
2157 | 567 | + $('desktop-integration-button').disabled = | ||
2158 | 568 | + ! $('promptIntegrationForAnyWebsite').checked; | ||
2159 | 569 | + }; | ||
2160 | 570 | + $('promptIntegrationForAnyWebsite').onchange = function () { | ||
2161 | 571 | + updateButtonState(); | ||
2162 | 572 | + chrome.send('setDesktopIntegrationAllowed', | ||
2163 | 573 | + [$('promptIntegrationForAnyWebsite').checked]); | ||
2164 | 574 | + }; | ||
2165 | 575 | + updateButtonState(); | ||
2166 | 576 | + $('desktop-integration-button').onclick = function(event) { | ||
2167 | 577 | + OptionsPage.navigateToPage('desktopIntegrationOverlay'); | ||
2168 | 578 | + }; | ||
2169 | 579 | + } | ||
2170 | 580 | + | ||
2171 | 581 | // Languages section. | ||
2172 | 582 | $('language-button').onclick = function(event) { | ||
2173 | 583 | OptionsPage.navigateToPage('languages'); | ||
2174 | 584 | @@ -1024,6 +1041,24 @@ | ||
2175 | 585 | }, | ||
2176 | 586 | |||
2177 | 587 | /** | ||
2178 | 588 | + * Disable the desktop integration settings if needed. | ||
2179 | 589 | + * @private | ||
2180 | 590 | + */ | ||
2181 | 591 | + disableDesktopIntegration_: function() { | ||
2182 | 592 | + $('desktop-integration-section').style.display = 'none'; | ||
2183 | 593 | + }, | ||
2184 | 594 | + | ||
2185 | 595 | + /** | ||
2186 | 596 | + * Disable the desktop integration settings if needed. | ||
2187 | 597 | + * @private | ||
2188 | 598 | + */ | ||
2189 | 599 | + setDesktopIntegrationIsAllowed_: function(enabled) { | ||
2190 | 600 | + $('promptIntegrationForAnyWebsite').checked = enabled; | ||
2191 | 601 | + $('desktop-integration-button').disabled = | ||
2192 | 602 | + ! $('promptIntegrationForAnyWebsite').checked; | ||
2193 | 603 | + }, | ||
2194 | 604 | + | ||
2195 | 605 | + /** | ||
2196 | 606 | * Set the checked state of the metrics reporting checkbox. | ||
2197 | 607 | * @private | ||
2198 | 608 | */ | ||
2199 | 609 | @@ -1357,6 +1392,7 @@ | ||
2200 | 610 | //Forward public APIs to private implementations. | ||
2201 | 611 | [ | ||
2202 | 612 | 'addBluetoothDevice', | ||
2203 | 613 | + 'disableDesktopIntegration', | ||
2204 | 614 | 'getStartStopSyncButton', | ||
2205 | 615 | 'hideBluetoothSettings', | ||
2206 | 616 | 'removeCloudPrintConnectorSection', | ||
2207 | 617 | @@ -1370,6 +1406,7 @@ | ||
2208 | 618 | 'setGtkThemeButtonEnabled', | ||
2209 | 619 | 'setHighContrastCheckboxState', | ||
2210 | 620 | 'setInstantFieldTrialStatus', | ||
2211 | 621 | + 'setDesktopIntegrationIsAllowed', | ||
2212 | 622 | 'setMetricsReportingCheckboxState', | ||
2213 | 623 | 'setMetricsReportingSettingVisibility', | ||
2214 | 624 | 'setProfilesInfo', | ||
2215 | 625 | Index: src/chrome/browser/ui/webui/options2/options_ui2.cc | ||
2216 | 626 | =================================================================== | ||
2217 | 627 | --- src.orig/chrome/browser/ui/webui/options2/options_ui2.cc 2012-07-31 14:30:37.000000000 -0400 | ||
2218 | 628 | +++ src/chrome/browser/ui/webui/options2/options_ui2.cc 2012-07-31 14:34:57.798804289 -0400 | ||
2219 | 629 | @@ -90,6 +90,10 @@ | ||
2220 | 630 | #include "chrome/browser/ui/webui/options2/certificate_manager_handler2.h" | ||
2221 | 631 | #endif | ||
2222 | 632 | |||
2223 | 633 | +#if defined(OS_LINUX) | ||
2224 | 634 | +#include "chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.h" | ||
2225 | 635 | +#endif | ||
2226 | 636 | + | ||
2227 | 637 | using content::RenderViewHost; | ||
2228 | 638 | |||
2229 | 639 | namespace { | ||
2230 | 640 | @@ -233,6 +237,10 @@ | ||
2231 | 641 | AddOptionsPageUIHandler(localized_strings, new ClearBrowserDataHandler()); | ||
2232 | 642 | AddOptionsPageUIHandler(localized_strings, new ContentSettingsHandler()); | ||
2233 | 643 | AddOptionsPageUIHandler(localized_strings, new CookiesViewHandler()); | ||
2234 | 644 | +#if defined(OS_LINUX) | ||
2235 | 645 | + AddOptionsPageUIHandler(localized_strings, | ||
2236 | 646 | + new DesktopIntegrationSettingsHandler()); | ||
2237 | 647 | +#endif | ||
2238 | 648 | AddOptionsPageUIHandler(localized_strings, new FontSettingsHandler()); | ||
2239 | 649 | AddOptionsPageUIHandler(localized_strings, new HomePageOverlayHandler()); | ||
2240 | 650 | AddOptionsPageUIHandler(localized_strings, new WebIntentsSettingsHandler()); | ||
2241 | 651 | Index: src/chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.h | ||
2242 | 652 | =================================================================== | ||
2243 | 653 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2244 | 654 | +++ src/chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.h 2012-07-31 14:34:57.798804289 -0400 | ||
2245 | 655 | @@ -0,0 +1,76 @@ | ||
2246 | 656 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
2247 | 657 | +// Use of this source code is governed by a BSD-style license that can be | ||
2248 | 658 | +// found in the LICENSE file. | ||
2249 | 659 | + | ||
2250 | 660 | +#ifndef CHROME_BROWSER_UI_WEBUI_OPTIONS2_DESKTOP_INTEGRATION_SETTINGS_HANDLER2_H_ | ||
2251 | 661 | +#define CHROME_BROWSER_UI_WEBUI_OPTIONS2_DESKTOP_INTEGRATION_SETTINGS_HANDLER2_H_ | ||
2252 | 662 | + | ||
2253 | 663 | +#include <string> | ||
2254 | 664 | + | ||
2255 | 665 | +#include "base/compiler_specific.h" | ||
2256 | 666 | +#include "chrome/browser/ui/webui/options2/options_ui2.h" | ||
2257 | 667 | + | ||
2258 | 668 | +namespace base { | ||
2259 | 669 | +class DictionaryValue; | ||
2260 | 670 | +class ListValue; | ||
2261 | 671 | +} | ||
2262 | 672 | + | ||
2263 | 673 | +namespace options2 { | ||
2264 | 674 | + | ||
2265 | 675 | +class DesktopIntegrationSettingsHandler : public OptionsPageUIHandler { | ||
2266 | 676 | + public: | ||
2267 | 677 | + DesktopIntegrationSettingsHandler(); | ||
2268 | 678 | + virtual ~DesktopIntegrationSettingsHandler(); | ||
2269 | 679 | + | ||
2270 | 680 | + // OptionsPageUIHandler implementation. | ||
2271 | 681 | + virtual void GetLocalizedValues( | ||
2272 | 682 | + base::DictionaryValue* localized_strings) OVERRIDE; | ||
2273 | 683 | + virtual void InitializeHandler() OVERRIDE; | ||
2274 | 684 | + virtual void InitializePage() OVERRIDE; | ||
2275 | 685 | + virtual void RegisterMessages() OVERRIDE; | ||
2276 | 686 | + | ||
2277 | 687 | + private: | ||
2278 | 688 | + | ||
2279 | 689 | + // Loads the data associated with the currently integrated websites. | ||
2280 | 690 | + void LoadIntegratedWebsitesData(); | ||
2281 | 691 | + | ||
2282 | 692 | + // Initializes the list of website domain names that are currently | ||
2283 | 693 | + // either allowed or 'dontask' and send it to the overlay. | ||
2284 | 694 | + void LoadUnityWebappsEntryPoint(); | ||
2285 | 695 | + | ||
2286 | 696 | + // Removes an website from the list of integrated websites that won't prompt | ||
2287 | 697 | + // from integration. | ||
2288 | 698 | + // |args| - A string, the domain name of the website to remove. | ||
2289 | 699 | + void RemoveIntegrationSite(const ListValue* args); | ||
2290 | 700 | + | ||
2291 | 701 | + // Adds an website from the list of integrated websites that won't prompt | ||
2292 | 702 | + // from integration. The website is being added to the list of 'allowed' sites. | ||
2293 | 703 | + // |args| - A string, the domain name of the website to add. | ||
2294 | 704 | + void AddIntegrationSite(const ListValue* args); | ||
2295 | 705 | + | ||
2296 | 706 | + // Updates the integration allowed flag. | ||
2297 | 707 | + // |args| - A boolean flag indicating if integration should be allowed | ||
2298 | 708 | + void SetDesktopIntegrationAllowed(const ListValue* args); | ||
2299 | 709 | + | ||
2300 | 710 | + // Updates the list of integrated websites. | ||
2301 | 711 | + void UpdateIntegratedWebsitesList(const ListValue* args); | ||
2302 | 712 | + | ||
2303 | 713 | + // Predicate informing if we have been able to initialize the connection | ||
2304 | 714 | + // with the unity-webapps library (entry point for website integration | ||
2305 | 715 | + // permissions). | ||
2306 | 716 | + bool IsUnityWebappsInitialized() const; | ||
2307 | 717 | + | ||
2308 | 718 | + // | ||
2309 | 719 | + void * lib_unity_webapps_handle_; | ||
2310 | 720 | + void * get_all_func_handle_; | ||
2311 | 721 | + void * remove_from_permissions_func_handle_; | ||
2312 | 722 | + void * add_allowed_domain_func_handle_; | ||
2313 | 723 | + void * is_integration_allowed_func_handle_; | ||
2314 | 724 | + void * set_integration_allowed_func_handle_; | ||
2315 | 725 | + | ||
2316 | 726 | + DISALLOW_COPY_AND_ASSIGN(DesktopIntegrationSettingsHandler); | ||
2317 | 727 | +}; | ||
2318 | 728 | + | ||
2319 | 729 | +} // namespace options2 | ||
2320 | 730 | + | ||
2321 | 731 | +#endif // CHROME_BROWSER_UI_WEBUI_OPTIONS2_DESKTOP_INTEGRATION_SETTINGS_HANDLER2_H_ | ||
2322 | 732 | Index: src/chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.cc | ||
2323 | 733 | =================================================================== | ||
2324 | 734 | --- /dev/null 1970-01-01 00:00:00.000000000 +0000 | ||
2325 | 735 | +++ src/chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.cc 2012-07-31 14:37:18.294808913 -0400 | ||
2326 | 736 | @@ -0,0 +1,264 @@ | ||
2327 | 737 | +// Copyright (c) 2012 The Chromium Authors. All rights reserved. | ||
2328 | 738 | +// Use of this source code is governed by a BSD-style license that can be | ||
2329 | 739 | +// found in the LICENSE file. | ||
2330 | 740 | + | ||
2331 | 741 | +#include "chrome/browser/ui/webui/options2/desktop_integration_settings_handler2.h" | ||
2332 | 742 | + | ||
2333 | 743 | +#include <glib.h> | ||
2334 | 744 | +#include <dlfcn.h> | ||
2335 | 745 | +#include <vector> | ||
2336 | 746 | + | ||
2337 | 747 | +#include "base/bind.h" | ||
2338 | 748 | +#include "base/bind_helpers.h" | ||
2339 | 749 | +#include "base/logging.h" | ||
2340 | 750 | +#include "base/string16.h" | ||
2341 | 751 | +#include "base/string_number_conversions.h" | ||
2342 | 752 | +#include "base/utf_string_conversions.h" | ||
2343 | 753 | +#include "base/values.h" | ||
2344 | 754 | +#include "chrome/browser/ui/webui/web_ui_util.h" | ||
2345 | 755 | +#include "chrome/common/guid.h" | ||
2346 | 756 | +#include "chrome/common/url_constants.h" | ||
2347 | 757 | +#include "content/public/browser/web_ui.h" | ||
2348 | 758 | +#include "grit/generated_resources.h" | ||
2349 | 759 | +#include "grit/webkit_resources.h" | ||
2350 | 760 | +#include "ui/base/l10n/l10n_util.h" | ||
2351 | 761 | + | ||
2352 | 762 | +// Not a constant but preprocessor definition for easy concatenation. | ||
2353 | 763 | +#define kLibunityWebappsEntryPointLibName "libunity_webapps.so.0" | ||
2354 | 764 | + | ||
2355 | 765 | +namespace options2 { | ||
2356 | 766 | + | ||
2357 | 767 | +// TODO: -> extract to function | ||
2358 | 768 | +DesktopIntegrationSettingsHandler::DesktopIntegrationSettingsHandler() | ||
2359 | 769 | + : lib_unity_webapps_handle_(NULL), | ||
2360 | 770 | + get_all_func_handle_(NULL), | ||
2361 | 771 | + remove_from_permissions_func_handle_(NULL), | ||
2362 | 772 | + add_allowed_domain_func_handle_(NULL), | ||
2363 | 773 | + is_integration_allowed_func_handle_(NULL), | ||
2364 | 774 | + set_integration_allowed_func_handle_(NULL) { | ||
2365 | 775 | +} | ||
2366 | 776 | + | ||
2367 | 777 | +DesktopIntegrationSettingsHandler::~DesktopIntegrationSettingsHandler() { | ||
2368 | 778 | + if (lib_unity_webapps_handle_) { | ||
2369 | 779 | + dlclose (lib_unity_webapps_handle_); | ||
2370 | 780 | + lib_unity_webapps_handle_ = NULL; | ||
2371 | 781 | + | ||
2372 | 782 | + remove_from_permissions_func_handle_ = NULL; | ||
2373 | 783 | + get_all_func_handle_ = NULL; | ||
2374 | 784 | + add_allowed_domain_func_handle_ = NULL; | ||
2375 | 785 | + is_integration_allowed_func_handle_ = NULL; | ||
2376 | 786 | + set_integration_allowed_func_handle_ = NULL; | ||
2377 | 787 | + } | ||
2378 | 788 | +} | ||
2379 | 789 | + | ||
2380 | 790 | +///////////////////////////////////////////////////////////////////////////// | ||
2381 | 791 | +// OptionsPageUIHandler implementation: | ||
2382 | 792 | +void DesktopIntegrationSettingsHandler::GetLocalizedValues( | ||
2383 | 793 | + DictionaryValue* localized_strings) { | ||
2384 | 794 | + DCHECK(localized_strings); | ||
2385 | 795 | + | ||
2386 | 796 | + static OptionsStringResource resources[] = { | ||
2387 | 797 | + { "desktopIntegrationInfoText", | ||
2388 | 798 | + IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_DESCRIPTION }, | ||
2389 | 799 | + { "desktopIntegrationColumnDescription", | ||
2390 | 800 | + IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_COLUMN_DESCRIPTION }, | ||
2391 | 801 | + }; | ||
2392 | 802 | + | ||
2393 | 803 | + localized_strings->SetString("add_button", | ||
2394 | 804 | + l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_BUTTON)); | ||
2395 | 805 | + localized_strings->SetString("add_desktop_website_input_label", | ||
2396 | 806 | + l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_TEXT)); | ||
2397 | 807 | + localized_strings->SetString("add_desktop_website_title", | ||
2398 | 808 | + l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_INTEGRATION_WEBSITE_ADD_TITLE)); | ||
2399 | 809 | + | ||
2400 | 810 | + RegisterStrings(localized_strings, resources, arraysize(resources)); | ||
2401 | 811 | + RegisterTitle(localized_strings, "desktopIntegrationPage", | ||
2402 | 812 | + IDS_DESKTOP_INTEGRATION_SETTINGS_OVERLAY_TITLE); | ||
2403 | 813 | +} | ||
2404 | 814 | + | ||
2405 | 815 | +void DesktopIntegrationSettingsHandler::InitializeHandler() { | ||
2406 | 816 | + if (!IsUnityWebappsInitialized()) { | ||
2407 | 817 | + LoadUnityWebappsEntryPoint(); | ||
2408 | 818 | + } | ||
2409 | 819 | +} | ||
2410 | 820 | + | ||
2411 | 821 | +void DesktopIntegrationSettingsHandler::InitializePage() { | ||
2412 | 822 | + DCHECK(IsUnityWebappsInitialized()); | ||
2413 | 823 | + LoadIntegratedWebsitesData(); | ||
2414 | 824 | +} | ||
2415 | 825 | + | ||
2416 | 826 | +void DesktopIntegrationSettingsHandler::RegisterMessages() { | ||
2417 | 827 | + web_ui()->RegisterMessageCallback( | ||
2418 | 828 | + "addIntegrationSite", | ||
2419 | 829 | + base::Bind(&DesktopIntegrationSettingsHandler::AddIntegrationSite, | ||
2420 | 830 | + base::Unretained(this))); | ||
2421 | 831 | + web_ui()->RegisterMessageCallback( | ||
2422 | 832 | + "setDesktopIntegrationAllowed", | ||
2423 | 833 | + base::Bind(&DesktopIntegrationSettingsHandler::SetDesktopIntegrationAllowed, | ||
2424 | 834 | + base::Unretained(this))); | ||
2425 | 835 | + web_ui()->RegisterMessageCallback( | ||
2426 | 836 | + "removeIntegrationSite", | ||
2427 | 837 | + base::Bind(&DesktopIntegrationSettingsHandler::RemoveIntegrationSite, | ||
2428 | 838 | + base::Unretained(this))); | ||
2429 | 839 | + web_ui()->RegisterMessageCallback( | ||
2430 | 840 | + "updateIntegratedWebsitesList", | ||
2431 | 841 | + base::Bind(&DesktopIntegrationSettingsHandler::UpdateIntegratedWebsitesList, | ||
2432 | 842 | + base::Unretained(this))); | ||
2433 | 843 | +} | ||
2434 | 844 | + | ||
2435 | 845 | +void DesktopIntegrationSettingsHandler::LoadUnityWebappsEntryPoint() { | ||
2436 | 846 | + DCHECK(!IsUnityWebappsInitialized()); | ||
2437 | 847 | + | ||
2438 | 848 | + // TODO run on FILE thread | ||
2439 | 849 | + static const char* const search_paths[] = { | ||
2440 | 850 | + kLibunityWebappsEntryPointLibName, | ||
2441 | 851 | + "/usr/local/lib/" kLibunityWebappsEntryPointLibName | ||
2442 | 852 | + , "/usr/lib/" kLibunityWebappsEntryPointLibName | ||
2443 | 853 | + }; | ||
2444 | 854 | + | ||
2445 | 855 | + void * handle = NULL; | ||
2446 | 856 | + for (size_t i = 0; i < sizeof(search_paths)/sizeof(search_paths[0]); ++i) { | ||
2447 | 857 | + DCHECK(handle == NULL); | ||
2448 | 858 | + // TODO validate path? | ||
2449 | 859 | + handle = dlopen (search_paths[i], RTLD_LAZY|RTLD_GLOBAL); | ||
2450 | 860 | + if (handle) { | ||
2451 | 861 | + LOG(INFO) << "Found libunitywebapps entry point:" << search_paths[i]; | ||
2452 | 862 | + break; | ||
2453 | 863 | + } | ||
2454 | 864 | + } | ||
2455 | 865 | + if (!handle) { | ||
2456 | 866 | + LOG(INFO) << "Could not load Unity Webapps entry point library"; | ||
2457 | 867 | + return; | ||
2458 | 868 | + } | ||
2459 | 869 | + | ||
2460 | 870 | + void * get_all_handle = | ||
2461 | 871 | + dlsym (handle, "unity_webapps_permissions_get_all_domains"); | ||
2462 | 872 | + void * remove_from_permissions_handle = | ||
2463 | 873 | + dlsym (handle, "unity_webapps_permissions_remove_domain_from_permissions"); | ||
2464 | 874 | + void * add_allowed_domain_handle = | ||
2465 | 875 | + dlsym (handle, "unity_webapps_permissions_allow_domain"); | ||
2466 | 876 | + void * is_integration_allowed_handle = | ||
2467 | 877 | + dlsym (handle, "unity_webapps_permissions_is_integration_allowed"); | ||
2468 | 878 | + void * set_integration_allowed_handle = | ||
2469 | 879 | + dlsym (handle, "unity_webapps_permissions_set_integration_allowed"); | ||
2470 | 880 | + | ||
2471 | 881 | + if (!get_all_handle || | ||
2472 | 882 | + !remove_from_permissions_handle || | ||
2473 | 883 | + !add_allowed_domain_handle || | ||
2474 | 884 | + !is_integration_allowed_handle || | ||
2475 | 885 | + !set_integration_allowed_handle) { | ||
2476 | 886 | + LOG(WARNING) << "Could not load Unity Webapps entry point functions"; | ||
2477 | 887 | + dlclose(handle); | ||
2478 | 888 | + return; | ||
2479 | 889 | + } | ||
2480 | 890 | + | ||
2481 | 891 | + lib_unity_webapps_handle_ = handle; | ||
2482 | 892 | + get_all_func_handle_ = get_all_handle; | ||
2483 | 893 | + remove_from_permissions_func_handle_ = remove_from_permissions_handle; | ||
2484 | 894 | + add_allowed_domain_func_handle_ = add_allowed_domain_handle; | ||
2485 | 895 | + is_integration_allowed_func_handle_ = is_integration_allowed_handle; | ||
2486 | 896 | + set_integration_allowed_func_handle_ = set_integration_allowed_handle; | ||
2487 | 897 | +} | ||
2488 | 898 | + | ||
2489 | 899 | +bool DesktopIntegrationSettingsHandler::IsUnityWebappsInitialized() const { | ||
2490 | 900 | + return NULL != lib_unity_webapps_handle_ | ||
2491 | 901 | + && NULL != get_all_func_handle_ | ||
2492 | 902 | + && NULL != remove_from_permissions_func_handle_ | ||
2493 | 903 | + && NULL != add_allowed_domain_func_handle_ | ||
2494 | 904 | + && NULL != is_integration_allowed_func_handle_ | ||
2495 | 905 | + && NULL != set_integration_allowed_func_handle_; | ||
2496 | 906 | +} | ||
2497 | 907 | + | ||
2498 | 908 | +void DesktopIntegrationSettingsHandler::LoadIntegratedWebsitesData() { | ||
2499 | 909 | + if (!IsUnityWebappsInitialized()) { | ||
2500 | 910 | + web_ui()->CallJavascriptFunction( | ||
2501 | 911 | + "BrowserOptions.disableDesktopIntegration"); | ||
2502 | 912 | + LOG(INFO) << "Disabling Desktop Integration options"; | ||
2503 | 913 | + return; | ||
2504 | 914 | + } | ||
2505 | 915 | + | ||
2506 | 916 | + typedef gboolean (* IsIntegrationAllowedFunc) (void); | ||
2507 | 917 | + gboolean isallowed = | ||
2508 | 918 | + ((IsIntegrationAllowedFunc) is_integration_allowed_func_handle_) (); | ||
2509 | 919 | + web_ui()->CallJavascriptFunction( | ||
2510 | 920 | + "BrowserOptions.setDesktopIntegrationIsAllowed", | ||
2511 | 921 | + base::FundamentalValue(isallowed)); | ||
2512 | 922 | +} | ||
2513 | 923 | + | ||
2514 | 924 | +void DesktopIntegrationSettingsHandler::UpdateIntegratedWebsitesList( | ||
2515 | 925 | + const ListValue* args) { | ||
2516 | 926 | + DCHECK(IsUnityWebappsInitialized()); | ||
2517 | 927 | + | ||
2518 | 928 | + // TODO move elsewhere | ||
2519 | 929 | + typedef gchar* (* GetAllDomainsFunc) (void); | ||
2520 | 930 | + | ||
2521 | 931 | + gchar* all_domains = ((GetAllDomainsFunc) get_all_func_handle_) (); | ||
2522 | 932 | + if (all_domains) { | ||
2523 | 933 | + web_ui()->CallJavascriptFunction( | ||
2524 | 934 | + "DesktopIntegrationOverlay.setIntegratedWebsites", | ||
2525 | 935 | + StringValue(all_domains)); | ||
2526 | 936 | + } | ||
2527 | 937 | +} | ||
2528 | 938 | + | ||
2529 | 939 | +void DesktopIntegrationSettingsHandler::SetDesktopIntegrationAllowed( | ||
2530 | 940 | + const ListValue* args) { | ||
2531 | 941 | + DCHECK(IsUnityWebappsInitialized()); | ||
2532 | 942 | + | ||
2533 | 943 | + // TODO move elsewhere | ||
2534 | 944 | + typedef void (* SetDesktopIntegrationAllowedFunc) (gboolean); | ||
2535 | 945 | + | ||
2536 | 946 | + bool is_allowed; | ||
2537 | 947 | + if (!args->GetBoolean(0, &is_allowed)) { | ||
2538 | 948 | + NOTREACHED(); | ||
2539 | 949 | + return; | ||
2540 | 950 | + } | ||
2541 | 951 | + | ||
2542 | 952 | + LOG(INFO) << "Setting desktop integration:" << is_allowed; | ||
2543 | 953 | + | ||
2544 | 954 | + ((SetDesktopIntegrationAllowedFunc) set_integration_allowed_func_handle_) ( | ||
2545 | 955 | + is_allowed ? TRUE : FALSE); | ||
2546 | 956 | +} | ||
2547 | 957 | + | ||
2548 | 958 | +void DesktopIntegrationSettingsHandler::AddIntegrationSite( | ||
2549 | 959 | + const ListValue* args) { | ||
2550 | 960 | + DCHECK(IsUnityWebappsInitialized()); | ||
2551 | 961 | + | ||
2552 | 962 | + // TODO move elsewhere | ||
2553 | 963 | + typedef void (* AddDomainFromPermissionsFunc) (gchar *); | ||
2554 | 964 | + | ||
2555 | 965 | + std::string domain; | ||
2556 | 966 | + if (!args->GetString(0, &domain)) { | ||
2557 | 967 | + NOTREACHED(); | ||
2558 | 968 | + return; | ||
2559 | 969 | + } | ||
2560 | 970 | + | ||
2561 | 971 | + LOG(INFO) << "Adding domain:" << domain << " to the list of websites allowed"; | ||
2562 | 972 | + | ||
2563 | 973 | + ((AddDomainFromPermissionsFunc) add_allowed_domain_func_handle_) ( | ||
2564 | 974 | + const_cast<gchar *>(domain.c_str())); | ||
2565 | 975 | + | ||
2566 | 976 | + LoadIntegratedWebsitesData (); | ||
2567 | 977 | +} | ||
2568 | 978 | + | ||
2569 | 979 | +void DesktopIntegrationSettingsHandler::RemoveIntegrationSite( | ||
2570 | 980 | + const ListValue* args) { | ||
2571 | 981 | + DCHECK(IsUnityWebappsInitialized()); | ||
2572 | 982 | + | ||
2573 | 983 | + // TODO move elsewhere | ||
2574 | 984 | + typedef void (* RemoveDomainFromPermissionsFunc) (gchar *); | ||
2575 | 985 | + | ||
2576 | 986 | + std::string domain; | ||
2577 | 987 | + if (!args->GetString(0, &domain)) { | ||
2578 | 988 | + NOTREACHED(); | ||
2579 | 989 | + return; | ||
2580 | 990 | + } | ||
2581 | 991 | + | ||
2582 | 992 | + LOG(INFO) << "Removing domain:" << domain << " from the list of websites not prompting integration"; | ||
2583 | 993 | + | ||
2584 | 994 | + ((RemoveDomainFromPermissionsFunc) remove_from_permissions_func_handle_) ( | ||
2585 | 995 | + const_cast<gchar *>(domain.c_str())); | ||
2586 | 996 | + | ||
2587 | 997 | + LoadIntegratedWebsitesData (); | ||
2588 | 998 | +} | ||
2589 | 999 | + | ||
2590 | 1000 | +} // namespace options2 | ||
2591 | 1001 | Index: src/chrome/browser/ui/webui/options2/browser_options_handler2.cc | ||
2592 | 1002 | =================================================================== | ||
2593 | 1003 | --- src.orig/chrome/browser/ui/webui/options2/browser_options_handler2.cc 2012-07-31 14:30:37.000000000 -0400 | ||
2594 | 1004 | +++ src/chrome/browser/ui/webui/options2/browser_options_handler2.cc 2012-07-31 14:34:57.798804289 -0400 | ||
2595 | 1005 | @@ -152,6 +152,8 @@ | ||
2596 | 1006 | { "advancedSectionTitleCloudPrint", IDS_GOOGLE_CLOUD_PRINT }, | ||
2597 | 1007 | { "advancedSectionTitleContent", | ||
2598 | 1008 | IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT }, | ||
2599 | 1009 | + { "advancedSectionTitleIntegration", | ||
2600 | 1010 | + IDS_OPTIONS_ADVANCED_SECTION_TITLE_INTEGRATION }, | ||
2601 | 1011 | { "advancedSectionTitleLanguages", | ||
2602 | 1012 | IDS_OPTIONS_ADVANCED_SECTION_TITLE_LANGUAGES }, | ||
2603 | 1013 | { "advancedSectionTitleNetwork", | ||
2604 | 1014 | @@ -171,6 +173,8 @@ | ||
2605 | 1015 | { "defaultFontSizeLabel", IDS_OPTIONS_DEFAULT_FONT_SIZE_LABEL }, | ||
2606 | 1016 | { "defaultSearchManageEngines", IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES }, | ||
2607 | 1017 | { "defaultZoomFactorLabel", IDS_OPTIONS_DEFAULT_ZOOM_LEVEL_LABEL }, | ||
2608 | 1018 | + { "desktopIntegrationExceptionsSettingsButton", | ||
2609 | 1019 | + IDS_DESKTOP_INTEGRATION_SETTINGS_EXCEPTIONS_BUTTON_LABEL }, | ||
2610 | 1020 | #if defined(OS_CHROMEOS) | ||
2611 | 1021 | { "disableGData", IDS_OPTIONS_DISABLE_GDATA }, | ||
2612 | 1022 | #endif | ||
2613 | 1023 | @@ -222,6 +226,8 @@ | ||
2614 | 1024 | { "profilesDeleteSingle", IDS_PROFILES_DELETE_SINGLE_BUTTON_LABEL }, | ||
2615 | 1025 | { "profilesListItemCurrent", IDS_PROFILES_LIST_ITEM_CURRENT }, | ||
2616 | 1026 | { "profilesManage", IDS_PROFILES_MANAGE_BUTTON_LABEL }, | ||
2617 | 1027 | + { "promptIntegrationEnableIntegration", | ||
2618 | 1028 | + IDS_PROMPT_INTEGRATION_ENABLE_BUTTON_LABEL }, | ||
2619 | 1029 | { "proxiesLabel", IDS_OPTIONS_PROXIES_LABEL }, | ||
2620 | 1030 | { "safeBrowsingEnableProtection", | ||
2621 | 1031 | IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION }, | ||
2622 | 0 | 1032 | ||
2623 | === modified file 'debian/patches/dlopen_sonamed_gl.patch' | |||
2624 | --- debian/patches/dlopen_sonamed_gl.patch 2011-10-26 06:14:33 +0000 | |||
2625 | +++ debian/patches/dlopen_sonamed_gl.patch 2012-08-06 17:52:22 +0000 | |||
2626 | @@ -9,9 +9,9 @@ | |||
2627 | 9 | 9 | ||
2628 | 10 | Index: src/ui/gfx/gl/gl_implementation_linux.cc | 10 | Index: src/ui/gfx/gl/gl_implementation_linux.cc |
2629 | 11 | =================================================================== | 11 | =================================================================== |
2633 | 12 | --- src.orig/ui/gfx/gl/gl_implementation_linux.cc 2011-10-21 17:35:43.000000000 +0100 | 12 | --- src.orig/ui/gfx/gl/gl_implementation_linux.cc 2012-06-21 16:09:03.011162386 -0400 |
2634 | 13 | +++ src/ui/gfx/gl/gl_implementation_linux.cc 2011-10-21 18:40:52.767139411 +0100 | 13 | +++ src/ui/gfx/gl/gl_implementation_linux.cc 2012-06-21 16:14:21.867172877 -0400 |
2635 | 14 | @@ -73,7 +73,7 @@ | 14 | @@ -75,7 +75,7 @@ |
2636 | 15 | } | 15 | } |
2637 | 16 | 16 | ||
2638 | 17 | base::NativeLibrary library = LoadLibrary( | 17 | base::NativeLibrary library = LoadLibrary( |
2639 | @@ -20,16 +20,3 @@ | |||
2640 | 20 | if (!library) | 20 | if (!library) |
2641 | 21 | return false; | 21 | return false; |
2642 | 22 | 22 | ||
2643 | 23 | @@ -120,10 +120,10 @@ | ||
2644 | 24 | } | ||
2645 | 25 | #endif // !defined(USE_WAYLAND) | ||
2646 | 26 | case kGLImplementationEGLGLES2: { | ||
2647 | 27 | - base::NativeLibrary gles_library = LoadLibrary("libGLESv2.so"); | ||
2648 | 28 | + base::NativeLibrary gles_library = LoadLibrary("libGLESv2.so.2"); | ||
2649 | 29 | if (!gles_library) | ||
2650 | 30 | return false; | ||
2651 | 31 | - base::NativeLibrary egl_library = LoadLibrary("libEGL.so"); | ||
2652 | 32 | + base::NativeLibrary egl_library = LoadLibrary("libEGL.so.1"); | ||
2653 | 33 | if (!egl_library) { | ||
2654 | 34 | base::UnloadNativeLibrary(gles_library); | ||
2655 | 35 | return false; | ||
2656 | 36 | 23 | ||
2657 | === modified file 'debian/patches/fix-armhf-ftbfs.patch' | |||
2658 | --- debian/patches/fix-armhf-ftbfs.patch 2012-03-07 07:24:59 +0000 | |||
2659 | +++ debian/patches/fix-armhf-ftbfs.patch 2012-08-06 17:52:22 +0000 | |||
2660 | @@ -2,23 +2,11 @@ | |||
2661 | 2 | Subject: Fix FTBFS on armhf | 2 | Subject: Fix FTBFS on armhf |
2662 | 3 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/943281 | 3 | Bug-Ubuntu: https://bugs.launchpad.net/bugs/943281 |
2663 | 4 | 4 | ||
2664 | 5 | Index: src/build/common.gypi | ||
2665 | 6 | =================================================================== | ||
2666 | 7 | --- src.orig/build/common.gypi 2012-03-05 10:39:30.082526500 +0200 | ||
2667 | 8 | +++ src/build/common.gypi 2012-03-05 11:02:24.082526500 +0200 | ||
2668 | 9 | @@ -1814,7 +1814,6 @@ | ||
2669 | 10 | 'cflags': [ | ||
2670 | 11 | '-march=armv7-a', | ||
2671 | 12 | '-mtune=cortex-a8', | ||
2672 | 13 | - '-mfloat-abi=softfp', | ||
2673 | 14 | ], | ||
2674 | 15 | 'conditions': [ | ||
2675 | 16 | ['arm_neon==1', { | ||
2676 | 17 | Index: src/native_client/build/common.gypi | 5 | Index: src/native_client/build/common.gypi |
2677 | 18 | =================================================================== | 6 | =================================================================== |
2681 | 19 | --- src.orig/native_client/build/common.gypi 2012-02-15 23:35:45.000000000 +0200 | 7 | --- src.orig/native_client/build/common.gypi 2012-06-21 14:40:40.000000000 -0400 |
2682 | 20 | +++ src/native_client/build/common.gypi 2012-03-05 11:03:09.160651492 +0200 | 8 | +++ src/native_client/build/common.gypi 2012-06-21 16:16:02.195176177 -0400 |
2683 | 21 | @@ -289,7 +289,6 @@ | 9 | @@ -294,7 +294,6 @@ |
2684 | 22 | '-march=armv7-a', | 10 | '-march=armv7-a', |
2685 | 23 | '-mtune=cortex-a8', | 11 | '-mtune=cortex-a8', |
2686 | 24 | '-mfpu=neon', | 12 | '-mfpu=neon', |
2687 | @@ -26,15 +14,3 @@ | |||
2688 | 26 | '-fno-exceptions', | 14 | '-fno-exceptions', |
2689 | 27 | '-Wall', | 15 | '-Wall', |
2690 | 28 | '-fPIC', | 16 | '-fPIC', |
2691 | 29 | Index: src/third_party/ffmpeg/ffmpeg.gyp | ||
2692 | 30 | =================================================================== | ||
2693 | 31 | --- src.orig/third_party/ffmpeg/ffmpeg.gyp 2012-02-15 23:35:36.000000000 +0200 | ||
2694 | 32 | +++ src/third_party/ffmpeg/ffmpeg.gyp 2012-03-05 11:02:34.004401501 +0200 | ||
2695 | 33 | @@ -170,7 +170,6 @@ | ||
2696 | 34 | '-mthumb', | ||
2697 | 35 | '-march=armv7-a', | ||
2698 | 36 | '-mtune=cortex-a8', | ||
2699 | 37 | - '-mfloat-abi=softfp', | ||
2700 | 38 | ], | ||
2701 | 39 | 'conditions': [ | ||
2702 | 40 | ['arm_neon == 0', { | ||
2703 | 41 | 17 | ||
2704 | === added file 'debian/patches/grd_parse_fix.patch' | |||
2705 | --- debian/patches/grd_parse_fix.patch 1970-01-01 00:00:00 +0000 | |||
2706 | +++ debian/patches/grd_parse_fix.patch 2012-08-06 17:52:22 +0000 | |||
2707 | @@ -0,0 +1,12 @@ | |||
2708 | 1 | Index: src/chrome/app/chromium_strings.grd | ||
2709 | 2 | =================================================================== | ||
2710 | 3 | --- src.orig/chrome/app/chromium_strings.grd 2012-07-09 14:16:01.091449368 -0400 | ||
2711 | 4 | +++ src/chrome/app/chromium_strings.grd 2012-07-09 14:25:12.951467521 -0400 | ||
2712 | 5 | @@ -111,7 +111,6 @@ | ||
2713 | 6 | <if expr="not pp_ifdef('use_third_party_translations')"> | ||
2714 | 7 | <file path="resources/chromium_strings_am.xtb" lang="am" /> | ||
2715 | 8 | <file path="resources/chromium_strings_ar.xtb" lang="ar" /> | ||
2716 | 9 | - </if> | ||
2717 | 10 | <file path="../../third_party/launchpad_translations/chromium_strings_ast.xtb" lang="ast" /> | ||
2718 | 11 | <file path="../../third_party/launchpad_translations/chromium_strings_bg.xtb" lang="bg" /> | ||
2719 | 12 | <file path="resources/chromium_strings_bn.xtb" lang="bn" /> | ||
2720 | 0 | 13 | ||
2721 | === modified file 'debian/patches/series' | |||
2722 | --- debian/patches/series 2012-03-30 08:42:27 +0000 | |||
2723 | +++ debian/patches/series 2012-08-06 17:52:22 +0000 | |||
2724 | @@ -1,8 +1,13 @@ | |||
2725 | 1 | # system_v8.patch | 1 | # system_v8.patch |
2726 | 2 | ubuntu_dont_overwrite_default_download_directory.patch | ||
2727 | 3 | chromium_useragent.patch | 2 | chromium_useragent.patch |
2728 | 4 | disable_dlog_and_dcheck_in_release_builds.patch | 3 | disable_dlog_and_dcheck_in_release_builds.patch |
2729 | 5 | webkit_rev_parser.patch | 4 | webkit_rev_parser.patch |
2730 | 6 | dlopen_sonamed_gl.patch | 5 | dlopen_sonamed_gl.patch |
2731 | 7 | glib-header-single-entry.patch | ||
2732 | 8 | fix-armhf-ftbfs.patch | 6 | fix-armhf-ftbfs.patch |
2733 | 7 | arm.patch | ||
2734 | 8 | grd_parse_fix.patch | ||
2735 | 9 | 1-infobars.patch | ||
2736 | 10 | 2-get-domain-tld.patch | ||
2737 | 11 | 3-chrome-xid.patch | ||
2738 | 12 | chromeless-window-launch-option.patch | ||
2739 | 13 | desktop-integration-settings.patch | ||
2740 | 9 | 14 | ||
2741 | === removed file 'debian/patches/ubuntu_dont_overwrite_default_download_directory.patch' | |||
2742 | --- debian/patches/ubuntu_dont_overwrite_default_download_directory.patch 2011-05-06 22:59:06 +0000 | |||
2743 | +++ debian/patches/ubuntu_dont_overwrite_default_download_directory.patch 1970-01-01 00:00:00 +0000 | |||
2744 | @@ -1,47 +0,0 @@ | |||
2745 | 1 | See http://code.google.com/p/chromium/issues/detail?id=16442 | ||
2746 | 2 | Restore the default Downloads location used on Ubuntu. | ||
2747 | 3 | |||
2748 | 4 | --- | ||
2749 | 5 | chrome/common/chrome_paths_linux.cc | 15 --------------- | ||
2750 | 6 | 1 file changed, 15 deletions(-) | ||
2751 | 7 | |||
2752 | 8 | Index: src/chrome/common/chrome_paths_linux.cc | ||
2753 | 9 | =================================================================== | ||
2754 | 10 | --- src.orig/chrome/common/chrome_paths_linux.cc | ||
2755 | 11 | +++ src/chrome/common/chrome_paths_linux.cc | ||
2756 | 12 | @@ -79,35 +79,20 @@ | ||
2757 | 13 | } | ||
2758 | 14 | |||
2759 | 15 | bool GetUserDocumentsDirectory(FilePath* result) { | ||
2760 | 16 | scoped_ptr<base::Environment> env(base::Environment::Create()); | ||
2761 | 17 | *result = base::nix::GetXDGUserDirectory(env.get(), "DOCUMENTS", "Documents"); | ||
2762 | 18 | return true; | ||
2763 | 19 | } | ||
2764 | 20 | |||
2765 | 21 | -// We respect the user's preferred download location, unless it is | ||
2766 | 22 | -// ~ or their desktop directory, in which case we default to ~/Downloads. | ||
2767 | 23 | bool GetUserDownloadsDirectory(FilePath* result) { | ||
2768 | 24 | scoped_ptr<base::Environment> env(base::Environment::Create()); | ||
2769 | 25 | *result = base::nix::GetXDGUserDirectory(env.get(), "DOWNLOAD", | ||
2770 | 26 | kDownloadsDir); | ||
2771 | 27 | - | ||
2772 | 28 | - FilePath home = file_util::GetHomeDir(); | ||
2773 | 29 | - if (*result == home) { | ||
2774 | 30 | - *result = home.Append(kDownloadsDir); | ||
2775 | 31 | - return true; | ||
2776 | 32 | - } | ||
2777 | 33 | - | ||
2778 | 34 | - FilePath desktop; | ||
2779 | 35 | - GetUserDesktop(&desktop); | ||
2780 | 36 | - if (*result == desktop) { | ||
2781 | 37 | - *result = home.Append(kDownloadsDir); | ||
2782 | 38 | - } | ||
2783 | 39 | - | ||
2784 | 40 | return true; | ||
2785 | 41 | } | ||
2786 | 42 | |||
2787 | 43 | bool GetUserDesktop(FilePath* result) { | ||
2788 | 44 | scoped_ptr<base::Environment> env(base::Environment::Create()); | ||
2789 | 45 | *result = base::nix::GetXDGUserDirectory(env.get(), "DESKTOP", "Desktop"); | ||
2790 | 46 | return true; | ||
2791 | 47 | } | ||
2792 | 48 | 0 | ||
2793 | === modified file 'debian/rules' | |||
2794 | --- debian/rules 2012-06-18 14:17:58 +0000 | |||
2795 | +++ debian/rules 2012-08-06 17:52:22 +0000 | |||
2796 | @@ -72,9 +72,13 @@ | |||
2797 | 72 | # Disable NaCl until we figure out what to do with the private toolchain | 72 | # Disable NaCl until we figure out what to do with the private toolchain |
2798 | 73 | GYP_DEFINES += disable_nacl=1 | 73 | GYP_DEFINES += disable_nacl=1 |
2799 | 74 | 74 | ||
2800 | 75 | # do not use third_party/gold as the linker. | ||
2801 | 76 | GYP_DEFINES += linux_use_gold_binary=0 linux_use_gold_flags=0 | ||
2802 | 77 | |||
2803 | 75 | ifneq (,$(findstring armhf,$(DEB_BUILD_ARCH))) | 78 | ifneq (,$(findstring armhf,$(DEB_BUILD_ARCH))) |
2804 | 76 | GYP_DEFINES += \ | 79 | GYP_DEFINES += \ |
2805 | 77 | v8_use_arm_eabi_hardfloat=true \ | 80 | v8_use_arm_eabi_hardfloat=true \ |
2806 | 81 | arm_float_abi=hard \ | ||
2807 | 78 | $(NULL) | 82 | $(NULL) |
2808 | 79 | endif | 83 | endif |
2809 | 80 | 84 | ||
2810 | @@ -143,6 +147,17 @@ | |||
2811 | 143 | 147 | ||
2812 | 144 | CC_VERSION := $(shell gcc -dumpversion | cut -d. -f-2) | 148 | CC_VERSION := $(shell gcc -dumpversion | cut -d. -f-2) |
2813 | 145 | 149 | ||
2814 | 150 | # Set this to use gcc 4.6 instead of 4.7 | ||
2815 | 151 | AVOID_GCC_47 ?= 1 | ||
2816 | 152 | ifeq (4.7,$(CC_VERSION)) | ||
2817 | 153 | GYP_DEFINES += werror=$(NULL) | ||
2818 | 154 | ifeq (1,$(AVOID_GCC_47)) | ||
2819 | 155 | CC := gcc-4.6 | ||
2820 | 156 | CXX := g++-4.6 | ||
2821 | 157 | BUILD_ARGS += CC=$(CC) CXX=$(CXX) CC.host=$(CC) CXX.host=$(CXX) LINK.host=$(CXX) | ||
2822 | 158 | endif | ||
2823 | 159 | endif | ||
2824 | 160 | |||
2825 | 146 | # Set this to use gcc 4.5 instead of 4.6 | 161 | # Set this to use gcc 4.5 instead of 4.6 |
2826 | 147 | AVOID_GCC_46 ?= 0 | 162 | AVOID_GCC_46 ?= 0 |
2827 | 148 | 163 | ||
2828 | @@ -235,6 +250,14 @@ | |||
2829 | 235 | FFMPEG_MT_STD_GYP_DEFINES = $(NULL) | 250 | FFMPEG_MT_STD_GYP_DEFINES = $(NULL) |
2830 | 236 | FFMPEG_MT_EXTRA_GYP_DEFINES = ffmpeg_branding=Chrome | 251 | FFMPEG_MT_EXTRA_GYP_DEFINES = ffmpeg_branding=Chrome |
2831 | 237 | 252 | ||
2832 | 253 | ifneq (,$(filter 12.10 unstable development,$(DEBIAN_DIST))) | ||
2833 | 254 | # enable compile-time dependency on gnome-keyring | ||
2834 | 255 | GYP_DEFINES += use_gnome_keyring=1 linux_link_gnome_keyring=1 | ||
2835 | 256 | # controlling the use of GConf (the classic GNOME configuration | ||
2836 | 257 | # and GIO, which contains GSettings (the new GNOME config system) | ||
2837 | 258 | GYP_DEFINES += use_gconf=1 use_gio=1 | ||
2838 | 259 | endif | ||
2839 | 260 | |||
2840 | 238 | USE_SYSTEM_SQLITE := $(shell pkg-config 'sqlite3 >= 3.6.1' && echo 1 || echo 0) | 261 | USE_SYSTEM_SQLITE := $(shell pkg-config 'sqlite3 >= 3.6.1' && echo 1 || echo 0) |
2841 | 239 | USE_SYSTEM_SQLITE := 0 | 262 | USE_SYSTEM_SQLITE := 0 |
2842 | 240 | 263 | ||
2843 | @@ -549,6 +572,7 @@ | |||
2844 | 549 | third_party/ffmpeg/binaries \ | 572 | third_party/ffmpeg/binaries \ |
2845 | 550 | third_party/fuzzymatch \ | 573 | third_party/fuzzymatch \ |
2846 | 551 | third_party/gles_book_examples \ | 574 | third_party/gles_book_examples \ |
2847 | 575 | third_party/gold \ | ||
2848 | 552 | third_party/hunspell/dictionaries \ | 576 | third_party/hunspell/dictionaries \ |
2849 | 553 | third_party/icu/mac \ | 577 | third_party/icu/mac \ |
2850 | 554 | third_party/lcov \ | 578 | third_party/lcov \ |