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_controller.h" | 5 #include "chrome/browser/ui/views/ash/launcher/chrome_launcher_controller.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "ash/launcher/launcher_model.h" | 10 #include "ash/launcher/launcher_model.h" |
(...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
315 id_to_item_map_[id].controller->window()); | 315 id_to_item_map_[id].controller->window()); |
316 if (widget) | 316 if (widget) |
317 widget->Close(); | 317 widget->Close(); |
318 } | 318 } |
319 | 319 |
320 bool ChromeLauncherController::IsOpen(ash::LauncherID id) { | 320 bool ChromeLauncherController::IsOpen(ash::LauncherID id) { |
321 return id_to_item_map_.find(id) != id_to_item_map_.end() && | 321 return id_to_item_map_.find(id) != id_to_item_map_.end() && |
322 id_to_item_map_[id].controller != NULL; | 322 id_to_item_map_[id].controller != NULL; |
323 } | 323 } |
324 | 324 |
325 ExtensionPrefs::LaunchType ChromeLauncherController::GetLaunchType( | 325 extensions::ExtensionPrefs::LaunchType ChromeLauncherController::GetLaunchType( |
326 ash::LauncherID id) { | 326 ash::LauncherID id) { |
327 DCHECK(id_to_item_map_.find(id) != id_to_item_map_.end()); | 327 DCHECK(id_to_item_map_.find(id) != id_to_item_map_.end()); |
328 | 328 |
329 return profile_->GetExtensionService()->extension_prefs()->GetLaunchType( | 329 return profile_->GetExtensionService()->extension_prefs()->GetLaunchType( |
330 id_to_item_map_[id].app_id, ExtensionPrefs::LAUNCH_DEFAULT); | 330 id_to_item_map_[id].app_id, extensions::ExtensionPrefs::LAUNCH_DEFAULT); |
331 } | 331 } |
332 | 332 |
333 std::string ChromeLauncherController::GetAppID(TabContents* tab) { | 333 std::string ChromeLauncherController::GetAppID(TabContents* tab) { |
334 return app_icon_loader_->GetAppID(tab); | 334 return app_icon_loader_->GetAppID(tab); |
335 } | 335 } |
336 | 336 |
337 ash::LauncherID ChromeLauncherController::GetLauncherIDForAppID( | 337 ash::LauncherID ChromeLauncherController::GetLauncherIDForAppID( |
338 const std::string& app_id) { | 338 const std::string& app_id) { |
339 for (IDToItemMap::const_iterator i = id_to_item_map_.begin(); | 339 for (IDToItemMap::const_iterator i = id_to_item_map_.begin(); |
340 i != id_to_item_map_.end(); ++i) { | 340 i != id_to_item_map_.end(); ++i) { |
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
382 | 382 |
383 void ChromeLauncherController::PinAppWithID(const std::string& app_id) { | 383 void ChromeLauncherController::PinAppWithID(const std::string& app_id) { |
384 if (CanPin()) | 384 if (CanPin()) |
385 DoPinAppWithID(app_id); | 385 DoPinAppWithID(app_id); |
386 else | 386 else |
387 NOTREACHED(); | 387 NOTREACHED(); |
388 } | 388 } |
389 | 389 |
390 void ChromeLauncherController::SetLaunchType( | 390 void ChromeLauncherController::SetLaunchType( |
391 ash::LauncherID id, | 391 ash::LauncherID id, |
392 ExtensionPrefs::LaunchType launch_type) { | 392 extensions::ExtensionPrefs::LaunchType launch_type) { |
393 if (id_to_item_map_.find(id) == id_to_item_map_.end()) | 393 if (id_to_item_map_.find(id) == id_to_item_map_.end()) |
394 return; | 394 return; |
395 | 395 |
396 return profile_->GetExtensionService()->extension_prefs()->SetLaunchType( | 396 return profile_->GetExtensionService()->extension_prefs()->SetLaunchType( |
397 id_to_item_map_[id].app_id, launch_type); | 397 id_to_item_map_[id].app_id, launch_type); |
398 } | 398 } |
399 | 399 |
400 void ChromeLauncherController::UnpinAppsWithID(const std::string& app_id) { | 400 void ChromeLauncherController::UnpinAppsWithID(const std::string& app_id) { |
401 if (CanPin()) | 401 if (CanPin()) |
402 DoUnpinAppsWithID(app_id); | 402 DoUnpinAppsWithID(app_id); |
(...skipping 530 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 } | 933 } |
934 model_->AddAt(index, item); | 934 model_->AddAt(index, item); |
935 | 935 |
936 if (!controller || controller->type() != | 936 if (!controller || controller->type() != |
937 BrowserLauncherItemController::TYPE_EXTENSION_PANEL) { | 937 BrowserLauncherItemController::TYPE_EXTENSION_PANEL) { |
938 if (item.status != ash::STATUS_IS_PENDING) | 938 if (item.status != ash::STATUS_IS_PENDING) |
939 app_icon_loader_->FetchImage(app_id); | 939 app_icon_loader_->FetchImage(app_id); |
940 } | 940 } |
941 return id; | 941 return id; |
942 } | 942 } |
OLD | NEW |