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

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

Issue 2898743002: Draggable peeking/fullscreen launcher with transparent background. (Closed)
Patch Set: Removed header include in shell.h that was causing gn check failure. Created 3 years, 6 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
« no previous file with comments | « ui/app_list/views/start_page_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/start_page_view.cc
diff --git a/ui/app_list/views/start_page_view.cc b/ui/app_list/views/start_page_view.cc
index 27dce46204ee27c7df570e74c4986c76f399360d..c9166f3cf3f85be4e12cf5e333f4bdde125b0555 100644
--- a/ui/app_list/views/start_page_view.cc
+++ b/ui/app_list/views/start_page_view.cc
@@ -13,8 +13,10 @@
#include "base/strings/utf_string_conversions.h"
#include "ui/accessibility/ax_node_data.h"
#include "ui/app_list/app_list_constants.h"
+#include "ui/app_list/app_list_features.h"
#include "ui/app_list/app_list_item.h"
#include "ui/app_list/app_list_model.h"
+#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/app_list_view_delegate.h"
#include "ui/app_list/search_result.h"
#include "ui/app_list/views/all_apps_tile_item_view.h"
@@ -52,6 +54,7 @@ constexpr int kWebViewHeight = 224;
constexpr int kTileSpacing = 7;
constexpr int kNumStartPageTilesCols = 5;
constexpr int kTilesHorizontalMarginLeft = 145;
+constexpr int kCenterColumnOfStartPageAppGrid = 3;
constexpr int kLauncherPageBackgroundWidth = 400;
@@ -137,7 +140,10 @@ StartPageView::StartPageTilesContainer::StartPageTilesContainer(
SetBackground(views::CreateSolidBackground(kLabelBackgroundColor));
all_apps_button_->SetHoverStyle(TileItemView::HOVER_STYLE_ANIMATE_SHADOW);
all_apps_button_->SetParentBackgroundColor(kLabelBackgroundColor);
- CreateAppsGrid(kNumStartPageTiles);
+
+ CreateAppsGrid(features::IsFullscreenAppListEnabled()
+ ? kNumStartPageTilesFullscreen
+ : kNumStartPageTiles);
}
StartPageView::StartPageTilesContainer::~StartPageTilesContainer() {
@@ -171,7 +177,10 @@ int StartPageView::StartPageTilesContainer::DoUpdate() {
delete search_result_tile_views_[i];
search_result_tile_views_.clear();
RemoveChildView(all_apps_button_);
- CreateAppsGrid(std::min(kNumStartPageTiles, display_results.size()));
+
+ CreateAppsGrid(features::IsFullscreenAppListEnabled()
+ ? kNumStartPageTilesFullscreen
+ : std::min(kNumStartPageTiles, display_results.size()));
}
// Update the tile item results.
@@ -242,10 +251,19 @@ void StartPageView::StartPageTilesContainer::CreateAppsGrid(int apps_num) {
search_result_tile_views_.emplace_back(tile_item);
}
- // Also add a special "all apps" button to the end of the container.
all_apps_button_->UpdateIcon();
- if (i % kNumStartPageTilesCols == 0)
+ if (features::IsFullscreenAppListEnabled()) {
+ // Also add a special "all apps" button to the middle of the next row of the
+ // container.
tiles_layout_manager->StartRow(0, 0);
+ tiles_layout_manager->SkipColumns(kCenterColumnOfStartPageAppGrid);
+ } else {
+ // Also add a special "all apps" button to the end of the next row of the
+ // container.
+ if (i % kNumStartPageTilesCols == 0)
+ tiles_layout_manager->StartRow(0, 0);
+ }
+
tiles_layout_manager->AddView(all_apps_button_);
AddChildView(all_apps_button_);
}
@@ -253,7 +271,8 @@ void StartPageView::StartPageTilesContainer::CreateAppsGrid(int apps_num) {
////////////////////////////////////////////////////////////////////////////////
// StartPageView implementation:
StartPageView::StartPageView(AppListMainView* app_list_main_view,
- AppListViewDelegate* view_delegate)
+ AppListViewDelegate* view_delegate,
+ AppListView* app_list_view)
: app_list_main_view_(app_list_main_view),
view_delegate_(view_delegate),
search_box_spacer_view_(new View()),
@@ -262,7 +281,8 @@ StartPageView::StartPageView(AppListMainView* app_list_main_view,
view_delegate_->GetModel()->custom_launcher_page_name())),
tiles_container_(new StartPageTilesContainer(
app_list_main_view->contents_view(),
- new AllAppsTileItemView(app_list_main_view_->contents_view()),
+ new AllAppsTileItemView(app_list_main_view_->contents_view(),
+ app_list_view),
view_delegate)) {
search_box_spacer_view_->SetPreferredSize(gfx::Size(
kStartPageSearchBoxWidth,
@@ -274,7 +294,6 @@ StartPageView::StartPageView(AppListMainView* app_list_main_view,
// The view containing the start page tiles.
AddChildView(tiles_container_);
-
AddChildView(custom_launcher_page_background_);
tiles_container_->SetResults(view_delegate_->GetModel()->results());
@@ -294,11 +313,16 @@ void StartPageView::InitInstantContainer() {
views::BoxLayout::CROSS_AXIS_ALIGNMENT_CENTER);
instant_container_->SetLayoutManager(instant_layout_manager);
- views::View* web_view = view_delegate_->CreateStartPageWebView(
- gfx::Size(kWebViewWidth, kWebViewHeight));
- if (web_view) {
- web_view->SetFocusBehavior(FocusBehavior::NEVER);
- instant_container_->AddChildView(web_view);
+ // Create the view for the Google Doodle if the fullscreen launcher is not
+ // enabled.
+ if (!features::IsFullscreenAppListEnabled()) {
+ views::View* web_view = view_delegate_->CreateStartPageWebView(
+ gfx::Size(kWebViewWidth, kWebViewHeight));
+
+ if (web_view) {
+ web_view->SetFocusBehavior(FocusBehavior::NEVER);
+ instant_container_->AddChildView(web_view);
+ }
}
instant_container_->AddChildView(search_box_spacer_view_);
« no previous file with comments | « ui/app_list/views/start_page_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698