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

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

Issue 573073002: Use Web Manifest when creating a shortcut on Chrome Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: weakptr Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/task/cancelable_task_tracker.h" 12 #include "base/task/cancelable_task_tracker.h"
13 #include "chrome/common/web_application_info.h" 13 #include "chrome/common/web_application_info.h"
14 #include "components/favicon_base/favicon_types.h" 14 #include "components/favicon_base/favicon_types.h"
15 #include "content/public/browser/web_contents_observer.h" 15 #include "content/public/browser/web_contents_observer.h"
16 16
17 namespace content { 17 namespace content {
18 class WebContents; 18 class WebContents;
19 struct Manifest;
19 } // namespace content 20 } // namespace content
20 21
21 namespace IPC { 22 namespace IPC {
22 class Message; 23 class Message;
23 } 24 }
24 25
25 class GURL; 26 class GURL;
26 27
27 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's 28 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's
28 // ShortcutHelper in Java. The object is owned by the Java object. It is created 29 // ShortcutHelper in Java. The object is owned by the Java object. It is created
(...skipping 11 matching lines...) Expand all
40 // OnDidRetrieveWebappInformation is expected to be called when finished. 41 // OnDidRetrieveWebappInformation is expected to be called when finished.
41 void Initialize(); 42 void Initialize();
42 43
43 // Called by the Java counter part to let the object knows that it can destroy 44 // Called by the Java counter part to let the object knows that it can destroy
44 // itself. 45 // itself.
45 void TearDown(JNIEnv* env, jobject obj); 46 void TearDown(JNIEnv* env, jobject obj);
46 47
47 // IPC message received when the initialization is finished. 48 // IPC message received when the initialization is finished.
48 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info); 49 void OnDidGetWebApplicationInfo(const WebApplicationInfo& web_app_info);
49 50
51 // Callback run when the Manifest is ready to be used.
52 void OnDidGetManifest(const content::Manifest& manifest);
53
50 // Adds a shortcut to the current URL to the Android home screen. 54 // Adds a shortcut to the current URL to the Android home screen.
51 void AddShortcut(JNIEnv* env, 55 void AddShortcut(JNIEnv* env,
52 jobject obj, 56 jobject obj,
53 jstring title, 57 jstring title,
54 jint launcher_large_icon_size); 58 jint launcher_large_icon_size);
55 59
56 void FinishAddingShortcut( 60 void FinishAddingShortcut(
57 const favicon_base::FaviconRawBitmapResult& bitmap_result); 61 const favicon_base::FaviconRawBitmapResult& bitmap_result);
58 62
59 // WebContentsObserver 63 // WebContentsObserver
(...skipping 17 matching lines...) Expand all
77 81
78 JavaObjectWeakGlobalRef java_ref_; 82 JavaObjectWeakGlobalRef java_ref_;
79 83
80 GURL url_; 84 GURL url_;
81 base::string16 title_; 85 base::string16 title_;
82 int launcher_large_icon_size_; 86 int launcher_large_icon_size_;
83 WebApplicationInfo::MobileCapable web_app_capable_; 87 WebApplicationInfo::MobileCapable web_app_capable_;
84 favicon_base::FaviconRawBitmapResult icon_; 88 favicon_base::FaviconRawBitmapResult icon_;
85 base::CancelableTaskTracker cancelable_task_tracker_; 89 base::CancelableTaskTracker cancelable_task_tracker_;
86 90
91 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_;
92
87 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); 93 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
88 }; 94 };
89 95
90 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ 96 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698