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