OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 6 #define CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
7 | 7 |
8 #include "base/android/jni_android.h" | 8 #include "base/android/jni_android.h" |
9 #include "base/android/jni_weak_ref.h" | 9 #include "base/android/jni_weak_ref.h" |
10 #include "base/basictypes.h" | 10 #include "base/basictypes.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 // Adds a shortcut to the launcher using a FaviconRawBitmapResult. | 84 // Adds a shortcut to the launcher using a FaviconRawBitmapResult. |
85 // Must be called from a WorkerPool task. | 85 // Must be called from a WorkerPool task. |
86 static void AddShortcutInBackgroundWithRawBitmap( | 86 static void AddShortcutInBackgroundWithRawBitmap( |
87 const ShortcutInfo& info, | 87 const ShortcutInfo& info, |
88 const favicon_base::FaviconRawBitmapResult& bitmap_result); | 88 const favicon_base::FaviconRawBitmapResult& bitmap_result); |
89 | 89 |
90 // Adds a shortcut to the launcher using a SkBitmap. | 90 // Adds a shortcut to the launcher using a SkBitmap. |
91 // Must be called from a WorkerPool task. | 91 // Must be called from a WorkerPool task. |
92 static void AddShortcutInBackgroundWithSkBitmap( | 92 static void AddShortcutInBackgroundWithSkBitmap( |
93 const ShortcutInfo& info, | 93 const ShortcutInfo& info, |
94 const SkBitmap& icon_bitmap); | 94 const SkBitmap& icon_bitmap, |
| 95 const bool return_to_homescreen); |
95 | 96 |
96 // Registers JNI hooks. | 97 // Registers JNI hooks. |
97 static bool RegisterShortcutHelper(JNIEnv* env); | 98 static bool RegisterShortcutHelper(JNIEnv* env); |
98 | 99 |
99 private: | 100 private: |
100 enum ManifestIconStatus { | 101 enum ManifestIconStatus { |
101 MANIFEST_ICON_STATUS_NONE, | 102 MANIFEST_ICON_STATUS_NONE, |
102 MANIFEST_ICON_STATUS_FETCHING, | 103 MANIFEST_ICON_STATUS_FETCHING, |
103 MANIFEST_ICON_STATUS_DONE | 104 MANIFEST_ICON_STATUS_DONE |
104 }; | 105 }; |
(...skipping 15 matching lines...) Expand all Loading... |
120 ManifestIconStatus manifest_icon_status_; | 121 ManifestIconStatus manifest_icon_status_; |
121 const int preferred_icon_size_in_px_; | 122 const int preferred_icon_size_in_px_; |
122 static const int kPreferredIconSizeInDp; | 123 static const int kPreferredIconSizeInDp; |
123 | 124 |
124 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; | 125 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; |
125 | 126 |
126 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 127 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
127 }; | 128 }; |
128 | 129 |
129 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 130 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
OLD | NEW |