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

Unified Diff: content/browser/android/date_time_chooser_android.cc

Issue 639703004: Optimizing DateTimeAndroid and ColorChooserAndroid initializations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed the review comments. Created 6 years, 2 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
Index: content/browser/android/date_time_chooser_android.cc
diff --git a/content/browser/android/date_time_chooser_android.cc b/content/browser/android/date_time_chooser_android.cc
index 58133ba22d96d03248ca1deaf7702b813d1ccfd2..31ff4656bef04fcc404d0b322824d1b835475b49 100644
--- a/content/browser/android/date_time_chooser_android.cc
+++ b/content/browser/android/date_time_chooser_android.cc
@@ -9,11 +9,11 @@
#include "base/i18n/char_iterator.h"
#include "content/common/date_time_suggestion.h"
#include "content/common/view_messages.h"
-#include "content/public/browser/android/content_view_core.h"
#include "content/public/browser/render_view_host.h"
#include "jni/DateTimeChooserAndroid_jni.h"
#include "third_party/icu/source/common/unicode/uchar.h"
#include "third_party/icu/source/common/unicode/unistr.h"
+#include "ui/base/android/window_android.h"
using base::android::AttachCurrentThread;
using base::android::ConvertJavaStringToUTF16;
@@ -73,7 +73,7 @@ void DateTimeChooserAndroid::CancelDialog(JNIEnv* env, jobject) {
}
void DateTimeChooserAndroid::ShowDialog(
- ContentViewCore* content,
+ gfx::NativeWindow native_window,
RenderViewHost* host,
ui::TextInputType dialog_type,
double dialog_value,
@@ -104,7 +104,7 @@ void DateTimeChooserAndroid::ShowDialog(
j_date_time_chooser_.Reset(Java_DateTimeChooserAndroid_createDateTimeChooser(
env,
- content->GetJavaObject().obj(),
+ native_window->GetJavaObject().obj(),
reinterpret_cast<intptr_t>(this),
dialog_type,
dialog_value,
@@ -112,6 +112,8 @@ void DateTimeChooserAndroid::ShowDialog(
max,
step,
suggestions_array.obj()));
+ if (j_date_time_chooser_.is_null())
+ ReplaceDateTime(env, j_date_time_chooser_.obj(), dialog_value);
}
// ----------------------------------------------------------------------------
« no previous file with comments | « content/browser/android/date_time_chooser_android.h ('k') | content/browser/web_contents/web_contents_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698