| OLD | NEW |
| 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/web_applications/web_app.h" | 5 #include "chrome/browser/web_applications/web_app.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/i18n/file_util_icu.h" | 10 #include "base/i18n/file_util_icu.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "extensions/common/constants.h" | 26 #include "extensions/common/constants.h" |
| 27 #include "extensions/common/extension.h" | 27 #include "extensions/common/extension.h" |
| 28 #include "extensions/common/manifest_handlers/icons_handler.h" | 28 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 29 #include "grit/theme_resources.h" | 29 #include "grit/theme_resources.h" |
| 30 #include "skia/ext/image_operations.h" | 30 #include "skia/ext/image_operations.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
| 33 #include "ui/gfx/image/image.h" | 33 #include "ui/gfx/image/image.h" |
| 34 #include "ui/gfx/image/image_family.h" | 34 #include "ui/gfx/image/image_family.h" |
| 35 #include "ui/gfx/image/image_skia.h" | 35 #include "ui/gfx/image/image_skia.h" |
| 36 #include "url/url_constants.h" |
| 36 | 37 |
| 37 #if defined(OS_WIN) | 38 #if defined(OS_WIN) |
| 38 #include "ui/gfx/icon_util.h" | 39 #include "ui/gfx/icon_util.h" |
| 39 #endif | 40 #endif |
| 40 | 41 |
| 41 using content::BrowserThread; | 42 using content::BrowserThread; |
| 42 | 43 |
| 43 namespace { | 44 namespace { |
| 44 | 45 |
| 45 typedef base::Callback<void(const web_app::ShortcutInfo&, | 46 typedef base::Callback<void(const web_app::ShortcutInfo&, |
| (...skipping 386 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 432 GetInfoForApp(app, | 433 GetInfoForApp(app, |
| 433 profile, | 434 profile, |
| 434 base::Bind(&UpdateAllShortcutsForShortcutInfo, old_app_title)); | 435 base::Bind(&UpdateAllShortcutsForShortcutInfo, old_app_title)); |
| 435 } | 436 } |
| 436 | 437 |
| 437 bool IsValidUrl(const GURL& url) { | 438 bool IsValidUrl(const GURL& url) { |
| 438 static const char* const kValidUrlSchemes[] = { | 439 static const char* const kValidUrlSchemes[] = { |
| 439 content::kFileScheme, | 440 content::kFileScheme, |
| 440 content::kFileSystemScheme, | 441 content::kFileSystemScheme, |
| 441 content::kFtpScheme, | 442 content::kFtpScheme, |
| 442 content::kHttpScheme, | 443 url::kHttpScheme, |
| 443 content::kHttpsScheme, | 444 url::kHttpsScheme, |
| 444 extensions::kExtensionScheme, | 445 extensions::kExtensionScheme, |
| 445 }; | 446 }; |
| 446 | 447 |
| 447 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { | 448 for (size_t i = 0; i < arraysize(kValidUrlSchemes); ++i) { |
| 448 if (url.SchemeIs(kValidUrlSchemes[i])) | 449 if (url.SchemeIs(kValidUrlSchemes[i])) |
| 449 return true; | 450 return true; |
| 450 } | 451 } |
| 451 | 452 |
| 452 return false; | 453 return false; |
| 453 } | 454 } |
| (...skipping 17 matching lines...) Expand all Loading... |
| 471 | 472 |
| 472 #if defined(OS_LINUX) | 473 #if defined(OS_LINUX) |
| 473 std::string GetWMClassFromAppName(std::string app_name) { | 474 std::string GetWMClassFromAppName(std::string app_name) { |
| 474 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); | 475 file_util::ReplaceIllegalCharactersInPath(&app_name, '_'); |
| 475 base::TrimString(app_name, "_", &app_name); | 476 base::TrimString(app_name, "_", &app_name); |
| 476 return app_name; | 477 return app_name; |
| 477 } | 478 } |
| 478 #endif | 479 #endif |
| 479 | 480 |
| 480 } // namespace web_app | 481 } // namespace web_app |
| OLD | NEW |