| 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" |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 72 // Use FaviconService to get the best available favicon and create the | 72 // Use FaviconService to get the best available favicon and create the |
| 73 // shortcut using it. This is used when no Manifest icons are available or | 73 // shortcut using it. This is used when no Manifest icons are available or |
| 74 // appropriate. | 74 // appropriate. |
| 75 void AddShortcutUsingFavicon(); | 75 void AddShortcutUsingFavicon(); |
| 76 | 76 |
| 77 // Callback run when a favicon is received from GetFavicon() call. | 77 // Callback run when a favicon is received from GetFavicon() call. |
| 78 void OnDidGetFavicon( | 78 void OnDidGetFavicon( |
| 79 const favicon_base::FaviconRawBitmapResult& bitmap_result); | 79 const favicon_base::FaviconRawBitmapResult& bitmap_result); |
| 80 | 80 |
| 81 // WebContentsObserver | 81 // WebContentsObserver |
| 82 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; | 82 virtual bool OnMessageReceived(const IPC::Message& message) override; |
| 83 virtual void WebContentsDestroyed() OVERRIDE; | 83 virtual void WebContentsDestroyed() override; |
| 84 | 84 |
| 85 // Adds a shortcut to the launcher using a FaviconRawBitmapResult. | 85 // Adds a shortcut to the launcher using a FaviconRawBitmapResult. |
| 86 // Must be called from a WorkerPool task. | 86 // Must be called from a WorkerPool task. |
| 87 static void AddShortcutInBackgroundWithRawBitmap( | 87 static void AddShortcutInBackgroundWithRawBitmap( |
| 88 const GURL& url, | 88 const GURL& url, |
| 89 const base::string16& title, | 89 const base::string16& title, |
| 90 content::Manifest::DisplayMode display, | 90 content::Manifest::DisplayMode display, |
| 91 const favicon_base::FaviconRawBitmapResult& bitmap_result, | 91 const favicon_base::FaviconRawBitmapResult& bitmap_result, |
| 92 blink::WebScreenOrientationLockType orientation); | 92 blink::WebScreenOrientationLockType orientation); |
| 93 | 93 |
| (...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 154 const int preferred_icon_size_in_px_; | 154 const int preferred_icon_size_in_px_; |
| 155 static const int kPreferredIconSizeInDp; | 155 static const int kPreferredIconSizeInDp; |
| 156 | 156 |
| 157 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; | 157 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; |
| 158 | 158 |
| 159 friend class ShortcutHelperTest; | 159 friend class ShortcutHelperTest; |
| 160 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); | 160 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); |
| 161 }; | 161 }; |
| 162 | 162 |
| 163 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ | 163 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ |
| OLD | NEW |