OLD | NEW |
1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 org.chromium.chromoting; | 5 package org.chromium.chromoting; |
6 | 6 |
7 import android.annotation.SuppressLint; | 7 import android.annotation.SuppressLint; |
8 import android.os.Build; | 8 import android.os.Build; |
9 import android.os.Bundle; | 9 import android.os.Bundle; |
10 import android.os.Handler; | 10 import android.os.Handler; |
(...skipping 159 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
170 } | 170 } |
171 | 171 |
172 @Override | 172 @Override |
173 protected void onStop() { | 173 protected void onStop() { |
174 mClient.getCapabilityManager().removeListener(this); | 174 mClient.getCapabilityManager().removeListener(this); |
175 mActivityLifecycleListener.onActivityStopped(this); | 175 mActivityLifecycleListener.onActivityStopped(this); |
176 super.onStop(); | 176 super.onStop(); |
177 mClient.enableVideoChannel(false); | 177 mClient.enableVideoChannel(false); |
178 } | 178 } |
179 | 179 |
| 180 @Override |
| 181 protected void onDestroy() { |
| 182 mRemoteHostDesktop.destroy(); |
| 183 super.onDestroy(); |
| 184 } |
| 185 |
180 /** Called to initialize the action bar. */ | 186 /** Called to initialize the action bar. */ |
181 @Override | 187 @Override |
182 public boolean onCreateOptionsMenu(Menu menu) { | 188 public boolean onCreateOptionsMenu(Menu menu) { |
183 getMenuInflater().inflate(R.menu.desktop_actionbar, menu); | 189 getMenuInflater().inflate(R.menu.desktop_actionbar, menu); |
184 | 190 |
185 mActivityLifecycleListener.onActivityCreatedOptionsMenu(this, menu); | 191 mActivityLifecycleListener.onActivityCreatedOptionsMenu(this, menu); |
186 | 192 |
187 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { | 193 if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) { |
188 // We don't need to show a hide ActionBar button if immersive fullsc
reen is supported. | 194 // We don't need to show a hide ActionBar button if immersive fullsc
reen is supported. |
189 menu.findItem(R.id.actionbar_hide).setVisible(false); | 195 menu.findItem(R.id.actionbar_hide).setVisible(false); |
(...skipping 344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
534 @Override | 540 @Override |
535 public boolean dispatchKeyEvent(KeyEvent event) { | 541 public boolean dispatchKeyEvent(KeyEvent event) { |
536 if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { | 542 if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) { |
537 mClient.destroy(); | 543 mClient.destroy(); |
538 return super.dispatchKeyEvent(event); | 544 return super.dispatchKeyEvent(event); |
539 } | 545 } |
540 | 546 |
541 return mInjector.sendKeyEvent(event); | 547 return mInjector.sendKeyEvent(event); |
542 } | 548 } |
543 } | 549 } |
OLD | NEW |