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

Side by Side Diff: chrome/browser/ui/ash/launcher/chrome_launcher_controller.cc

Issue 1703403002: remove kDisableMinimizeOnSecondLauncherItemClick (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 10 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
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 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 1139 matching lines...) Expand 10 before | Expand all | Expand 10 after
1150 if (!manager->IsWindowOnDesktopOfUser(native_window, current_account_id)) { 1150 if (!manager->IsWindowOnDesktopOfUser(native_window, current_account_id)) {
1151 ash::MultiProfileUMA::RecordTeleportAction( 1151 ash::MultiProfileUMA::RecordTeleportAction(
1152 ash::MultiProfileUMA::TELEPORT_WINDOW_RETURN_BY_LAUNCHER); 1152 ash::MultiProfileUMA::TELEPORT_WINDOW_RETURN_BY_LAUNCHER);
1153 manager->ShowWindowForUser(native_window, current_account_id); 1153 manager->ShowWindowForUser(native_window, current_account_id);
1154 window->Activate(); 1154 window->Activate();
1155 return ash::ShelfItemDelegate::kExistingWindowActivated; 1155 return ash::ShelfItemDelegate::kExistingWindowActivated;
1156 } 1156 }
1157 } 1157 }
1158 1158
1159 if (window->IsActive() && allow_minimize) { 1159 if (window->IsActive() && allow_minimize) {
1160 if (base::CommandLine::ForCurrentProcess()->HasSwitch( 1160 window->Minimize();
1161 switches::kDisableMinimizeOnSecondLauncherItemClick)) { 1161 return ash::ShelfItemDelegate::kNoAction;
1162 AnimateWindow(window->GetNativeWindow(),
1163 wm::WINDOW_ANIMATION_TYPE_BOUNCE);
1164 } else {
1165 window->Minimize();
1166 return ash::ShelfItemDelegate::kExistingWindowMinimized;
1167 }
1168 } else {
1169 window->Show();
1170 window->Activate();
1171 return ash::ShelfItemDelegate::kExistingWindowActivated;
1172 } 1162 }
1173 return ash::ShelfItemDelegate::kNoAction; 1163
1164 window->Show();
1165 window->Activate();
1166 return ash::ShelfItemDelegate::kExistingWindowActivated;
1174 } 1167 }
1175 1168
1176 void ChromeLauncherController::OnShelfCreated(ash::Shelf* shelf) { 1169 void ChromeLauncherController::OnShelfCreated(ash::Shelf* shelf) {
1177 shelves_.insert(shelf); 1170 shelves_.insert(shelf);
1178 shelf->shelf_widget()->shelf_layout_manager()->AddObserver(this); 1171 shelf->shelf_widget()->shelf_layout_manager()->AddObserver(this);
1179 } 1172 }
1180 1173
1181 void ChromeLauncherController::OnShelfDestroyed(ash::Shelf* shelf) { 1174 void ChromeLauncherController::OnShelfDestroyed(ash::Shelf* shelf) {
1182 shelves_.erase(shelf); 1175 shelves_.erase(shelf);
1183 // RemoveObserver is not called here, since by the time this method is called 1176 // RemoveObserver is not called here, since by the time this method is called
(...skipping 1040 matching lines...) Expand 10 before | Expand all | Expand 10 after
2224 void ChromeLauncherController::ReleaseProfile() { 2217 void ChromeLauncherController::ReleaseProfile() {
2225 if (app_sync_ui_state_) 2218 if (app_sync_ui_state_)
2226 app_sync_ui_state_->RemoveObserver(this); 2219 app_sync_ui_state_->RemoveObserver(this);
2227 2220
2228 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); 2221 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this);
2229 2222
2230 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this); 2223 PrefServiceSyncableFromProfile(profile_)->RemoveObserver(this);
2231 2224
2232 pref_change_registrar_.RemoveAll(); 2225 pref_change_registrar_.RemoveAll();
2233 } 2226 }
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/browser/ui/ash/launcher/chrome_launcher_controller_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698