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

Side by Side Diff: chrome/browser/android/webapps/add_to_homescreen_dialog_helper.cc

Issue 2230773002: Migrate add to homescreen data fetcher to use InstallableManager. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 #include "chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h" 5 #include "chrome/browser/android/webapps/add_to_homescreen_dialog_helper.h"
6 6
7 #include <jni.h>
8
9 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
10 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
11 #include "base/guid.h" 9 #include "base/guid.h"
12 #include "base/location.h" 10 #include "base/location.h"
13 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
14 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
15 #include "chrome/browser/android/shortcut_helper.h" 13 #include "chrome/browser/android/shortcut_helper.h"
16 #include "chrome/browser/banners/app_banner_settings_helper.h" 14 #include "chrome/browser/banners/app_banner_settings_helper.h"
17 #include "content/public/browser/browser_thread.h" 15 #include "content/public/browser/browser_thread.h"
18 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
19 #include "content/public/common/manifest.h"
20 #include "jni/AddToHomescreenDialogHelper_jni.h" 17 #include "jni/AddToHomescreenDialogHelper_jni.h"
21 #include "ui/gfx/android/java_bitmap.h" 18 #include "ui/gfx/android/java_bitmap.h"
22 #include "ui/gfx/color_analysis.h"
23 #include "url/gurl.h"
24 19
25 using base::android::JavaParamRef; 20 using base::android::JavaParamRef;
26 using base::android::ScopedJavaLocalRef; 21 using base::android::ScopedJavaLocalRef;
27 using content::Manifest;
28 22
29 jlong Initialize(JNIEnv* env, 23 jlong Initialize(JNIEnv* env,
30 const JavaParamRef<jobject>& obj, 24 const JavaParamRef<jobject>& obj,
31 const JavaParamRef<jobject>& java_web_contents) { 25 const JavaParamRef<jobject>& java_web_contents) {
32 content::WebContents* web_contents = 26 content::WebContents* web_contents =
33 content::WebContents::FromJavaWebContents(java_web_contents); 27 content::WebContents::FromJavaWebContents(java_web_contents);
34 AddToHomescreenDialogHelper* add_to_homescreen_helper = 28 AddToHomescreenDialogHelper* add_to_homescreen_helper =
35 new AddToHomescreenDialogHelper(env, obj, web_contents); 29 new AddToHomescreenDialogHelper(env, obj, web_contents);
36 return reinterpret_cast<intptr_t>(add_to_homescreen_helper); 30 return reinterpret_cast<intptr_t>(add_to_homescreen_helper);
37 } 31 }
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
144 content::WebContents* web_contents = data_fetcher_->web_contents(); 138 content::WebContents* web_contents = data_fetcher_->web_contents();
145 if (!web_contents) 139 if (!web_contents)
146 return; 140 return;
147 141
148 AppBannerSettingsHelper::RecordBannerEvent( 142 AppBannerSettingsHelper::RecordBannerEvent(
149 web_contents, web_contents->GetURL(), 143 web_contents, web_contents->GetURL(),
150 data_fetcher_->shortcut_info().url.spec(), 144 data_fetcher_->shortcut_info().url.spec(),
151 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN, 145 AppBannerSettingsHelper::APP_BANNER_EVENT_DID_ADD_TO_HOMESCREEN,
152 base::Time::Now()); 146 base::Time::Now());
153 } 147 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698