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

Side by Side Diff: chrome/android/java_staging/src/org/chromium/chrome/browser/WindowDelegate.java

Issue 1141283003: Upstream oodles of Chrome for Android code into Chromium. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: final patch? Created 5 years, 7 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
(Empty)
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
3 // found in the LICENSE file.
4
5 package org.chromium.chrome.browser;
6
7 import android.graphics.Rect;
8 import android.view.Window;
9
10 /**
11 * This is a delegate that handles communication about a window's current state and properties.
12 */
13 public class WindowDelegate {
14
15 private final Window mWindow;
16
17 /**
18 * @param window The Window object that this delegate will communicate with.
19 */
20 public WindowDelegate(Window window) {
21 mWindow = window;
22 }
23
24 /**
25 * @return The soft input mode that is currently used by the window.
26 */
27 public int getWindowSoftInputMode() {
28 return mWindow.getAttributes().softInputMode;
29 }
30
31 /**
32 * Set the soft input mode that is used by the window.
33 * @param softInputMode The soft input mode to be used.
34 */
35 public void setWindowSoftInputMode(int softInputMode) {
36 mWindow.setSoftInputMode(softInputMode);
37 }
38
39 /**
40 * Used for accessing the current display frame for the whole window view hi erarchy.
41 * @param displayFrame The rect that will be set to the current display fram e for the window.
42 */
43 public void getWindowVisibleDisplayFrame(Rect displayFrame) {
44 mWindow.getDecorView().getWindowVisibleDisplayFrame(displayFrame);
45 }
46
47 /**
48 * @return The height of the decor view.
49 */
50 public int getDecorViewHeight() {
51 return mWindow.getDecorView().getHeight();
52 }
53 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698