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

Side by Side Diff: chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.cc

Issue 10097004: Moved Linux specific shell integration declarations into own header. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | chrome/browser/ui/gtk/unity_service.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/gtk/create_application_shortcuts_dialog_gtk.h" 5 #include "chrome/browser/ui/gtk/create_application_shortcuts_dialog_gtk.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/environment.h" 10 #include "base/environment.h"
11 #include "base/utf_string_conversions.h" 11 #include "base/utf_string_conversions.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/shell_integration.h" 13 #include "chrome/browser/shell_integration.h"
14 #include "chrome/browser/shell_integration_linux.h"
14 #include "chrome/browser/ui/gtk/gtk_util.h" 15 #include "chrome/browser/ui/gtk/gtk_util.h"
15 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" 16 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h"
16 #include "chrome/browser/ui/web_applications/web_app_ui.h" 17 #include "chrome/browser/ui/web_applications/web_app_ui.h"
17 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 18 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
18 #include "chrome/browser/web_applications/web_app.h" 19 #include "chrome/browser/web_applications/web_app.h"
19 #include "chrome/common/extensions/extension.h" 20 #include "chrome/common/extensions/extension.h"
20 #include "chrome/common/extensions/extension_resource.h" 21 #include "chrome/common/extensions/extension_resource.h"
21 #include "content/public/browser/browser_thread.h" 22 #include "content/public/browser/browser_thread.h"
22 #include "content/public/browser/web_contents.h" 23 #include "content/public/browser/web_contents.h"
23 #include "content/public/browser/web_contents_delegate.h" 24 #include "content/public/browser/web_contents_delegate.h"
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
212 Release(); 213 Release();
213 } 214 }
214 215
215 void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut( 216 void CreateApplicationShortcutsDialogGtk::CreateDesktopShortcut(
216 const ShellIntegration::ShortcutInfo& shortcut_info) { 217 const ShellIntegration::ShortcutInfo& shortcut_info) {
217 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 218 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
218 219
219 scoped_ptr<base::Environment> env(base::Environment::Create()); 220 scoped_ptr<base::Environment> env(base::Environment::Create());
220 221
221 std::string shortcut_template; 222 std::string shortcut_template;
222 if (ShellIntegration::GetDesktopShortcutTemplate(env.get(), 223 if (ShellIntegrationLinux::GetDesktopShortcutTemplate(env.get(),
223 &shortcut_template)) { 224 &shortcut_template)) {
224 ShellIntegration::CreateDesktopShortcut(shortcut_info, 225 ShellIntegrationLinux::CreateDesktopShortcut(shortcut_info,
225 shortcut_template); 226 shortcut_template);
226 Release(); 227 Release();
227 } else { 228 } else {
228 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 229 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
229 base::Bind(&CreateApplicationShortcutsDialogGtk::ShowErrorDialog, 230 base::Bind(&CreateApplicationShortcutsDialogGtk::ShowErrorDialog,
230 this)); 231 this));
231 } 232 }
232 } 233 }
233 234
234 void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() { 235 void CreateApplicationShortcutsDialogGtk::ShowErrorDialog() {
235 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 236 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
(...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE)); 361 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::FILE));
361 362
362 if (web_app::CreateShortcutOnFileThread(profile_path_, shortcut_info)) { 363 if (web_app::CreateShortcutOnFileThread(profile_path_, shortcut_info)) {
363 Release(); 364 Release();
364 } else { 365 } else {
365 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE, 366 BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
366 base::Bind(&CreateChromeApplicationShortcutsDialogGtk::ShowErrorDialog, 367 base::Bind(&CreateChromeApplicationShortcutsDialogGtk::ShowErrorDialog,
367 this)); 368 this));
368 } 369 }
369 } 370 }
OLDNEW
« no previous file with comments | « chrome/browser/shell_integration_unittest.cc ('k') | chrome/browser/ui/gtk/unity_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698