| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/ash/launcher/chrome_launcher_delegate.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.h" |
| 6 | 6 |
| 7 #include "ash/launcher/launcher_model.h" | 7 #include "ash/launcher/launcher_model.h" |
| 8 #include "ash/launcher/launcher_types.h" | 8 #include "ash/launcher/launcher_types.h" |
| 9 #include "ash/wm/window_util.h" | 9 #include "ash/wm/window_util.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 416 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 427 const Extension* extension = profile_->GetExtensionService()-> | 427 const Extension* extension = profile_->GetExtensionService()-> |
| 428 GetInstalledExtension(id_to_item_map_[item.id].app_id); | 428 GetInstalledExtension(id_to_item_map_[item.id].app_id); |
| 429 return extension ? UTF8ToUTF16(extension->name()) : string16(); | 429 return extension ? UTF8ToUTF16(extension->name()) : string16(); |
| 430 } | 430 } |
| 431 | 431 |
| 432 ui::MenuModel* ChromeLauncherDelegate::CreateContextMenu( | 432 ui::MenuModel* ChromeLauncherDelegate::CreateContextMenu( |
| 433 const ash::LauncherItem& item) { | 433 const ash::LauncherItem& item) { |
| 434 return new LauncherContextMenu(this, item.id); | 434 return new LauncherContextMenu(this, item.id); |
| 435 } | 435 } |
| 436 | 436 |
| 437 ash::LauncherID ChromeLauncherDelegate::GetIDByWindow( |
| 438 aura::Window* window) { |
| 439 for (IDToItemMap::const_iterator i = id_to_item_map_.begin(); |
| 440 i != id_to_item_map_.end(); ++i) { |
| 441 if (i->second.updater && i->second.updater->window() == window) |
| 442 return i->first; |
| 443 } |
| 444 return 0; |
| 445 } |
| 446 |
| 437 void ChromeLauncherDelegate::LauncherItemAdded(int index) { | 447 void ChromeLauncherDelegate::LauncherItemAdded(int index) { |
| 438 } | 448 } |
| 439 | 449 |
| 440 void ChromeLauncherDelegate::LauncherItemRemoved(int index, | 450 void ChromeLauncherDelegate::LauncherItemRemoved(int index, |
| 441 ash::LauncherID id) { | 451 ash::LauncherID id) { |
| 442 } | 452 } |
| 443 | 453 |
| 444 void ChromeLauncherDelegate::LauncherItemMoved( | 454 void ChromeLauncherDelegate::LauncherItemMoved( |
| 445 int start_index, | 455 int start_index, |
| 446 int target_index) { | 456 int target_index) { |
| (...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 510 Profile* ChromeLauncherDelegate::GetProfileForNewWindows() { | 520 Profile* ChromeLauncherDelegate::GetProfileForNewWindows() { |
| 511 Profile* profile = ProfileManager::GetDefaultProfile(); | 521 Profile* profile = ProfileManager::GetDefaultProfile(); |
| 512 if (browser_defaults::kAlwaysOpenIncognitoWindow && | 522 if (browser_defaults::kAlwaysOpenIncognitoWindow && |
| 513 IncognitoModePrefs::ShouldLaunchIncognito( | 523 IncognitoModePrefs::ShouldLaunchIncognito( |
| 514 *CommandLine::ForCurrentProcess(), | 524 *CommandLine::ForCurrentProcess(), |
| 515 profile->GetPrefs())) { | 525 profile->GetPrefs())) { |
| 516 profile = profile->GetOffTheRecordProfile(); | 526 profile = profile->GetOffTheRecordProfile(); |
| 517 } | 527 } |
| 518 return profile; | 528 return profile; |
| 519 } | 529 } |
| OLD | NEW |