| 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 722 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 733 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, | 733 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, |
| 734 new CreateShortcutTask(data_dir, shortcut_info, callback)); | 734 new CreateShortcutTask(data_dir, shortcut_info, callback)); |
| 735 } | 735 } |
| 736 | 736 |
| 737 bool IsValidUrl(const GURL& url) { | 737 bool IsValidUrl(const GURL& url) { |
| 738 static const char* const kValidUrlSchemes[] = { | 738 static const char* const kValidUrlSchemes[] = { |
| 739 chrome::kFileScheme, | 739 chrome::kFileScheme, |
| 740 chrome::kFtpScheme, | 740 chrome::kFtpScheme, |
| 741 chrome::kHttpScheme, | 741 chrome::kHttpScheme, |
| 742 chrome::kHttpsScheme, | 742 chrome::kHttpsScheme, |
| 743 chrome::kHttpsvScheme, |
| 743 chrome::kExtensionScheme, | 744 chrome::kExtensionScheme, |
| 744 }; | 745 }; |
| 745 | 746 |
| 746 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { | 747 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { |
| 747 if (url.SchemeIs(kValidUrlSchemes[i])) | 748 if (url.SchemeIs(kValidUrlSchemes[i])) |
| 748 return true; | 749 return true; |
| 749 } | 750 } |
| 750 | 751 |
| 751 return false; | 752 return false; |
| 752 } | 753 } |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 790 | 791 |
| 791 void UpdateShortcutForTabContents(TabContents* tab_contents) { | 792 void UpdateShortcutForTabContents(TabContents* tab_contents) { |
| 792 #if defined(OS_WIN) | 793 #if defined(OS_WIN) |
| 793 // UpdateShortcutWorker will delete itself when it's done. | 794 // UpdateShortcutWorker will delete itself when it's done. |
| 794 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); | 795 UpdateShortcutWorker* worker = new UpdateShortcutWorker(tab_contents); |
| 795 worker->Run(); | 796 worker->Run(); |
| 796 #endif // defined(OS_WIN) | 797 #endif // defined(OS_WIN) |
| 797 } | 798 } |
| 798 | 799 |
| 799 }; // namespace web_app | 800 }; // namespace web_app |
| OLD | NEW |