Index: chrome/browser/ui/views/apps/native_app_window_views.cc |
diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc |
index aacb7cd7b22960a5c31c99283ca088746f42a18a..12881277b15f98f8d01f05a800ca5d694be4ab1d 100644 |
--- a/chrome/browser/ui/views/apps/native_app_window_views.cc |
+++ b/chrome/browser/ui/views/apps/native_app_window_views.cc |
@@ -7,8 +7,6 @@ |
#include "apps/shell_window.h" |
#include "apps/ui/views/shell_window_frame_view.h" |
#include "base/command_line.h" |
-#include "base/file_util.h" |
-#include "base/path_service.h" |
#include "base/threading/sequenced_worker_pool.h" |
#include "chrome/app/chrome_command_ids.h" |
#include "chrome/browser/extensions/extension_host.h" |
@@ -34,14 +32,6 @@ |
#include "ui/views/widget/widget.h" |
#include "ui/views/window/non_client_view.h" |
-#if defined(OS_WIN) |
-#include "base/strings/utf_string_conversions.h" |
-#include "chrome/browser/ui/web_applications/web_app_ui.h" |
-#include "chrome/browser/web_applications/web_app_win.h" |
-#include "ui/base/win/shell.h" |
-#include "ui/views/win/hwnd_util.h" |
-#endif |
- |
#if defined(OS_LINUX) |
#include "chrome/browser/shell_integration_linux.h" |
#endif |
@@ -103,39 +93,6 @@ const std::map<ui::Accelerator, int>& GetAcceleratorTable() { |
return accelerators; |
} |
-#if defined(OS_WIN) |
-void CreateIconAndSetRelaunchDetails( |
- const base::FilePath web_app_path, |
- const base::FilePath icon_file, |
- const ShellIntegration::ShortcutInfo& shortcut_info, |
- const HWND hwnd) { |
- DCHECK(content::BrowserThread::GetBlockingPool()->RunsTasksOnCurrentThread()); |
- |
- // Set the relaunch data so "Pin this program to taskbar" has the app's |
- // information. |
- CommandLine command_line = ShellIntegration::CommandLineArgsForLauncher( |
- shortcut_info.url, |
- shortcut_info.extension_id, |
- shortcut_info.profile_path); |
- |
- base::FilePath chrome_exe; |
- if (!PathService::Get(base::FILE_EXE, &chrome_exe)) { |
- NOTREACHED(); |
- return; |
- } |
- command_line.SetProgram(chrome_exe); |
- ui::win::SetRelaunchDetailsForWindow(command_line.GetCommandLineString(), |
- shortcut_info.title, hwnd); |
- |
- if (!base::PathExists(web_app_path) && |
- !base::CreateDirectory(web_app_path)) |
- return; |
- |
- ui::win::SetAppIconForWindow(icon_file.value(), hwnd); |
- web_app::internals::CheckAndSaveIcon(icon_file, shortcut_info.favicon); |
-} |
-#endif |
- |
#if defined(USE_ASH) |
// This class handles a user's fullscreen request (Shift+F4/F4). |
class NativeAppWindowStateDelegate : public ash::wm::WindowStateDelegate, |
@@ -307,47 +264,8 @@ void NativeAppWindowViews::InitializeDefaultWindow( |
focus_manager->RegisterAccelerator( |
iter->first, ui::AcceleratorManager::kNormalPriority, this); |
} |
- |
-#if defined(OS_WIN) |
- base::string16 app_name_wide = base::UTF8ToWide(app_name); |
- HWND hwnd = GetNativeAppWindowHWND(); |
- ui::win::SetAppIdForWindow(ShellIntegration::GetAppModelIdForProfile( |
- app_name_wide, profile()->GetPath()), hwnd); |
- |
- web_app::UpdateShortcutInfoAndIconForApp( |
- *extension(), profile(), |
- base::Bind(&NativeAppWindowViews::OnShortcutInfoLoaded, |
- weak_ptr_factory_.GetWeakPtr())); |
-#endif |
-} |
- |
-#if defined(OS_WIN) |
-void NativeAppWindowViews::OnShortcutInfoLoaded( |
- const ShellIntegration::ShortcutInfo& shortcut_info) { |
- DCHECK(content::BrowserThread::CurrentlyOn(content::BrowserThread::UI)); |
- |
- HWND hwnd = GetNativeAppWindowHWND(); |
- |
- // Set window's icon to the one we're about to create/update in the web app |
- // path. The icon cache will refresh on icon creation. |
- base::FilePath web_app_path = web_app::GetWebAppDataDirectory( |
- shortcut_info.profile_path, shortcut_info.extension_id, |
- shortcut_info.url); |
- base::FilePath icon_file = web_app_path |
- .Append(web_app::internals::GetSanitizedFileName(shortcut_info.title)) |
- .ReplaceExtension(FILE_PATH_LITERAL(".ico")); |
- |
- content::BrowserThread::PostBlockingPoolTask( |
- FROM_HERE, |
- base::Bind(&CreateIconAndSetRelaunchDetails, |
- web_app_path, icon_file, shortcut_info, hwnd)); |
} |
-HWND NativeAppWindowViews::GetNativeAppWindowHWND() const { |
- return views::HWNDForWidget(window_->GetTopLevelWidget()); |
-} |
-#endif |
- |
void NativeAppWindowViews::InitializePanelWindow( |
const ShellWindow::CreateParams& create_params) { |
views::Widget::InitParams params(views::Widget::InitParams::TYPE_PANEL); |
@@ -980,3 +898,4 @@ gfx::Insets NativeAppWindowViews::GetFrameInsets() const { |
void NativeAppWindowViews::HideWithApp() {} |
void NativeAppWindowViews::ShowWithApp() {} |
void NativeAppWindowViews::UpdateWindowMinMaxSize() {} |
+void NativeAppWindowViews::UpdateAppMenu() {} |