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

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

Issue 12288012: Showing launcher items for windowed v1 apps - pinned or not. Also - don't show windowed v1 apps in … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fixing build breakage with clang Created 7 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_item_controller.h ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ash/launcher/launcher_item_controller.h" 5 #include "chrome/browser/ui/ash/launcher/launcher_item_controller.h"
6 6
7 #include "base/basictypes.h" 7 #include "base/basictypes.h"
8 #include "base/utf_string_conversions.h" 8 #include "base/utf_string_conversions.h"
9 #include "chrome/browser/extensions/extension_service.h" 9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h" 11 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller.h"
12 #include "chrome/common/extensions/extension.h" 12 #include "chrome/common/extensions/extension.h"
13 13
14 LauncherItemController::LauncherItemController( 14 LauncherItemController::LauncherItemController(
15 Type type, 15 Type type,
16 const std::string& app_id, 16 const std::string& app_id,
17 ChromeLauncherController* launcher_controller) 17 ChromeLauncherController* launcher_controller)
18 : type_(type), 18 : type_(type),
19 app_id_(app_id), 19 app_id_(app_id),
20 launcher_id_(0), 20 launcher_id_(0),
21 launcher_controller_(launcher_controller) { 21 launcher_controller_(launcher_controller),
22 locked_(0) {
22 } 23 }
23 24
24 LauncherItemController::~LauncherItemController() { 25 LauncherItemController::~LauncherItemController() {
25 } 26 }
26 27
28 const std::string& LauncherItemController::app_id() const {
29 return app_id_;
30 }
31
27 string16 LauncherItemController::GetAppTitle() const { 32 string16 LauncherItemController::GetAppTitle() const {
28 if (app_id_.empty()) 33 if (app_id_.empty())
29 return string16(); 34 return string16();
30 const extensions::Extension* extension = 35 const extensions::Extension* extension =
31 launcher_controller_->profile()->GetExtensionService()-> 36 launcher_controller_->profile()->GetExtensionService()->
32 GetInstalledExtension(app_id_); 37 GetInstalledExtension(app_id_);
33 return extension ? UTF8ToUTF16(extension->name()) : string16(); 38 return extension ? UTF8ToUTF16(extension->name()) : string16();
34 } 39 }
35 40
36 ash::LauncherItemType LauncherItemController::GetLauncherItemType() const { 41 ash::LauncherItemType LauncherItemController::GetLauncherItemType() const {
37 switch (type_) { 42 switch (type_) {
38 case LauncherItemController::TYPE_SHORTCUT: 43 case LauncherItemController::TYPE_SHORTCUT:
44 case LauncherItemController::TYPE_WINDOWED_APP:
39 return ash::TYPE_APP_SHORTCUT; 45 return ash::TYPE_APP_SHORTCUT;
40 case LauncherItemController::TYPE_APP: 46 case LauncherItemController::TYPE_APP:
41 case LauncherItemController::TYPE_EXTENSION_PANEL: 47 case LauncherItemController::TYPE_EXTENSION_PANEL:
42 return ash::TYPE_PLATFORM_APP; 48 return ash::TYPE_PLATFORM_APP;
43 case LauncherItemController::TYPE_APP_PANEL: 49 case LauncherItemController::TYPE_APP_PANEL:
44 return ash::TYPE_APP_PANEL; 50 return ash::TYPE_APP_PANEL;
45 case LauncherItemController::TYPE_TABBED: 51 case LauncherItemController::TYPE_TABBED:
46 return ash::TYPE_TABBED; 52 return ash::TYPE_TABBED;
47 } 53 }
48 NOTREACHED(); 54 NOTREACHED();
49 return ash::TYPE_APP_SHORTCUT; 55 return ash::TYPE_APP_SHORTCUT;
50 } 56 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/ash/launcher/launcher_item_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698