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/app_list/extension_app_item.h" | 5 #include "chrome/browser/ui/app_list/extension_app_item.h" |
6 | 6 |
7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
8 #include "chrome/app/chrome_command_ids.h" | 8 #include "chrome/app/chrome_command_ids.h" |
9 #include "chrome/browser/extensions/context_menu_matcher.h" | 9 #include "chrome/browser/extensions/context_menu_matcher.h" |
10 #include "chrome/browser/extensions/extension_prefs.h" | 10 #include "chrome/browser/extensions/extension_prefs.h" |
(...skipping 19 matching lines...) Expand all Loading... |
30 #include "grit/chromium_strings.h" | 30 #include "grit/chromium_strings.h" |
31 #include "grit/generated_resources.h" | 31 #include "grit/generated_resources.h" |
32 #include "grit/theme_resources.h" | 32 #include "grit/theme_resources.h" |
33 #include "ui/base/l10n/l10n_util.h" | 33 #include "ui/base/l10n/l10n_util.h" |
34 #include "ui/base/resource/resource_bundle.h" | 34 #include "ui/base/resource/resource_bundle.h" |
35 #include "ui/gfx/canvas.h" | 35 #include "ui/gfx/canvas.h" |
36 #include "ui/gfx/color_utils.h" | 36 #include "ui/gfx/color_utils.h" |
37 #include "ui/gfx/image/canvas_image_source.h" | 37 #include "ui/gfx/image/canvas_image_source.h" |
38 #include "ui/gfx/image/image_skia_operations.h" | 38 #include "ui/gfx/image/image_skia_operations.h" |
39 | 39 |
| 40 #if defined(USE_ASH) |
| 41 #include "ash/shell.h" |
| 42 #endif |
| 43 |
40 using extensions::Extension; | 44 using extensions::Extension; |
41 | 45 |
42 namespace { | 46 namespace { |
43 | 47 |
44 enum CommandId { | 48 enum CommandId { |
45 LAUNCH_NEW = 100, | 49 LAUNCH_NEW = 100, |
46 TOGGLE_PIN, | 50 TOGGLE_PIN, |
47 CREATE_SHORTCUTS, | 51 CREATE_SHORTCUTS, |
48 OPTIONS, | 52 OPTIONS, |
49 UNINSTALL, | 53 UNINSTALL, |
(...skipping 502 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
552 } | 556 } |
553 | 557 |
554 if (!is_platform_app_) { | 558 if (!is_platform_app_) { |
555 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); | 559 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); |
556 context_menu_model_->AddCheckItemWithStringId( | 560 context_menu_model_->AddCheckItemWithStringId( |
557 LAUNCH_TYPE_REGULAR_TAB, | 561 LAUNCH_TYPE_REGULAR_TAB, |
558 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); | 562 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); |
559 context_menu_model_->AddCheckItemWithStringId( | 563 context_menu_model_->AddCheckItemWithStringId( |
560 LAUNCH_TYPE_PINNED_TAB, | 564 LAUNCH_TYPE_PINNED_TAB, |
561 IDS_APP_CONTEXT_MENU_OPEN_PINNED); | 565 IDS_APP_CONTEXT_MENU_OPEN_PINNED); |
562 context_menu_model_->AddCheckItemWithStringId( | 566 #if defined(USE_ASH) |
563 LAUNCH_TYPE_WINDOW, | 567 if (!ash::Shell::IsForcedMaximizeMode()) |
564 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); | 568 #endif |
565 // Even though the launch type is Full Screen it is more accurately | 569 { |
566 // described as Maximized in Ash. | 570 context_menu_model_->AddCheckItemWithStringId( |
567 context_menu_model_->AddCheckItemWithStringId( | 571 LAUNCH_TYPE_WINDOW, |
568 LAUNCH_TYPE_FULLSCREEN, | 572 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); |
569 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); | 573 // Even though the launch type is Full Screen it is more accurately |
570 | 574 // described as Maximized in Ash. |
| 575 context_menu_model_->AddCheckItemWithStringId( |
| 576 LAUNCH_TYPE_FULLSCREEN, |
| 577 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); |
| 578 } |
571 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); | 579 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); |
572 context_menu_model_->AddItemWithStringId(OPTIONS, | 580 context_menu_model_->AddItemWithStringId(OPTIONS, |
573 IDS_NEW_TAB_APP_OPTIONS); | 581 IDS_NEW_TAB_APP_OPTIONS); |
574 } | 582 } |
575 | 583 |
576 context_menu_model_->AddItemWithStringId(DETAILS, | 584 context_menu_model_->AddItemWithStringId(DETAILS, |
577 IDS_NEW_TAB_APP_DETAILS); | 585 IDS_NEW_TAB_APP_DETAILS); |
578 context_menu_model_->AddItemWithStringId(UNINSTALL, | 586 context_menu_model_->AddItemWithStringId(UNINSTALL, |
579 is_platform_app_ ? | 587 is_platform_app_ ? |
580 IDS_APP_LIST_UNINSTALL_ITEM : | 588 IDS_APP_LIST_UNINSTALL_ITEM : |
581 IDS_EXTENSIONS_UNINSTALL); | 589 IDS_EXTENSIONS_UNINSTALL); |
582 } | 590 } |
583 | 591 |
584 return context_menu_model_.get(); | 592 return context_menu_model_.get(); |
585 } | 593 } |
OLD | NEW |