| 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" |
| 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 #include "content/public/common/manifest.h" | 16 #include "content/public/common/manifest.h" |
| 17 #include "third_party/WebKit/public/platform/WebScreenOrientationLockType.h" |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 class WebContents; | 20 class WebContents; |
| 20 } // namespace content | 21 } // namespace content |
| 21 | 22 |
| 22 namespace IPC { | 23 namespace IPC { |
| 23 class Message; | 24 class Message; |
| 24 } | 25 } |
| 25 | 26 |
| 26 class GURL; | 27 class GURL; |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 | 63 |
| 63 // WebContentsObserver | 64 // WebContentsObserver |
| 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 65 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; |
| 65 virtual void WebContentsDestroyed() OVERRIDE; | 66 virtual void WebContentsDestroyed() OVERRIDE; |
| 66 | 67 |
| 67 // Adds a shortcut to the launcher. Must be called from a WorkerPool task. | 68 // Adds a shortcut to the launcher. Must be called from a WorkerPool task. |
| 68 static void AddShortcutInBackground( | 69 static void AddShortcutInBackground( |
| 69 const GURL& url, | 70 const GURL& url, |
| 70 const base::string16& title, | 71 const base::string16& title, |
| 71 content::Manifest::DisplayMode display, | 72 content::Manifest::DisplayMode display, |
| 72 const favicon_base::FaviconRawBitmapResult& bitmap_result); | 73 const favicon_base::FaviconRawBitmapResult& bitmap_result, |
| 74 blink::WebScreenOrientationLockType orientation); |
| 73 | 75 |
| 74 // Registers JNI hooks. | 76 // Registers JNI hooks. |
| 75 static bool RegisterShortcutHelper(JNIEnv* env); | 77 static bool RegisterShortcutHelper(JNIEnv* env); |
| 76 | 78 |
| 77 private: | 79 private: |
| 78 virtual ~ShortcutHelper(); | 80 virtual ~ShortcutHelper(); |
| 79 | 81 |
| 80 void Destroy(); | 82 void Destroy(); |
| 81 | 83 |
| 82 JavaObjectWeakGlobalRef java_ref_; | 84 JavaObjectWeakGlobalRef java_ref_; |
| 83 | 85 |
| 84 GURL url_; | 86 GURL url_; |
| 85 base::string16 title_; | 87 base::string16 title_; |
| 86 int launcher_large_icon_size_; | 88 int launcher_large_icon_size_; |
| 87 content::Manifest::DisplayMode display_; | 89 content::Manifest::DisplayMode display_; |
| 88 favicon_base::FaviconRawBitmapResult icon_; | 90 favicon_base::FaviconRawBitmapResult icon_; |
| 89 base::CancelableTaskTracker cancelable_task_tracker_; | 91 base::CancelableTaskTracker cancelable_task_tracker_; |
| 92 blink::WebScreenOrientationLockType orientation_; |
| 90 | 93 |
| 91 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; | 94 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; |
| 92 | 95 |
| 93 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 96 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
| 94 }; | 97 }; |
| 95 | 98 |
| 96 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 99 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| OLD | NEW |