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

Unified Diff: chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc

Issue 9958006: Create Linux platform app shortcuts to run in their own process. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Create updated shortcuts from NTP, add enable flag Created 8 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
Index: chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
diff --git a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
index cac3d5ab83343c537809c2da42f7f43055657683..0955b8a7b01e9a725d4cf668ad57c98c30bfac85 100644
--- a/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
+++ b/chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc
@@ -9,11 +9,13 @@
#include "base/bind.h"
#include "base/environment.h"
#include "base/utf_string_conversions.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/shell_integration.h"
#include "chrome/browser/ui/gtk/gtk_util.h"
#include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
#include "chrome/browser/ui/web_applications/web_app_ui.h"
#include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
+#include "chrome/browser/web_applications/web_app.h"
#include "chrome/common/extensions/extension.h"
#include "chrome/common/extensions/extension_resource.h"
#include "content/public/browser/browser_thread.h"
@@ -47,8 +49,9 @@ void CreateWebApplicationShortcutsDialogGtk::Show(
}
void CreateChromeApplicationShortcutsDialogGtk::Show(GtkWindow* parent,
+ Profile* profile,
const Extension* app) {
- new CreateChromeApplicationShortcutsDialogGtk(parent, app);
+ new CreateChromeApplicationShortcutsDialogGtk(parent, profile, app);
}
@@ -301,13 +304,17 @@ void CreateWebApplicationShortcutsDialogGtk::OnCreatedShortcut() {
CreateChromeApplicationShortcutsDialogGtk::
CreateChromeApplicationShortcutsDialogGtk(
GtkWindow* parent,
+ Profile* profile,
const Extension* app)
: CreateApplicationShortcutsDialogGtk(parent),
app_(app),
+ profile_path_(profile->GetPath()),
ALLOW_THIS_IN_INITIALIZER_LIST(tracker_(this)) {
// Get shortcut information now, it's needed for our UI.
shortcut_info_.extension_id = app_->id();
+ shortcut_info_.extension_path = app_->path();
+ shortcut_info_.is_platform_app = app_->is_platform_app();
shortcut_info_.url = GURL(app_->launch_web_url());
shortcut_info_.title = UTF8ToUTF16(app_->name());
shortcut_info_.description = UTF8ToUTF16(app_->description());
@@ -347,3 +354,16 @@ void CreateChromeApplicationShortcutsDialogGtk::OnImageLoaded(
CreateIconPixBuf(shortcut_info_.favicon);
CreateDialogBox(parent_);
}
+
+void CreateChromeApplicationShortcutsDialogGtk::CreateDesktopShortcut(
+ const ShellIntegration::ShortcutInfo& shortcut_info) {
+ DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
+
+ if (web_app::CreateShortcutOnFileThread(profile_path_, shortcut_info)) {
+ Release();
+ } else {
+ BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
+ base::Bind(&CreateChromeApplicationShortcutsDialogGtk::ShowErrorDialog,
+ this));
+ }
+}

Powered by Google App Engine
This is Rietveld 408576698