summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 18:17:45 +0000
committerderat@chromium.org <derat@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-11-29 18:17:45 +0000
commit0b855e5294c87a53f732f6719ec1e56121c71d93 (patch)
tree08e2065ea59d6e7fcb23ec3f3c82a45a3c9440dd
parent109dcfb3cb1c4aebcd1c8c7f8b13c07fb2b45a75 (diff)
downloadchromium_src-0b855e5294c87a53f732f6719ec1e56121c71d93.zip
chromium_src-0b855e5294c87a53f732f6719ec1e56121c71d93.tar.gz
chromium_src-0b855e5294c87a53f732f6719ec1e56121c71d93.tar.bz2
ash: Remove unnecessary NULL checks for delegates.
This removes some checks for the ash::ShellDelegate and ash::SystemTrayDelegate, neither which can be NULL now. BUG=none Review URL: https://chromiumcodereview.appspot.com/11421135 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@170222 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--ash/accelerators/accelerator_controller.cc17
-rw-r--r--ash/wm/session_state_controller_impl.cc3
-rw-r--r--ash/wm/session_state_controller_impl2.cc3
3 files changed, 10 insertions, 13 deletions
diff --git a/ash/accelerators/accelerator_controller.cc b/ash/accelerators/accelerator_controller.cc
index 0840b56..9341a066 100644
--- a/ash/accelerators/accelerator_controller.cc
+++ b/ash/accelerators/accelerator_controller.cc
@@ -457,22 +457,22 @@ bool AcceleratorController::PerformAction(int action,
// and BrowserView::HandleKeyboardEvent, for a single accelerator press.
switch (action) {
case CYCLE_BACKWARD_MRU:
- if (key_code == ui::VKEY_TAB && shell->delegate())
+ if (key_code == ui::VKEY_TAB)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_TAB);
return HandleCycleWindowMRU(WindowCycleController::BACKWARD,
accelerator.IsAltDown());
case CYCLE_FORWARD_MRU:
- if (key_code == ui::VKEY_TAB && shell->delegate())
+ if (key_code == ui::VKEY_TAB)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_TAB);
return HandleCycleWindowMRU(WindowCycleController::FORWARD,
accelerator.IsAltDown());
case CYCLE_BACKWARD_LINEAR:
- if (key_code == ui::VKEY_F5 && shell->delegate())
+ if (key_code == ui::VKEY_F5)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_PREVWINDOW_F5);
HandleCycleWindowLinear(CYCLE_BACKWARD);
return true;
case CYCLE_FORWARD_LINEAR:
- if (key_code == ui::VKEY_F5 && shell->delegate())
+ if (key_code == ui::VKEY_F5)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEXTWINDOW_F5);
HandleCycleWindowLinear(CYCLE_FORWARD);
return true;
@@ -494,8 +494,7 @@ bool AcceleratorController::PerformAction(int action,
case TOGGLE_SPOKEN_FEEDBACK:
return HandleToggleSpokenFeedback();
case TOGGLE_WIFI:
- if (Shell::GetInstance()->tray_delegate())
- Shell::GetInstance()->tray_delegate()->ToggleWifi();
+ Shell::GetInstance()->tray_delegate()->ToggleWifi();
return true;
#endif
case OPEN_FEEDBACK_PAGE:
@@ -508,7 +507,7 @@ bool AcceleratorController::PerformAction(int action,
Shell::GetInstance()->delegate()->NewWindow(true /* is_incognito */);
return true;
case NEW_TAB:
- if (key_code == ui::VKEY_T && shell->delegate())
+ if (key_code == ui::VKEY_T)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_NEWTAB_T);
Shell::GetInstance()->delegate()->NewTab();
return true;
@@ -559,7 +558,7 @@ bool AcceleratorController::PerformAction(int action,
return false;
}
}
- if (key_code == ui::VKEY_LWIN && shell->delegate())
+ if (key_code == ui::VKEY_LWIN)
shell->delegate()->RecordUserMetricsAction(UMA_ACCEL_SEARCH_LWIN);
// When spoken feedback is enabled, we should neither toggle the list nor
// consume the key since Search+Shift is one of the shortcuts the a11y
@@ -731,7 +730,7 @@ bool AcceleratorController::PerformAction(int action,
break;
}
case TOGGLE_MAXIMIZED: {
- if (key_code == ui::VKEY_F4 && shell->delegate()) {
+ if (key_code == ui::VKEY_F4) {
shell->delegate()->RecordUserMetricsAction(
UMA_ACCEL_MAXIMIZE_RESTORE_F4);
}
diff --git a/ash/wm/session_state_controller_impl.cc b/ash/wm/session_state_controller_impl.cc
index 96b2788..69cd036 100644
--- a/ash/wm/session_state_controller_impl.cc
+++ b/ash/wm/session_state_controller_impl.cc
@@ -245,8 +245,7 @@ void SessionStateControllerImpl::RequestShutdownImpl() {
void SessionStateControllerImpl::OnRootWindowHostCloseRequested(
const aura::RootWindow*) {
- if(Shell::GetInstance() && Shell::GetInstance()->delegate())
- Shell::GetInstance()->delegate()->Exit();
+ Shell::GetInstance()->delegate()->Exit();
}
void SessionStateControllerImpl::StartLockTimer() {
diff --git a/ash/wm/session_state_controller_impl2.cc b/ash/wm/session_state_controller_impl2.cc
index 080f3d0..8b19827 100644
--- a/ash/wm/session_state_controller_impl2.cc
+++ b/ash/wm/session_state_controller_impl2.cc
@@ -225,8 +225,7 @@ void SessionStateControllerImpl2::RequestShutdownImpl() {
void SessionStateControllerImpl2::OnRootWindowHostCloseRequested(
const aura::RootWindow*) {
- if(Shell::GetInstance() && Shell::GetInstance()->delegate())
- Shell::GetInstance()->delegate()->Exit();
+ Shell::GetInstance()->delegate()->Exit();
}
void SessionStateControllerImpl2::StartLockTimer() {