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_weak_ref.h" | 8 #include "base/android/jni_weak_ref.h" |
9 #include "base/basictypes.h" | 9 #include "base/basictypes.h" |
10 #include "base/strings/string16.h" | 10 #include "base/strings/string16.h" |
11 #include "base/task/cancelable_task_tracker.h" | 11 #include "base/task/cancelable_task_tracker.h" |
12 #include "chrome/browser/android/tab_android.h" | 12 #include "chrome/browser/android/tab_android.h" |
13 #include "content/public/browser/web_contents_observer.h" | 13 #include "content/public/browser/web_contents_observer.h" |
14 | 14 |
15 namespace favicon_base { | 15 namespace favicon_base { |
16 struct FaviconBitmapResult; | 16 struct FaviconRawBitmapResult; |
17 } // namespace favicon_base | 17 } // namespace favicon_base |
18 | 18 |
19 namespace content { | 19 namespace content { |
20 class WebContents; | 20 class WebContents; |
21 } // namespace content | 21 } // namespace content |
22 | 22 |
23 namespace IPC { | 23 namespace IPC { |
24 class Message; | 24 class Message; |
25 } | 25 } |
26 | 26 |
(...skipping 19 matching lines...) Expand all Loading... |
46 const base::string16& title, | 46 const base::string16& title, |
47 int launcher_large_icon_size); | 47 int launcher_large_icon_size); |
48 virtual ~ShortcutBuilder() {} | 48 virtual ~ShortcutBuilder() {} |
49 | 49 |
50 void OnDidRetrieveWebappInformation(bool success, | 50 void OnDidRetrieveWebappInformation(bool success, |
51 bool is_mobile_webapp_capable, | 51 bool is_mobile_webapp_capable, |
52 bool is_apple_mobile_webapp_capable, | 52 bool is_apple_mobile_webapp_capable, |
53 const GURL& expected_url); | 53 const GURL& expected_url); |
54 | 54 |
55 void FinishAddingShortcut( | 55 void FinishAddingShortcut( |
56 const favicon_base::FaviconBitmapResult& bitmap_result); | 56 const favicon_base::FaviconRawBitmapResult& bitmap_result); |
57 | 57 |
58 // WebContentsObserver | 58 // WebContentsObserver |
59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 59 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
60 virtual void WebContentsDestroyed() OVERRIDE; | 60 virtual void WebContentsDestroyed() OVERRIDE; |
61 | 61 |
62 private: | 62 private: |
63 void Destroy(); | 63 void Destroy(); |
64 | 64 |
65 GURL url_; | 65 GURL url_; |
66 base::string16 title_; | 66 base::string16 title_; |
(...skipping 10 matching lines...) Expand all Loading... |
77 // background tasks to pull all the data required. | 77 // background tasks to pull all the data required. |
78 static void AddShortcut(content::WebContents* web_contents, | 78 static void AddShortcut(content::WebContents* web_contents, |
79 const base::string16& title, | 79 const base::string16& title, |
80 int launcher_larger_icon_size); | 80 int launcher_larger_icon_size); |
81 | 81 |
82 // Adds a shortcut to the launcher. Must be called from a WorkerPool task. | 82 // Adds a shortcut to the launcher. Must be called from a WorkerPool task. |
83 static void AddShortcutInBackground( | 83 static void AddShortcutInBackground( |
84 const GURL& url, | 84 const GURL& url, |
85 const base::string16& title, | 85 const base::string16& title, |
86 ShortcutBuilder::ShortcutType shortcut_type, | 86 ShortcutBuilder::ShortcutType shortcut_type, |
87 const favicon_base::FaviconBitmapResult& bitmap_result); | 87 const favicon_base::FaviconRawBitmapResult& bitmap_result); |
88 | 88 |
89 // Registers JNI hooks. | 89 // Registers JNI hooks. |
90 static bool RegisterShortcutHelper(JNIEnv* env); | 90 static bool RegisterShortcutHelper(JNIEnv* env); |
91 | 91 |
92 private: | 92 private: |
93 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 93 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
94 }; | 94 }; |
95 | 95 |
96 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 96 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
OLD | NEW |