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

Unified Diff: ui/app_list/views/app_list_view.cc

Issue 2802903003: Implementation of a full screen app list and re-alphabetized switches (Closed)
Patch Set: Addressed the issues that were brought up. Created 3 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 side-by-side diff with in-line comments
Download patch
« ui/app_list/views/app_list_view.h ('K') | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/app_list_view.cc
diff --git a/ui/app_list/views/app_list_view.cc b/ui/app_list/views/app_list_view.cc
index 2a1be91f97cb2a39c98e458b0cd518b89c0b5d5e..44684b5a4bb341cb20b128937b55125e0221a0a8 100644
--- a/ui/app_list/views/app_list_view.cc
+++ b/ui/app_list/views/app_list_view.cc
@@ -124,6 +124,12 @@ class SearchBoxWindowTargeter : public wm::MaskedWindowTargeter {
DISALLOW_COPY_AND_ASSIGN(SearchBoxWindowTargeter);
};
+// Checks to see if the fullscreen app list has been enabled via cmd line switch
vadimt 2017/04/13 21:48:34 add '.'
newcomer 2017/04/18 21:12:33 Done.
+bool IsFullscreenAppListEnabled() {
+ return base::CommandLine::ForCurrentProcess()->HasSwitch(
+ switches::kEnableFullscreenAppList);
+ }
+
} // namespace
// An animation observer to hide the view at the end of the animation.
@@ -190,6 +196,67 @@ AppListView::~AppListView() {
RemoveAllChildViews(true);
}
+void AppListView::Initialize(gfx::NativeView parent,
+ int initial_apps_page,
+ const gfx::Point &center_of_display_window,
+ const gfx::Rect display_work_area_bounds) {
+ base::Time start_time = base::Time::Now();
+
+ InitContents(parent, initial_apps_page);
+ AddAccelerator(ui::Accelerator(ui::VKEY_ESCAPE, ui::EF_NONE));
+
+ if (IsFullscreenAppListEnabled()) {
+ set_color(kContentsBackgroundColor);
+ views::Widget *widget = new views::Widget;
+ views::Widget::InitParams app_list_overlay_view_params(
+ views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
+
+ app_list_overlay_view_params.parent = parent;
+ app_list_overlay_view_params.delegate = this;
+
+ widget->Init(app_list_overlay_view_params);
+ widget->SetBounds(display_work_area_bounds);
+ widget->GetLayer()->SetFillsBoundsOpaquely(false);
+ widget->GetLayer()->SetBackgroundBlur(10);
+
+ InitChildWidgets();
+ overlay_view_ = new AppListOverlayView(0 /* no corners */);
+ AddChildView(overlay_view_);
vadimt 2017/04/13 21:48:34 Would it be possible to move this out of 'if'?
newcomer 2017/04/18 21:12:33 I refactored this, and we talked about duplicated
+
+ } else {
+ set_margins(gfx::Insets());
+ set_parent_window(parent);
+ set_close_on_deactivate(false);
+ set_shadow(views::BubbleBorder::NO_ASSETS);
+ set_color(kContentsBackgroundColor);
+
+ // This creates the app list widget. (Before this, child widgets cannot be
+ // created.)
+ views::BubbleDialogDelegateView::CreateBubble(this);
+
+ SetBubbleArrow(views::BubbleBorder::FLOAT);
+ // We can now create the internal widgets.
+
+ InitChildWidgets();
+ aura::Window *window = GetWidget()->GetNativeWindow();
+ window->SetEventTargeter(
+ base::MakeUnique<views::BubbleWindowTargeter>(this));
+
+ const int kOverlayCornerRadius =
+ GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius();
+ overlay_view_ = new AppListOverlayView(kOverlayCornerRadius);
+ overlay_view_->SetBoundsRect(GetContentsBounds());
+ AddChildView(overlay_view_);
+ SetAnchorPoint(center_of_display_window);
+ }
+
+ if (delegate_)
+ delegate_->ViewInitialized();
+
+ UMA_HISTOGRAM_TIMES("Apps.AppListCreationTime",
+ base::Time::Now() - start_time);
+}
+
void AppListView::InitAsBubble(gfx::NativeView parent, int initial_apps_page) {
base::Time start_time = base::Time::Now();
@@ -304,6 +371,10 @@ void AppListView::OnPaint(gfx::Canvas* canvas) {
}
}
+const char* AppListView::GetClassName() const {
+ return "AppListView";
+}
+
bool AppListView::ShouldHandleSystemCommands() const {
return true;
}
@@ -343,7 +414,6 @@ void AppListView::InitContents(gfx::NativeView parent, int initial_apps_page) {
app_list_main_view_->SetPaintToLayer();
app_list_main_view_->layer()->SetFillsBoundsOpaquely(false);
app_list_main_view_->layer()->SetMasksToBounds(true);
-
// This will be added to the |search_box_widget_| after the app list widget is
// initialized.
search_box_view_ = new SearchBoxView(app_list_main_view_, delegate_);
« ui/app_list/views/app_list_view.h ('K') | « ui/app_list/views/app_list_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698