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 "chrome/browser/android/shortcut_info.h" | 10 #include "chrome/browser/android/shortcut_info.h" |
11 #include "third_party/skia/include/core/SkBitmap.h" | 11 #include "third_party/skia/include/core/SkBitmap.h" |
12 | 12 |
13 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's | 13 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's |
14 // ShortcutHelper in Java. The object is owned by the Java object. It is created | 14 // ShortcutHelper in Java. |
15 // from there via a JNI (Initialize) call and MUST BE DESTROYED via Destroy(). | |
16 class ShortcutHelper { | 15 class ShortcutHelper { |
mlamouri (slow - plz ping)
2015/08/24 16:43:54
Maybe make it final?
Lalit Maganti
2015/08/25 11:38:44
Done.
| |
17 public: | 16 public: |
18 // Registers JNI hooks. | 17 // Registers JNI hooks. |
19 static bool RegisterShortcutHelper(JNIEnv* env); | 18 static bool RegisterShortcutHelper(JNIEnv* env); |
20 | 19 |
21 // Adds a shortcut to the launcher using a SkBitmap. | 20 // Adds a shortcut to the launcher using a SkBitmap. |
22 // Must be called on the IO thread. | 21 // Must be called on the IO thread. |
23 static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info, | 22 static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info, |
23 const std::string& id, | |
mlamouri (slow - plz ping)
2015/08/24 16:43:54
nit: id -> webapp_id
Lalit Maganti
2015/08/25 11:38:44
Done.
| |
24 const SkBitmap& icon_bitmap); | 24 const SkBitmap& icon_bitmap); |
25 | |
26 // Add splashscreen icon to the data of the webapp. | |
27 static void AddSplashscreenIconToWebappData(const std::string& id, | |
mlamouri (slow - plz ping)
2015/08/24 16:43:54
ditto
Lalit Maganti
2015/08/25 11:38:44
Done.
| |
28 const SkBitmap& splash_icon); | |
29 | |
25 private: | 30 private: |
26 ShortcutHelper(); | 31 ShortcutHelper() = delete; |
32 ~ShortcutHelper() = delete; | |
27 | 33 |
28 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 34 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
29 }; | 35 }; |
30 | 36 |
31 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 37 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
OLD | NEW |