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 #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 <vector> | 7 #include <vector> |
8 | 8 |
9 #include "ash/ash_switches.h" | 9 #include "ash/ash_switches.h" |
10 #include "ash/desktop_background/desktop_background_controller.h" | 10 #include "ash/desktop_background/desktop_background_controller.h" |
(...skipping 1105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1116 if (window->IsActive() && allow_minimize) { | 1116 if (window->IsActive() && allow_minimize) { |
1117 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 1117 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
1118 switches::kDisableMinimizeOnSecondLauncherItemClick)) { | 1118 switches::kDisableMinimizeOnSecondLauncherItemClick)) { |
1119 AnimateWindow(window->GetNativeWindow(), | 1119 AnimateWindow(window->GetNativeWindow(), |
1120 wm::WINDOW_ANIMATION_TYPE_BOUNCE); | 1120 wm::WINDOW_ANIMATION_TYPE_BOUNCE); |
1121 } else { | 1121 } else { |
1122 window->Minimize(); | 1122 window->Minimize(); |
1123 return ash::ShelfItemDelegate::kExistingWindowMinimized; | 1123 return ash::ShelfItemDelegate::kExistingWindowMinimized; |
1124 } | 1124 } |
1125 } else { | 1125 } else { |
1126 window->Show(); | 1126 window->Show(true /* user_gesture */); |
1127 window->Activate(true /* user_gesture */); | 1127 window->Activate(true /* user_gesture */); |
1128 return ash::ShelfItemDelegate::kExistingWindowActivated; | 1128 return ash::ShelfItemDelegate::kExistingWindowActivated; |
1129 } | 1129 } |
1130 return ash::ShelfItemDelegate::kNoAction; | 1130 return ash::ShelfItemDelegate::kNoAction; |
1131 } | 1131 } |
1132 | 1132 |
1133 void ChromeLauncherController::OnShelfCreated(ash::Shelf* shelf) { | 1133 void ChromeLauncherController::OnShelfCreated(ash::Shelf* shelf) { |
1134 shelves_.insert(shelf); | 1134 shelves_.insert(shelf); |
1135 shelf->shelf_widget()->shelf_layout_manager()->AddObserver(this); | 1135 shelf->shelf_widget()->shelf_layout_manager()->AddObserver(this); |
1136 } | 1136 } |
(...skipping 1002 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2139 void ChromeLauncherController::ReleaseProfile() { | 2139 void ChromeLauncherController::ReleaseProfile() { |
2140 if (app_sync_ui_state_) | 2140 if (app_sync_ui_state_) |
2141 app_sync_ui_state_->RemoveObserver(this); | 2141 app_sync_ui_state_->RemoveObserver(this); |
2142 | 2142 |
2143 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); | 2143 extensions::ExtensionRegistry::Get(profile_)->RemoveObserver(this); |
2144 | 2144 |
2145 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); | 2145 PrefServiceSyncable::FromProfile(profile_)->RemoveObserver(this); |
2146 | 2146 |
2147 pref_change_registrar_.RemoveAll(); | 2147 pref_change_registrar_.RemoveAll(); |
2148 } | 2148 } |
OLD | NEW |