| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/views/create_application_shortcut_view.h" | 5 #include "chrome/browser/ui/views/create_application_shortcut_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 18 matching lines...) Expand all Loading... |
| 29 #include "net/base/load_flags.h" | 29 #include "net/base/load_flags.h" |
| 30 #include "net/url_request/url_request.h" | 30 #include "net/url_request/url_request.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 31 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "third_party/skia/include/core/SkPaint.h" | 32 #include "third_party/skia/include/core/SkPaint.h" |
| 33 #include "third_party/skia/include/core/SkRect.h" | 33 #include "third_party/skia/include/core/SkRect.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 35 #include "ui/base/resource/resource_bundle.h" |
| 36 #include "ui/gfx/canvas_skia.h" | 36 #include "ui/gfx/canvas_skia.h" |
| 37 #include "ui/gfx/codec/png_codec.h" | 37 #include "ui/gfx/codec/png_codec.h" |
| 38 #include "ui/views/controls/button/checkbox.h" | 38 #include "ui/views/controls/button/checkbox.h" |
| 39 #include "ui/views/controls/image_view.h" |
| 39 #include "ui/views/controls/label.h" | 40 #include "ui/views/controls/label.h" |
| 40 #include "ui/views/layout/grid_layout.h" | 41 #include "ui/views/layout/grid_layout.h" |
| 41 #include "ui/views/layout/layout_constants.h" | 42 #include "ui/views/layout/layout_constants.h" |
| 42 #include "ui/views/widget/widget.h" | 43 #include "ui/views/widget/widget.h" |
| 43 #include "views/controls/image_view.h" | |
| 44 | 44 |
| 45 namespace { | 45 namespace { |
| 46 | 46 |
| 47 const int kAppIconSize = 32; | 47 const int kAppIconSize = 32; |
| 48 | 48 |
| 49 // AppInfoView shows the application icon and title. | 49 // AppInfoView shows the application icon and title. |
| 50 class AppInfoView : public views::View { | 50 class AppInfoView : public views::View { |
| 51 public: | 51 public: |
| 52 AppInfoView(const string16& title, | 52 AppInfoView(const string16& title, |
| 53 const string16& description, | 53 const string16& description, |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 // Called by tracker_ when the app's icon is loaded. | 525 // Called by tracker_ when the app's icon is loaded. |
| 526 void CreateChromeApplicationShortcutView::OnImageLoaded( | 526 void CreateChromeApplicationShortcutView::OnImageLoaded( |
| 527 SkBitmap* image, const ExtensionResource& resource, int index) { | 527 SkBitmap* image, const ExtensionResource& resource, int index) { |
| 528 if (!image || image->isNull()) | 528 if (!image || image->isNull()) |
| 529 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); | 529 image = ExtensionIconSource::LoadImageByResourceId(IDR_APP_DEFAULT_ICON); |
| 530 | 530 |
| 531 shortcut_info_.favicon = *image; | 531 shortcut_info_.favicon = *image; |
| 532 CHECK(app_info_); | 532 CHECK(app_info_); |
| 533 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); | 533 static_cast<AppInfoView*>(app_info_)->UpdateIcon(shortcut_info_.favicon); |
| 534 } | 534 } |
| OLD | NEW |