Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/android/shortcut_helper.h

Issue 1224273003: webapps: propogate name and shortName from manifest to Java (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Add back explict destructor Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 28 matching lines...) Expand all
39 39
40 // Adds a shortcut to the current URL to the Android home screen. 40 // Adds a shortcut to the current URL to the Android home screen.
41 void AddShortcut(JNIEnv* env, jobject obj, jstring title); 41 void AddShortcut(JNIEnv* env, jobject obj, jstring title);
42 42
43 // Adds a shortcut to the launcher using a SkBitmap. 43 // Adds a shortcut to the launcher using a SkBitmap.
44 // Must be called on the IO thread. 44 // Must be called on the IO thread.
45 static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info, 45 static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info,
46 const SkBitmap& icon_bitmap); 46 const SkBitmap& icon_bitmap);
47 47
48 // ShortcutDataFetcher::Observer 48 // ShortcutDataFetcher::Observer
49 void OnTitleAvailable(const base::string16& title) override; 49 void OnUserTitleAvailable(const base::string16& user_title) override;
50 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override; 50 void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override;
51 SkBitmap FinalizeLauncherIcon(const SkBitmap& icon, const GURL& url) override; 51 SkBitmap FinalizeLauncherIcon(const SkBitmap& icon, const GURL& url) override;
52 52
53 private: 53 private:
54 virtual ~ShortcutHelper(); 54 virtual ~ShortcutHelper();
55 55
56 // Called only when the ShortcutDataFetcher has retrieved all of the 56 // Called only when the ShortcutDataFetcher has retrieved all of the
57 // data needed to add the shortcut. 57 // data needed to add the shortcut.
58 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon); 58 void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon);
59 59
60 void RecordAddToHomescreen(); 60 void RecordAddToHomescreen();
61 61
62 // Points to the Java object. 62 // Points to the Java object.
63 base::android::ScopedJavaGlobalRef<jobject> java_ref_; 63 base::android::ScopedJavaGlobalRef<jobject> java_ref_;
64 64
65 // Whether the user has requested that a shortcut be added while a fetch was 65 // Whether the user has requested that a shortcut be added while a fetch was
66 // in progress. 66 // in progress.
67 bool add_shortcut_pending_; 67 bool add_shortcut_pending_;
68 68
69 // Fetches data required to add a shortcut. 69 // Fetches data required to add a shortcut.
70 scoped_refptr<ShortcutDataFetcher> data_fetcher_; 70 scoped_refptr<ShortcutDataFetcher> data_fetcher_;
71 71
72 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); 72 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
73 }; 73 };
74 74
75 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ 75 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
OLDNEW
« no previous file with comments | « chrome/browser/android/shortcut_data_fetcher.cc ('k') | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698