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

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

Issue 12314090: Add utf_string_conversions to base namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 10 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 | Annotate | Revision Log
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 265 matching lines...) Expand 10 before | Expand all | Expand 10 after
276 base::FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension( 276 base::FilePath icon_file = web_app_path.Append(file_name_).ReplaceExtension(
277 FILE_PATH_LITERAL(".ico")); 277 FILE_PATH_LITERAL(".ico"));
278 web_app::internals::CheckAndSaveIcon(icon_file, 278 web_app::internals::CheckAndSaveIcon(icon_file,
279 *shortcut_info_.favicon.ToSkBitmap()); 279 *shortcut_info_.favicon.ToSkBitmap());
280 280
281 // Update existing shortcuts' description, icon and app id. 281 // Update existing shortcuts' description, icon and app id.
282 CheckExistingShortcuts(); 282 CheckExistingShortcuts();
283 if (!shortcut_files_.empty()) { 283 if (!shortcut_files_.empty()) {
284 // Generates app id from web app url and profile path. 284 // Generates app id from web app url and profile path.
285 string16 app_id = ShellIntegration::GetAppModelIdForProfile( 285 string16 app_id = ShellIntegration::GetAppModelIdForProfile(
286 UTF8ToWide(web_app::GenerateApplicationNameFromURL(shortcut_info_.url)), 286 base::UTF8ToWide(web_app::GenerateApplicationNameFromURL(
287 shortcut_info_.url)),
287 profile_path_); 288 profile_path_);
288 289
289 // Sanitize description 290 // Sanitize description
290 if (shortcut_info_.description.length() >= MAX_PATH) 291 if (shortcut_info_.description.length() >= MAX_PATH)
291 shortcut_info_.description.resize(MAX_PATH - 1); 292 shortcut_info_.description.resize(MAX_PATH - 1);
292 293
293 for (size_t i = 0; i < shortcut_files_.size(); ++i) { 294 for (size_t i = 0; i < shortcut_files_.size(); ++i) {
294 base::win::ShortcutProperties shortcut_properties; 295 base::win::ShortcutProperties shortcut_properties;
295 shortcut_properties.set_target(shortcut_files_[i]); 296 shortcut_properties.set_target(shortcut_files_[i]);
296 shortcut_properties.set_description(shortcut_info_.description); 297 shortcut_properties.set_description(shortcut_info_.description);
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after
445 } 446 }
446 447
447 // |info_list| may still be empty at this point, in which case LoadImage 448 // |info_list| may still be empty at this point, in which case LoadImage
448 // will call the OnImageLoaded callback with an empty image and exit 449 // will call the OnImageLoaded callback with an empty image and exit
449 // immediately. 450 // immediately.
450 extensions::ImageLoader::Get(profile)->LoadImagesAsync(&extension, info_list, 451 extensions::ImageLoader::Get(profile)->LoadImagesAsync(&extension, info_list,
451 base::Bind(&OnImageLoaded, shortcut_info, callback)); 452 base::Bind(&OnImageLoaded, shortcut_info, callback));
452 } 453 }
453 454
454 } // namespace web_app 455 } // namespace web_app
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/panels/panel_view.cc ('k') | chrome/browser/ui/webui/extensions/install_extension_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698