OLD | NEW |
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/bottombar/overlay_panel_content.h" | 5 #include "chrome/browser/android/bottombar/overlay_panel_content.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 | 8 |
9 #include "base/android/jni_string.h" | 9 #include "base/android/jni_string.h" |
10 #include "base/callback.h" | 10 #include "base/callback.h" |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 OverlayPanelContent::~OverlayPanelContent() { | 47 OverlayPanelContent::~OverlayPanelContent() { |
48 JNIEnv* env = base::android::AttachCurrentThread(); | 48 JNIEnv* env = base::android::AttachCurrentThread(); |
49 Java_OverlayPanelContent_clearNativePanelContentPtr(env, java_manager_); | 49 Java_OverlayPanelContent_clearNativePanelContentPtr(env, java_manager_); |
50 } | 50 } |
51 | 51 |
52 void OverlayPanelContent::Destroy(JNIEnv* env, | 52 void OverlayPanelContent::Destroy(JNIEnv* env, |
53 const JavaParamRef<jobject>& obj) { | 53 const JavaParamRef<jobject>& obj) { |
54 delete this; | 54 delete this; |
55 } | 55 } |
56 | 56 |
| 57 void OverlayPanelContent::OnPhysicalBackingSizeChanged( |
| 58 JNIEnv* env, |
| 59 const JavaParamRef<jobject>& obj, |
| 60 const JavaParamRef<jobject>& jweb_contents, |
| 61 jint width, |
| 62 jint height) { |
| 63 content::WebContents* web_contents = |
| 64 content::WebContents::FromJavaWebContents(jweb_contents); |
| 65 gfx::Size size(width, height); |
| 66 web_contents->GetNativeView()->OnPhysicalBackingSizeChanged(size); |
| 67 } |
| 68 |
57 void OverlayPanelContent::RemoveLastHistoryEntry( | 69 void OverlayPanelContent::RemoveLastHistoryEntry( |
58 JNIEnv* env, | 70 JNIEnv* env, |
59 const JavaParamRef<jobject>& obj, | 71 const JavaParamRef<jobject>& obj, |
60 const JavaParamRef<jstring>& search_url, | 72 const JavaParamRef<jstring>& search_url, |
61 jlong search_start_time_ms) { | 73 jlong search_start_time_ms) { |
62 // The deletion window is from the time a search URL was put in history, up | 74 // The deletion window is from the time a search URL was put in history, up |
63 // to a short amount of time later. | 75 // to a short amount of time later. |
64 base::Time begin_time = base::Time::FromJsTime(search_start_time_ms); | 76 base::Time begin_time = base::Time::FromJsTime(search_start_time_ms); |
65 base::Time end_time = begin_time + | 77 base::Time end_time = begin_time + |
66 base::TimeDelta::FromSeconds(kHistoryDeletionWindowSeconds); | 78 base::TimeDelta::FromSeconds(kHistoryDeletionWindowSeconds); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
137 } | 149 } |
138 | 150 |
139 bool RegisterOverlayPanelContent(JNIEnv* env) { | 151 bool RegisterOverlayPanelContent(JNIEnv* env) { |
140 return RegisterNativesImpl(env); | 152 return RegisterNativesImpl(env); |
141 } | 153 } |
142 | 154 |
143 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { | 155 jlong Init(JNIEnv* env, const JavaParamRef<jobject>& obj) { |
144 OverlayPanelContent* content = new OverlayPanelContent(env, obj); | 156 OverlayPanelContent* content = new OverlayPanelContent(env, obj); |
145 return reinterpret_cast<intptr_t>(content); | 157 return reinterpret_cast<intptr_t>(content); |
146 } | 158 } |
OLD | NEW |