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

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

Issue 2629573004: Add a chrome://webapks page. (Closed)
Patch Set: Makes the listWebApks method receive a callback on the Java side Created 3 years, 11 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
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 <string>
pkotwicz 2017/01/18 02:08:21 Nit: This include is unnecessary
gonzalon 2017/01/18 15:29:32 I think that's because it's being indirectly inclu
pkotwicz 2017/01/19 19:37:16 Yes, you are right. I does use std::string so it s
9 #include <vector>
10
8 #include "base/android/jni_android.h" 11 #include "base/android/jni_android.h"
9 #include "base/android/jni_weak_ref.h" 12 #include "base/android/jni_weak_ref.h"
10 #include "base/callback_forward.h" 13 #include "base/callback_forward.h"
11 #include "base/macros.h" 14 #include "base/macros.h"
12 #include "chrome/browser/android/shortcut_info.h" 15 #include "chrome/browser/android/shortcut_info.h"
16 #include "chrome/browser/android/webapk/webapk_info.h"
13 #include "chrome/browser/android/webapk/webapk_installer.h" 17 #include "chrome/browser/android/webapk/webapk_installer.h"
14 #include "third_party/skia/include/core/SkBitmap.h" 18 #include "third_party/skia/include/core/SkBitmap.h"
15 19
16 namespace content { 20 namespace content {
17 class BrowserContext; 21 class BrowserContext;
18 class WebContents; 22 class WebContents;
19 } // namespace content 23 } // namespace content
20 24
21 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's 25 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's
22 // ShortcutHelper in Java. 26 // ShortcutHelper in Java.
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 // Returns true if WebAPKs are enabled and there is an installed WebAPK which 111 // Returns true if WebAPKs are enabled and there is an installed WebAPK which
108 // can handle |start_url|, or there is one is being installed. 112 // can handle |start_url|, or there is one is being installed.
109 static bool IsWebApkInstalled(content::BrowserContext* browser_context, 113 static bool IsWebApkInstalled(content::BrowserContext* browser_context,
110 const GURL& start_url, 114 const GURL& start_url,
111 const GURL& manifest_url); 115 const GURL& manifest_url);
112 116
113 // Generates a scope URL based on the passed in |url|. It should be used 117 // Generates a scope URL based on the passed in |url|. It should be used
114 // when the Web Manifest does not specify a scope URL. 118 // when the Web Manifest does not specify a scope URL.
115 static GURL GetScopeFromURL(const GURL& url); 119 static GURL GetScopeFromURL(const GURL& url);
116 120
121 // Fetches information on all the WebAPKs installed on the device and returns
122 // the info to the |callback|.
123 static void ListWebApks(JNIEnv* env,
124 const base::Callback<void(std::vector<WebApkInfo*>)>& callback);
pkotwicz 2017/01/18 02:08:21 You should typedef to make your life easier typed
gonzalon 2017/01/18 15:29:32 Done.
125
117 private: 126 private:
118 ShortcutHelper() = delete; 127 ShortcutHelper() = delete;
119 ~ShortcutHelper() = delete; 128 ~ShortcutHelper() = delete;
120 129
121 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper); 130 DISALLOW_COPY_AND_ASSIGN(ShortcutHelper);
122 }; 131 };
123 132
124 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_ 133 #endif // CHROME_BROWSER_ANDROID_SHORTCUT_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698