summaryrefslogtreecommitdiffstats
path: root/chrome/browser/gtk
diff options
context:
space:
mode:
authorxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 08:39:51 +0000
committerxiyuan@chromium.org <xiyuan@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2009-11-17 08:39:51 +0000
commited54318708245efdfcf7454d3aaebfd419f4448c (patch)
tree8e233da9e3ca2c2cb8b57f04d75dde3d1cf1f704 /chrome/browser/gtk
parent80cf356e08919b18f502f20864d6f6b72b48eb60 (diff)
downloadchromium_src-ed54318708245efdfcf7454d3aaebfd419f4448c.zip
chromium_src-ed54318708245efdfcf7454d3aaebfd419f4448c.tar.gz
chromium_src-ed54318708245efdfcf7454d3aaebfd419f4448c.tar.bz2
Implement web app shortcuts natively per issue 25528
- Implement a CreateApplicationShortcutView similar to the current Gears-based one; - Add a few profile prefs to persist user's last checked shortcut locations - Implement a web_app::CreateShortcut that stores icon under "<profile>/Web Applications" in a similar layout as gears (i.e. <host>/<scheme_port>/<web_app_title>.ico) and calls file_util code to creates shortcut on Windows; - Add Win7 taskbar pin/unpin support function to file_util; - Update TabContents to replace gears with new code; Note: - Gears dialog is modaless but this one is a modal dialog. - Gear's icon store is not migrated because gears icons could still be used by shortcuts created by gears and thus we could not delete them even after migration. And we are not using the local ico files in the dialog even if they exists. - New CreateApplicationShortcutView is included when TOOLKIT_VIEW is defined. However on platforms other than Windows, the actual CreateShortCut code is not implemented. Right now it calls ShellIntegration's CreateDesktopShort if OS_LINUX is defined and NOTREACHED() for other platforms. BUG=25528 TEST=Verify the new UI provides the same functionality as gears under XP/Vista and support pinning on Win 7. Review URL: http://codereview.chromium.org/372012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@32165 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/gtk')
-rw-r--r--chrome/browser/gtk/browser_window_gtk.cc13
-rw-r--r--chrome/browser/gtk/browser_window_gtk.h1
2 files changed, 13 insertions, 1 deletions
diff --git a/chrome/browser/gtk/browser_window_gtk.cc b/chrome/browser/gtk/browser_window_gtk.cc
index 53cc6ad..9a2bb4c 100644
--- a/chrome/browser/gtk/browser_window_gtk.cc
+++ b/chrome/browser/gtk/browser_window_gtk.cc
@@ -42,6 +42,7 @@
#include "chrome/browser/gtk/browser_toolbar_gtk.h"
#include "chrome/browser/gtk/cairo_cached_surface.h"
#include "chrome/browser/gtk/clear_browsing_data_dialog_gtk.h"
+#include "chrome/browser/gtk/create_application_shortcuts_dialog_gtk.h"
#include "chrome/browser/gtk/download_in_progress_dialog_gtk.h"
#include "chrome/browser/gtk/download_shelf_gtk.h"
#include "chrome/browser/gtk/edit_search_engine_dialog.h"
@@ -1218,6 +1219,16 @@ int BrowserWindowGtk::GetCommandId(const NativeWebKeyboardEvent& event) {
return command;
}
+void BrowserWindowGtk::ShowCreateShortcutsDialog(TabContents* tab_contents) {
+ SkBitmap bitmap;
+ if (tab_contents->FavIconIsValid())
+ bitmap = tab_contents->GetFavIcon();
+ CreateApplicationShortcutsDialogGtk::Show(window_,
+ tab_contents->GetURL(),
+ tab_contents->GetTitle(),
+ bitmap);
+}
+
void BrowserWindowGtk::ConfirmBrowserCloseWithPendingDownloads() {
new DownloadInProgressDialogGtk(browser());
}
@@ -1435,7 +1446,7 @@ void BrowserWindowGtk::OnStateChanged(GdkWindowState state,
tabstrip_->Hide();
if (IsBookmarkBarSupported())
bookmark_bar_->EnterFullscreen();
- bool is_kiosk =
+ bool is_kiosk =
CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode);
if (!is_kiosk) {
fullscreen_exit_bubble_.reset(new FullscreenExitBubbleGtk(
diff --git a/chrome/browser/gtk/browser_window_gtk.h b/chrome/browser/gtk/browser_window_gtk.h
index f531a65..7d55e6c 100644
--- a/chrome/browser/gtk/browser_window_gtk.h
+++ b/chrome/browser/gtk/browser_window_gtk.h
@@ -122,6 +122,7 @@ class BrowserWindowGtk : public BrowserWindow,
virtual void ShowPageMenu();
virtual void ShowAppMenu();
virtual int GetCommandId(const NativeWebKeyboardEvent& event);
+ virtual void ShowCreateShortcutsDialog(TabContents* tab_contents);
// Overridden from NotificationObserver:
virtual void Observe(NotificationType type,