Index: chrome/browser/web_applications/web_app.cc |
diff --git a/chrome/browser/web_applications/web_app.cc b/chrome/browser/web_applications/web_app.cc |
index 089ad696eb033305dcfcdc825f70fcbb679aab60..7aa22516f1d4e519de216d3abe231cea4f7819d9 100644 |
--- a/chrome/browser/web_applications/web_app.cc |
+++ b/chrome/browser/web_applications/web_app.cc |
@@ -13,6 +13,8 @@ |
#include "base/strings/utf_string_conversions.h" |
#include "base/threading/thread.h" |
#include "chrome/browser/extensions/image_loader.h" |
+#include "chrome/browser/extensions/tab_helper.h" |
+#include "chrome/browser/favicon/favicon_tab_helper.h" |
#include "chrome/browser/profiles/profile.h" |
#include "chrome/common/chrome_constants.h" |
#include "chrome/common/chrome_version_info.h" |
@@ -27,11 +29,14 @@ |
#include "skia/ext/image_operations.h" |
#include "third_party/skia/include/core/SkBitmap.h" |
#include "ui/base/resource/resource_bundle.h" |
-#include "ui/gfx/icon_util.h" |
#include "ui/gfx/image/image.h" |
#include "ui/gfx/image/image_family.h" |
#include "ui/gfx/image/image_skia.h" |
+#if defined(OS_WIN) |
+#include "ui/gfx/icon_util.h" |
+#endif |
+ |
using content::BrowserThread; |
namespace { |
@@ -131,6 +136,30 @@ base::FilePath GetSanitizedFileName(const base::string16& name) { |
} // namespace internals |
+void GetShortcutInfoForTab(content::WebContents* web_contents, |
+ ShellIntegration::ShortcutInfo* info) { |
+ DCHECK(info); // Must provide a valid info. |
+ |
+ const FaviconTabHelper* favicon_tab_helper = |
+ FaviconTabHelper::FromWebContents(web_contents); |
+ const extensions::TabHelper* extensions_tab_helper = |
+ extensions::TabHelper::FromWebContents(web_contents); |
+ const WebApplicationInfo& app_info = extensions_tab_helper->web_app_info(); |
+ |
+ info->url = app_info.app_url.is_empty() ? web_contents->GetURL() : |
+ app_info.app_url; |
+ info->title = app_info.title.empty() ? |
+ (web_contents->GetTitle().empty() ? base::UTF8ToUTF16(info->url.spec()) : |
benwells
2014/03/28 02:55:26
Is this clang format?
jackhou1
2014/04/02 03:25:56
This is just copied directly from web_app_ui.cc. I
|
+ web_contents->GetTitle()) : |
+ app_info.title; |
+ info->description = app_info.description; |
+ info->favicon.Add(favicon_tab_helper->GetFavicon()); |
+ |
+ Profile* profile = |
+ Profile::FromBrowserContext(web_contents->GetBrowserContext()); |
+ info->profile_path = profile->GetPath(); |
+} |
+ |
ShellIntegration::ShortcutInfo ShortcutInfoForExtensionAndProfile( |
const extensions::Extension* app, Profile* profile) { |
ShellIntegration::ShortcutInfo shortcut_info; |