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 #include <shlobj.h> | 9 #include <shlobj.h> |
10 #endif // defined(OS_WIN) | 10 #endif // defined(OS_WIN) |
(...skipping 10 matching lines...) Expand all Loading... |
21 #include "base/threading/thread.h" | 21 #include "base/threading/thread.h" |
22 #include "base/scoped_ptr.h" | 22 #include "base/scoped_ptr.h" |
23 #include "base/utf_string_conversions.h" | 23 #include "base/utf_string_conversions.h" |
24 #include "base/win/windows_version.h" | 24 #include "base/win/windows_version.h" |
25 #include "chrome/browser/browser_thread.h" | 25 #include "chrome/browser/browser_thread.h" |
26 #include "chrome/browser/download/download_util.h" | 26 #include "chrome/browser/download/download_util.h" |
27 #include "chrome/browser/profiles/profile.h" | 27 #include "chrome/browser/profiles/profile.h" |
28 #include "chrome/browser/tab_contents/tab_contents.h" | 28 #include "chrome/browser/tab_contents/tab_contents.h" |
29 #include "chrome/common/chrome_constants.h" | 29 #include "chrome/common/chrome_constants.h" |
30 #include "chrome/common/chrome_paths.h" | 30 #include "chrome/common/chrome_paths.h" |
31 #include "chrome/common/chrome_plugin_util.h" | |
32 #include "chrome/common/extensions/extension.h" | 31 #include "chrome/common/extensions/extension.h" |
33 #include "chrome/common/notification_registrar.h" | 32 #include "chrome/common/notification_registrar.h" |
34 #include "chrome/common/url_constants.h" | 33 #include "chrome/common/url_constants.h" |
35 #include "chrome/common/web_apps.h" | 34 #include "chrome/common/web_apps.h" |
36 | 35 |
37 #if defined(OS_LINUX) | 36 #if defined(OS_LINUX) |
38 #include "base/environment.h" | 37 #include "base/environment.h" |
39 #endif // defined(OS_LINUX) | 38 #endif // defined(OS_LINUX) |
40 | 39 |
41 #if defined(OS_WIN) | 40 #if defined(OS_WIN) |
(...skipping 588 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
630 &UpdateShortcutWorker::UpdateShortcutsOnFileThread)); | 629 &UpdateShortcutWorker::UpdateShortcutsOnFileThread)); |
631 } | 630 } |
632 | 631 |
633 void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { | 632 void UpdateShortcutWorker::UpdateShortcutsOnFileThread() { |
634 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); | 633 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); |
635 | 634 |
636 FilePath web_app_path = GetWebAppDataDirectory( | 635 FilePath web_app_path = GetWebAppDataDirectory( |
637 web_app::GetDataDir(profile_path_), shortcut_info_); | 636 web_app::GetDataDir(profile_path_), shortcut_info_); |
638 | 637 |
639 // Ensure web_app_path exists. web_app_path could be missing for a legacy | 638 // Ensure web_app_path exists. web_app_path could be missing for a legacy |
640 // shortcut created by gears. | 639 // shortcut created by Gears. |
641 if (!file_util::PathExists(web_app_path) && | 640 if (!file_util::PathExists(web_app_path) && |
642 !file_util::CreateDirectory(web_app_path)) { | 641 !file_util::CreateDirectory(web_app_path)) { |
643 NOTREACHED(); | 642 NOTREACHED(); |
644 return; | 643 return; |
645 } | 644 } |
646 | 645 |
647 FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension( | 646 FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension( |
648 FILE_PATH_LITERAL(".ico")); | 647 FILE_PATH_LITERAL(".ico")); |
649 CheckAndSaveIcon(icon_file, shortcut_info_.favicon); | 648 CheckAndSaveIcon(icon_file, shortcut_info_.favicon); |
650 | 649 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
790 | 789 |
791 void UpdateShortcutForTabContents(TabContents* tab_contents) { | 790 void UpdateShortcutForTabContents(TabContents* tab_contents) { |
792 #if defined(OS_WIN) | 791 #if defined(OS_WIN) |
793 // UpdateShortcutWorker will delete itself when it's done. | 792 // UpdateShortcutWorker will delete itself when it's done. |
794 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); | 793 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); |
795 worker->Run(); | 794 worker->Run(); |
796 #endif // defined(OS_WIN) | 795 #endif // defined(OS_WIN) |
797 } | 796 } |
798 | 797 |
799 }; // namespace web_app | 798 }; // namespace web_app |
OLD | NEW |