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

Unified Diff: chrome/browser/web_applications/web_app_mac.mm

Issue 231673005: Move ShortcutInfo, ShortcutLocations from ShellIntegration to web_app. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comments Created 6 years, 8 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
Index: chrome/browser/web_applications/web_app_mac.mm
diff --git a/chrome/browser/web_applications/web_app_mac.mm b/chrome/browser/web_applications/web_app_mac.mm
index 28ad88595f88bd172c1e6aa39cea7c75f0d00c64..b5241c82e469eedf5ad169646296534f2a6332f2 100644
--- a/chrome/browser/web_applications/web_app_mac.mm
+++ b/chrome/browser/web_applications/web_app_mac.mm
@@ -26,6 +26,7 @@
#include "base/strings/utf_string_conversions.h"
#import "chrome/browser/mac/dock.h"
#include "chrome/browser/profiles/profile.h"
+#include "chrome/browser/shell_integration.h"
#include "chrome/common/chrome_constants.h"
#include "chrome/common/chrome_paths.h"
#include "chrome/common/chrome_switches.h"
@@ -203,7 +204,7 @@ bool HasSameUserDataDir(const base::FilePath& bundle_path) {
}
void LaunchShimOnFileThread(
- const ShellIntegration::ShortcutInfo& shortcut_info) {
+ const web_app::ShortcutInfo& shortcut_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
base::FilePath shim_path = web_app::GetAppInstallPath(shortcut_info);
@@ -388,11 +389,11 @@ std::vector<base::FilePath> GetAllAppBundlesInPath(
return bundle_paths;
}
-ShellIntegration::ShortcutInfo BuildShortcutInfoFromBundle(
+web_app::ShortcutInfo BuildShortcutInfoFromBundle(
const base::FilePath& bundle_path) {
NSDictionary* plist = ReadPlist(GetPlistPath(bundle_path));
- ShellIntegration::ShortcutInfo shortcut_info;
+ web_app::ShortcutInfo shortcut_info;
shortcut_info.extension_id = base::SysNSStringToUTF8(
[plist valueForKey:app_mode::kCrAppModeShortcutIDKey]);
shortcut_info.is_platform_app = true;
@@ -428,7 +429,7 @@ void ShowCreateChromeAppShortcutsDialog(gfx::NativeWindow /*parent_window*/,
// Normally we would show a dialog, but since we always create the app
// shortcut in ~/Applications there are no options for the user to choose.
web_app::CreateShortcuts(web_app::SHORTCUT_CREATION_BY_USER,
- ShellIntegration::ShortcutLocations(),
+ web_app::ShortcutLocations(),
profile,
app);
if (!close_callback.is_null())
@@ -441,7 +442,7 @@ namespace web_app {
WebAppShortcutCreator::WebAppShortcutCreator(
const base::FilePath& app_data_dir,
- const ShellIntegration::ShortcutInfo& shortcut_info)
+ const web_app::ShortcutInfo& shortcut_info)
: app_data_dir_(app_data_dir),
info_(shortcut_info) {}
@@ -521,7 +522,7 @@ size_t WebAppShortcutCreator::CreateShortcutsIn(
bool WebAppShortcutCreator::CreateShortcuts(
ShortcutCreationReason creation_reason,
- ShellIntegration::ShortcutLocations creation_locations) {
+ web_app::ShortcutLocations creation_locations) {
const base::FilePath applications_dir = GetApplicationsDirname();
if (applications_dir.empty() ||
!base::DirectoryExists(applications_dir.DirName())) {
@@ -794,12 +795,12 @@ void WebAppShortcutCreator::RevealAppShimInFinder() const {
}
base::FilePath GetAppInstallPath(
- const ShellIntegration::ShortcutInfo& shortcut_info) {
+ const web_app::ShortcutInfo& shortcut_info) {
WebAppShortcutCreator shortcut_creator(base::FilePath(), shortcut_info);
return shortcut_creator.GetApplicationsShortcutPath();
}
-void MaybeLaunchShortcut(const ShellIntegration::ShortcutInfo& shortcut_info) {
+void MaybeLaunchShortcut(const web_app::ShortcutInfo& shortcut_info) {
if (!apps::IsAppShimsEnabled())
return;
@@ -812,9 +813,9 @@ namespace internals {
bool CreatePlatformShortcuts(
const base::FilePath& app_data_path,
- const ShellIntegration::ShortcutInfo& shortcut_info,
+ const web_app::ShortcutInfo& shortcut_info,
const extensions::FileHandlersInfo& file_handlers_info,
- const ShellIntegration::ShortcutLocations& creation_locations,
+ const web_app::ShortcutLocations& creation_locations,
ShortcutCreationReason creation_reason) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
WebAppShortcutCreator shortcut_creator(app_data_path, shortcut_info);
@@ -823,7 +824,7 @@ bool CreatePlatformShortcuts(
void DeletePlatformShortcuts(
const base::FilePath& app_data_path,
- const ShellIntegration::ShortcutInfo& shortcut_info) {
+ const web_app::ShortcutInfo& shortcut_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
WebAppShortcutCreator shortcut_creator(app_data_path, shortcut_info);
shortcut_creator.DeleteShortcuts();
@@ -832,7 +833,7 @@ void DeletePlatformShortcuts(
void UpdatePlatformShortcuts(
const base::FilePath& app_data_path,
const base::string16& old_app_title,
- const ShellIntegration::ShortcutInfo& shortcut_info,
+ const web_app::ShortcutInfo& shortcut_info,
const extensions::FileHandlersInfo& file_handlers_info) {
DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::FILE));
WebAppShortcutCreator shortcut_creator(app_data_path, shortcut_info);
@@ -846,7 +847,7 @@ void DeleteAllShortcutsForProfile(const base::FilePath& profile_path) {
for (std::vector<base::FilePath>::const_iterator it = bundles.begin();
it != bundles.end(); ++it) {
- ShellIntegration::ShortcutInfo shortcut_info =
+ web_app::ShortcutInfo shortcut_info =
BuildShortcutInfoFromBundle(*it);
WebAppShortcutCreator shortcut_creator(it->DirName(), shortcut_info);
shortcut_creator.DeleteShortcuts();
« no previous file with comments | « chrome/browser/web_applications/web_app_mac.h ('k') | chrome/browser/web_applications/web_app_mac_unittest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698