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

Side by Side Diff: chrome/browser/ui/web_applications/web_app_ui.cc

Issue 213833005: Prevent SHChangeNotify on app list drag on Windows. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebase Created 6 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_win.h » ('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/web_applications/web_app_ui.h" 5 #include "chrome/browser/ui/web_applications/web_app_ui.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after
284 profile_path_, shortcut_info_.extension_id, shortcut_info_.url); 284 profile_path_, shortcut_info_.extension_id, shortcut_info_.url);
285 285
286 // Ensure web_app_path exists. web_app_path could be missing for a legacy 286 // Ensure web_app_path exists. web_app_path could be missing for a legacy
287 // shortcut created by Gears. 287 // shortcut created by Gears.
288 if (!base::PathExists(web_app_path) && 288 if (!base::PathExists(web_app_path) &&
289 !base::CreateDirectory(web_app_path)) { 289 !base::CreateDirectory(web_app_path)) {
290 NOTREACHED(); 290 NOTREACHED();
291 return; 291 return;
292 } 292 }
293 293
294 base::FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension( 294 base::FilePath icon_file =
295 FILE_PATH_LITERAL(".ico")); 295 web_app::internals::GetIconFilePath(web_app_path, shortcut_info_.title);
296 web_app::internals::CheckAndSaveIcon(icon_file, shortcut_info_.favicon); 296 web_app::internals::CheckAndSaveIcon(icon_file, shortcut_info_.favicon);
297 297
298 // Update existing shortcuts' description, icon and app id. 298 // Update existing shortcuts' description, icon and app id.
299 CheckExistingShortcuts(); 299 CheckExistingShortcuts();
300 if (!shortcut_files_.empty()) { 300 if (!shortcut_files_.empty()) {
301 // Generates app id from web app url and profile path. 301 // Generates app id from web app url and profile path.
302 base::string16 app_id = ShellIntegration::GetAppModelIdForProfile( 302 base::string16 app_id = ShellIntegration::GetAppModelIdForProfile(
303 base::UTF8ToWide( 303 base::UTF8ToWide(
304 web_app::GenerateApplicationNameFromURL(shortcut_info_.url)), 304 web_app::GenerateApplicationNameFromURL(shortcut_info_.url)),
305 profile_path_); 305 profile_path_);
(...skipping 164 matching lines...) Expand 10 before | Expand all | Expand 10 after
470 // |info_list| may still be empty at this point, in which case 470 // |info_list| may still be empty at this point, in which case
471 // LoadImageFamilyAsync will call the OnImageLoaded callback with an empty 471 // LoadImageFamilyAsync will call the OnImageLoaded callback with an empty
472 // image and exit immediately. 472 // image and exit immediately.
473 extensions::ImageLoader::Get(profile)->LoadImageFamilyAsync( 473 extensions::ImageLoader::Get(profile)->LoadImageFamilyAsync(
474 extension, 474 extension,
475 info_list, 475 info_list,
476 base::Bind(&OnImageLoaded, shortcut_info, callback)); 476 base::Bind(&OnImageLoaded, shortcut_info, callback));
477 } 477 }
478 478
479 } // namespace web_app 479 } // namespace web_app
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/web_applications/web_app_win.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698