OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
Mr4D (OOO till 08-26)
2013/08/16 22:43:22
And rename to "chrome_launcher_controller.cc".
simonhong_
2013/08/19 05:26:11
Done.
| |
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_per_app.h" | 5 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_per_app.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/launcher/launcher.h" | 10 #include "ash/launcher/launcher.h" |
11 #include "ash/launcher/launcher_model.h" | 11 #include "ash/launcher/launcher_model.h" |
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
290 !prefs->FindPreference(prefs::kShelfAutoHideBehaviorLocal)-> | 290 !prefs->FindPreference(prefs::kShelfAutoHideBehaviorLocal)-> |
291 HasUserSetting()) { | 291 HasUserSetting()) { |
292 // This causes OnIsSyncingChanged to be called when the value of | 292 // This causes OnIsSyncingChanged to be called when the value of |
293 // PrefService::IsSyncing() changes. | 293 // PrefService::IsSyncing() changes. |
294 prefs->AddObserver(this); | 294 prefs->AddObserver(this); |
295 } | 295 } |
296 ash::Shell::GetInstance()->AddShellObserver(this); | 296 ash::Shell::GetInstance()->AddShellObserver(this); |
297 } | 297 } |
298 } | 298 } |
299 | 299 |
300 ChromeLauncherControllerPerApp* | |
301 ChromeLauncherControllerPerApp::GetPerAppInterface() { | |
302 return this; | |
303 } | |
304 | |
305 ash::LauncherID ChromeLauncherControllerPerApp::CreateTabbedLauncherItem( | |
306 LauncherItemController* controller, | |
307 IncognitoState is_incognito, | |
308 ash::LauncherItemStatus status) { | |
309 // The PerAppLauncher doesn't need an empty slot for TabbedLauncherItem and | |
310 // its LauncherItemController. | |
311 // TODO(skuhne): Remove function when PerBrowser launcher gets removed. | |
312 return 0; | |
313 } | |
314 | |
315 ash::LauncherID ChromeLauncherControllerPerApp::CreateAppLauncherItem( | 300 ash::LauncherID ChromeLauncherControllerPerApp::CreateAppLauncherItem( |
316 LauncherItemController* controller, | 301 LauncherItemController* controller, |
317 const std::string& app_id, | 302 const std::string& app_id, |
318 ash::LauncherItemStatus status) { | 303 ash::LauncherItemStatus status) { |
319 CHECK(controller); | 304 CHECK(controller); |
320 int index = 0; | 305 int index = 0; |
321 // Panels are inserted on the left so as not to push all existing panels over. | 306 // Panels are inserted on the left so as not to push all existing panels over. |
322 if (controller->GetLauncherItemType() != ash::TYPE_APP_PANEL) { | 307 if (controller->GetLauncherItemType() != ash::TYPE_APP_PANEL) { |
323 index = model_->item_count(); | 308 index = model_->item_count(); |
324 // For the alternate shelf layout increment the index (after the app icon) | 309 // For the alternate shelf layout increment the index (after the app icon) |
(...skipping 1344 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1669 browser_to_close.pop_back(); | 1654 browser_to_close.pop_back(); |
1670 } | 1655 } |
1671 } | 1656 } |
1672 | 1657 |
1673 void | 1658 void |
1674 ChromeLauncherControllerPerApp::MoveItemWithoutPinnedStateChangeNotification( | 1659 ChromeLauncherControllerPerApp::MoveItemWithoutPinnedStateChangeNotification( |
1675 int source_index, int target_index) { | 1660 int source_index, int target_index) { |
1676 base::AutoReset<bool> auto_reset(&ignore_persist_pinned_state_change_, true); | 1661 base::AutoReset<bool> auto_reset(&ignore_persist_pinned_state_change_, true); |
1677 model_->Move(source_index, target_index); | 1662 model_->Move(source_index, target_index); |
1678 } | 1663 } |
OLD | NEW |