OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #endif // defined(OS_WIN) | 9 #endif // defined(OS_WIN) |
10 | 10 |
(...skipping 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/tab_contents/tab_contents.h" | 26 #include "chrome/browser/tab_contents/tab_contents.h" |
27 #include "chrome/common/chrome_constants.h" | 27 #include "chrome/common/chrome_constants.h" |
28 #include "chrome/common/chrome_paths.h" | 28 #include "chrome/common/chrome_paths.h" |
29 #include "chrome/common/chrome_plugin_util.h" | 29 #include "chrome/common/chrome_plugin_util.h" |
30 #include "chrome/common/notification_registrar.h" | 30 #include "chrome/common/notification_registrar.h" |
31 #include "chrome/common/notification_service.h" | 31 #include "chrome/common/notification_service.h" |
32 #include "chrome/common/url_constants.h" | 32 #include "chrome/common/url_constants.h" |
33 #include "webkit/glue/dom_operations.h" | 33 #include "webkit/glue/dom_operations.h" |
34 | 34 |
35 #if defined(OS_LINUX) | 35 #if defined(OS_LINUX) |
36 #include "base/env_var.h" | 36 #include "base/environment.h" |
37 #endif // defined(OS_LINUX) | 37 #endif // defined(OS_LINUX) |
38 | 38 |
39 #if defined(OS_WIN) | 39 #if defined(OS_WIN) |
40 #include "base/win_util.h" | 40 #include "base/win_util.h" |
41 #include "gfx/icon_util.h" | 41 #include "gfx/icon_util.h" |
42 #endif // defined(OS_WIN) | 42 #endif // defined(OS_WIN) |
43 | 43 |
44 namespace { | 44 namespace { |
45 | 45 |
46 #if defined(OS_WIN) | 46 #if defined(OS_WIN) |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
252 | 252 |
253 if (callback_ != NULL) | 253 if (callback_ != NULL) |
254 message_loop_->PostTask(FROM_HERE, | 254 message_loop_->PostTask(FROM_HERE, |
255 new CreateShortcutCallbackTask(callback_, success)); | 255 new CreateShortcutCallbackTask(callback_, success)); |
256 } | 256 } |
257 | 257 |
258 bool CreateShortcutTask::CreateShortcut() { | 258 bool CreateShortcutTask::CreateShortcut() { |
259 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); | 259 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::FILE)); |
260 | 260 |
261 #if defined(OS_LINUX) | 261 #if defined(OS_LINUX) |
262 scoped_ptr<base::EnvVarGetter> env_getter(base::EnvVarGetter::Create()); | 262 scoped_ptr<base::Environment> env(base::Environment::Create()); |
263 | 263 |
264 std::string shortcut_template; | 264 std::string shortcut_template; |
265 if (!ShellIntegration::GetDesktopShortcutTemplate(env_getter.get(), | 265 if (!ShellIntegration::GetDesktopShortcutTemplate(env.get(), |
266 &shortcut_template)) { | 266 &shortcut_template)) { |
267 return false; | 267 return false; |
268 } | 268 } |
269 ShellIntegration::CreateDesktopShortcut(shortcut_info_, shortcut_template); | 269 ShellIntegration::CreateDesktopShortcut(shortcut_info_, shortcut_template); |
270 return true; // assuming always success. | 270 return true; // assuming always success. |
271 #elif defined(OS_WIN) | 271 #elif defined(OS_WIN) |
272 // Shortcut paths under which to create shortcuts. | 272 // Shortcut paths under which to create shortcuts. |
273 std::vector<FilePath> shortcut_paths; | 273 std::vector<FilePath> shortcut_paths; |
274 | 274 |
275 // Locations to add to shortcut_paths. | 275 // Locations to add to shortcut_paths. |
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
754 | 754 |
755 void UpdateShortcutForTabContents(TabContents* tab_contents) { | 755 void UpdateShortcutForTabContents(TabContents* tab_contents) { |
756 #if defined(OS_WIN) | 756 #if defined(OS_WIN) |
757 // UpdateShortcutWorker will delete itself when it's done. | 757 // UpdateShortcutWorker will delete itself when it's done. |
758 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); | 758 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); |
759 worker->Run(); | 759 worker->Run(); |
760 #endif // defined(OS_WIN) | 760 #endif // defined(OS_WIN) |
761 } | 761 } |
762 | 762 |
763 }; // namespace web_app | 763 }; // namespace web_app |
OLD | NEW |