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

Unified Diff: chrome/browser/android/shortcut_helper.h

Issue 1288903002: Refactor ShortcutHelper and merge in BookmarkUtils (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix test file name Created 5 years, 4 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 side-by-side diff with in-line comments
Download patch
« 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 »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/shortcut_helper.h
diff --git a/chrome/browser/android/shortcut_helper.h b/chrome/browser/android/shortcut_helper.h
index 7e302c3ed84b1338e05bd8d2cbe53f7db0b32d78..93e1c9d589a86307befc9bbc041867eb15ffadae 100644
--- a/chrome/browser/android/shortcut_helper.h
+++ b/chrome/browser/android/shortcut_helper.h
@@ -7,67 +7,23 @@
#include "base/android/jni_android.h"
#include "base/android/jni_weak_ref.h"
-#include "base/basictypes.h"
-#include "chrome/browser/android/shortcut_data_fetcher.h"
#include "chrome/browser/android/shortcut_info.h"
-#include "content/public/common/manifest.h"
-
-namespace content {
-class WebContents;
-} // namespace content
-
-namespace IPC {
-class Message;
-}
-
-class GURL;
+#include "third_party/skia/include/core/SkBitmap.h"
// ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's
// ShortcutHelper in Java. The object is owned by the Java object. It is created
// from there via a JNI (Initialize) call and MUST BE DESTROYED via Destroy().
-class ShortcutHelper : public ShortcutDataFetcher::Observer {
+class ShortcutHelper {
public:
- ShortcutHelper(JNIEnv* env,
- jobject obj,
- content::WebContents* web_contents);
-
- // Called by the Java counterpart to destroy its native half.
- void Destroy(JNIEnv* env, jobject obj);
-
// Registers JNI hooks.
static bool RegisterShortcutHelper(JNIEnv* env);
- // Adds a shortcut to the current URL to the Android home screen.
- void AddShortcut(JNIEnv* env, jobject obj, jstring title);
-
// Adds a shortcut to the launcher using a SkBitmap.
// Must be called on the IO thread.
static void AddShortcutInBackgroundWithSkBitmap(const ShortcutInfo& info,
const SkBitmap& icon_bitmap);
-
- // ShortcutDataFetcher::Observer
- void OnUserTitleAvailable(const base::string16& user_title) override;
- void OnDataAvailable(const ShortcutInfo& info, const SkBitmap& icon) override;
- SkBitmap FinalizeLauncherIcon(const SkBitmap& icon, const GURL& url) override;
-
private:
- virtual ~ShortcutHelper();
-
- // Called only when the ShortcutDataFetcher has retrieved all of the
- // data needed to add the shortcut.
- void AddShortcut(const ShortcutInfo& info, const SkBitmap& icon);
-
- void RecordAddToHomescreen();
-
- // Points to the Java object.
- base::android::ScopedJavaGlobalRef<jobject> java_ref_;
-
- // Whether the user has requested that a shortcut be added while a fetch was
- // in progress.
- bool add_shortcut_pending_;
-
- // Fetches data required to add a shortcut.
- scoped_refptr<ShortcutDataFetcher> data_fetcher_;
+ ShortcutHelper();
DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
};
« 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