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

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

Issue 576153002: Use 'display' when creating a shortcut on Android. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@manifest_parser_stuff
Patch Set: review comments Created 6 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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 17
17 namespace content { 18 namespace content {
18 class WebContents; 19 class WebContents;
19 struct Manifest;
20 } // namespace content 20 } // namespace content
21 21
22 namespace IPC { 22 namespace IPC {
23 class Message; 23 class Message;
24 } 24 }
25 25
26 class GURL; 26 class GURL;
27 27
28 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's 28 // ShortcutHelper is the C++ counterpart of org.chromium.chrome.browser's
29 // ShortcutHelper in Java. The object is owned by the Java object. It is created 29 // ShortcutHelper in Java. The object is owned by the Java object. It is created
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
61 const favicon_base::FaviconRawBitmapResult& bitmap_result); 61 const favicon_base::FaviconRawBitmapResult& bitmap_result);
62 62
63 // WebContentsObserver 63 // WebContentsObserver
64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE; 64 virtual bool OnMessageReceived(const IPC::Message& message) OVERRIDE;
65 virtual void WebContentsDestroyed() OVERRIDE; 65 virtual void WebContentsDestroyed() OVERRIDE;
66 66
67 // Adds a shortcut to the launcher. Must be called from a WorkerPool task. 67 // Adds a shortcut to the launcher. Must be called from a WorkerPool task.
68 static void AddShortcutInBackground( 68 static void AddShortcutInBackground(
69 const GURL& url, 69 const GURL& url,
70 const base::string16& title, 70 const base::string16& title,
71 WebApplicationInfo::MobileCapable mobile_capable, 71 content::Manifest::DisplayMode display,
72 const favicon_base::FaviconRawBitmapResult& bitmap_result); 72 const favicon_base::FaviconRawBitmapResult& bitmap_result);
73 73
74 // Registers JNI hooks. 74 // Registers JNI hooks.
75 static bool RegisterShortcutHelper(JNIEnv* env); 75 static bool RegisterShortcutHelper(JNIEnv* env);
76 76
77 private: 77 private:
78 virtual ~ShortcutHelper(); 78 virtual ~ShortcutHelper();
79 79
80 void Destroy(); 80 void Destroy();
81 81
82 JavaObjectWeakGlobalRef java_ref_; 82 JavaObjectWeakGlobalRef java_ref_;
83 83
84 GURL url_; 84 GURL url_;
85 base::string16 title_; 85 base::string16 title_;
86 int launcher_large_icon_size_; 86 int launcher_large_icon_size_;
87 WebApplicationInfo::MobileCapable web_app_capable_; 87 content::Manifest::DisplayMode display_;
88 favicon_base::FaviconRawBitmapResult icon_; 88 favicon_base::FaviconRawBitmapResult icon_;
89 base::CancelableTaskTracker cancelable_task_tracker_; 89 base::CancelableTaskTracker cancelable_task_tracker_;
90 90
91 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_; 91 base::WeakPtrFactory<ShortcutHelper> weak_ptr_factory_;
92 92
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_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/shortcut_helper.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698