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

Side by Side Diff: android_webview/glue/java/src/com/android/webview/chromium/ResourcesContextWrapperFactory.java

Issue 1054203002: Enable NeedsBraces check and fix some checkstyle issues. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added if checks Created 5 years, 8 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 | android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java » ('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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 package com.android.webview.chromium; 5 package com.android.webview.chromium;
6 6
7 import android.content.ComponentCallbacks; 7 import android.content.ComponentCallbacks;
8 import android.content.Context; 8 import android.content.Context;
9 import android.content.ContextWrapper; 9 import android.content.ContextWrapper;
10 import android.view.LayoutInflater; 10 import android.view.LayoutInflater;
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 if (Context.LAYOUT_INFLATER_SERVICE.equals(name)) { 67 if (Context.LAYOUT_INFLATER_SERVICE.equals(name)) {
68 LayoutInflater i = (LayoutInflater) getBaseContext().getSyst emService(name); 68 LayoutInflater i = (LayoutInflater) getBaseContext().getSyst emService(name);
69 return i.cloneInContext(this); 69 return i.cloneInContext(this);
70 } else { 70 } else {
71 return getBaseContext().getSystemService(name); 71 return getBaseContext().getSystemService(name);
72 } 72 }
73 } 73 }
74 74
75 @Override 75 @Override
76 public Context getApplicationContext() { 76 public Context getApplicationContext() {
77 if (mApplicationContext == null) 77 if (mApplicationContext == null) {
78 mApplicationContext = get(ctx.getApplicationContext()); 78 mApplicationContext = get(ctx.getApplicationContext());
79 }
79 return mApplicationContext; 80 return mApplicationContext;
80 } 81 }
81 82
82 @Override 83 @Override
83 public void registerComponentCallbacks(ComponentCallbacks callback) { 84 public void registerComponentCallbacks(ComponentCallbacks callback) {
84 // We have to override registerComponentCallbacks and unregister ComponentCallbacks 85 // We have to override registerComponentCallbacks and unregister ComponentCallbacks
85 // since they call getApplicationContext().[un]registerComponent Callbacks() 86 // since they call getApplicationContext().[un]registerComponent Callbacks()
86 // which causes us to go into a loop. 87 // which causes us to go into a loop.
87 ctx.registerComponentCallbacks(callback); 88 ctx.registerComponentCallbacks(callback);
88 } 89 }
89 90
90 @Override 91 @Override
91 public void unregisterComponentCallbacks(ComponentCallbacks callback ) { 92 public void unregisterComponentCallbacks(ComponentCallbacks callback ) {
92 ctx.unregisterComponentCallbacks(callback); 93 ctx.unregisterComponentCallbacks(callback);
93 } 94 }
94 }; 95 };
95 } 96 }
96 } 97 }
OLDNEW
« no previous file with comments | « no previous file | android_webview/glue/java/src/com/android/webview/chromium/WebViewContentsClientAdapter.java » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698