Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(955)

Unified Diff: chrome/browser/web_applications/web_app.cc

Issue 213113005: Remove web_app_ui.[cc|h]. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 5149be787b16580945f238ce0b98bce8f501f825..0d90975b5fe774dc88213b3120c2ec3a644db35b 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"
@@ -134,6 +136,34 @@ 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()) :
+ 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();
+}
+
+#if !defined(OS_WIN)
+void UpdateShortcutForTabContents(content::WebContents* web_contents) {}
+#endif
+
ShellIntegration::ShortcutInfo ShortcutInfoForExtensionAndProfile(
const extensions::Extension* app, Profile* profile) {
ShellIntegration::ShortcutInfo shortcut_info;
« no previous file with comments | « chrome/browser/web_applications/web_app.h ('k') | chrome/browser/web_applications/web_app_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698