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

Side by Side Diff: chrome/browser/ui/app_list/extension_app_item.cc

Issue 13934007: Adding experimental maximize mode (behind a flag) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: A few self nits Created 7 years, 8 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
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/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
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 506 matching lines...) Expand 10 before | Expand all | Expand 10 after
556 } 560 }
557 561
558 if (!is_platform_app_) { 562 if (!is_platform_app_) {
559 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 563 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
560 context_menu_model_->AddCheckItemWithStringId( 564 context_menu_model_->AddCheckItemWithStringId(
561 LAUNCH_TYPE_REGULAR_TAB, 565 LAUNCH_TYPE_REGULAR_TAB,
562 IDS_APP_CONTEXT_MENU_OPEN_REGULAR); 566 IDS_APP_CONTEXT_MENU_OPEN_REGULAR);
563 context_menu_model_->AddCheckItemWithStringId( 567 context_menu_model_->AddCheckItemWithStringId(
564 LAUNCH_TYPE_PINNED_TAB, 568 LAUNCH_TYPE_PINNED_TAB,
565 IDS_APP_CONTEXT_MENU_OPEN_PINNED); 569 IDS_APP_CONTEXT_MENU_OPEN_PINNED);
566 context_menu_model_->AddCheckItemWithStringId( 570 #if defined(USE_ASH)
567 LAUNCH_TYPE_WINDOW, 571 if (!ash::Shell::IsForcedMaximizeMode())
568 IDS_APP_CONTEXT_MENU_OPEN_WINDOW); 572 #endif
569 // Even though the launch type is Full Screen it is more accurately 573 {
570 // described as Maximized in Ash. 574 context_menu_model_->AddCheckItemWithStringId(
571 context_menu_model_->AddCheckItemWithStringId( 575 LAUNCH_TYPE_WINDOW,
572 LAUNCH_TYPE_FULLSCREEN, 576 IDS_APP_CONTEXT_MENU_OPEN_WINDOW);
573 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED); 577 // Even though the launch type is Full Screen it is more accurately
574 578 // described as Maximized in Ash.
579 context_menu_model_->AddCheckItemWithStringId(
580 LAUNCH_TYPE_FULLSCREEN,
581 IDS_APP_CONTEXT_MENU_OPEN_MAXIMIZED);
582 }
575 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR); 583 context_menu_model_->AddSeparator(ui::NORMAL_SEPARATOR);
576 context_menu_model_->AddItemWithStringId(OPTIONS, 584 context_menu_model_->AddItemWithStringId(OPTIONS,
577 IDS_NEW_TAB_APP_OPTIONS); 585 IDS_NEW_TAB_APP_OPTIONS);
578 } 586 }
579 587
580 context_menu_model_->AddItemWithStringId(DETAILS, 588 context_menu_model_->AddItemWithStringId(DETAILS,
581 IDS_NEW_TAB_APP_DETAILS); 589 IDS_NEW_TAB_APP_DETAILS);
582 context_menu_model_->AddItemWithStringId(UNINSTALL, 590 context_menu_model_->AddItemWithStringId(UNINSTALL,
583 is_platform_app_ ? 591 is_platform_app_ ?
584 IDS_APP_LIST_UNINSTALL_ITEM : 592 IDS_APP_LIST_UNINSTALL_ITEM :
585 IDS_EXTENSIONS_UNINSTALL); 593 IDS_EXTENSIONS_UNINSTALL);
586 } 594 }
587 595
588 return context_menu_model_.get(); 596 return context_menu_model_.get();
589 } 597 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698