summaryrefslogtreecommitdiffstats
path: root/ui
diff options
context:
space:
mode:
authorcalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:10:34 +0000
committercalamity@chromium.org <calamity@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2014-03-21 12:10:34 +0000
commit248fbca0dbb41ad507d9c970e0113486c47217b8 (patch)
treeb643d611fa3a533536034a25f7567d279cf07ec0 /ui
parent14a584f7e4aa8c137a318328bd0cb91eb00d4a3a (diff)
downloadchromium_src-248fbca0dbb41ad507d9c970e0113486c47217b8.zip
chromium_src-248fbca0dbb41ad507d9c970e0113486c47217b8.tar.gz
chromium_src-248fbca0dbb41ad507d9c970e0113486c47217b8.tar.bz2
Remove the start page web ui from the app list.
This CL removes the start page webui from the app list, the associated show-app-list-start-page switch and the "Enable the App Launcher start page" flag. The webui will be repurposed for the experimental app list in https://codereview.chromium.org/186483004/. BUG= Review URL: https://codereview.chromium.org/206073004 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@258538 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'ui')
-rw-r--r--ui/app_list/views/app_list_folder_view.cc5
-rw-r--r--ui/app_list/views/app_list_folder_view.h7
-rw-r--r--ui/app_list/views/apps_container_view.cc13
-rw-r--r--ui/app_list/views/apps_container_view.h3
-rw-r--r--ui/app_list/views/apps_grid_view.cc61
-rw-r--r--ui/app_list/views/apps_grid_view.h11
-rw-r--r--ui/app_list/views/apps_grid_view_unittest.cc3
-rw-r--r--ui/app_list/views/contents_view.cc6
8 files changed, 21 insertions, 88 deletions
diff --git a/ui/app_list/views/app_list_folder_view.cc b/ui/app_list/views/app_list_folder_view.cc
index 548fc0d..6116c94 100644
--- a/ui/app_list/views/app_list_folder_view.cc
+++ b/ui/app_list/views/app_list_folder_view.cc
@@ -42,8 +42,7 @@ const int kOutOfFolderContainerBubbleDelta = 30;
AppListFolderView::AppListFolderView(AppsContainerView* container_view,
AppListModel* model,
- AppListMainView* app_list_main_view,
- content::WebContents* start_page_contents)
+ AppListMainView* app_list_main_view)
: container_view_(container_view),
app_list_main_view_(app_list_main_view),
folder_header_view_(new FolderHeaderView(this)),
@@ -56,7 +55,7 @@ AppListFolderView::AppListFolderView(AppsContainerView* container_view,
view_model_->Add(folder_header_view_, kIndexFolderHeader);
items_grid_view_ =
- new AppsGridView(app_list_main_view_, pagination_model_.get(), NULL);
+ new AppsGridView(app_list_main_view_, pagination_model_.get());
items_grid_view_->set_is_root_level(false);
items_grid_view_->SetLayout(
kPreferredIconDimension,
diff --git a/ui/app_list/views/app_list_folder_view.h b/ui/app_list/views/app_list_folder_view.h
index 198f691..07595c3 100644
--- a/ui/app_list/views/app_list_folder_view.h
+++ b/ui/app_list/views/app_list_folder_view.h
@@ -13,10 +13,6 @@
#include "ui/views/controls/button/button.h"
#include "ui/views/view.h"
-namespace content {
-class WebContents;
-}
-
namespace views {
class ViewModel;
}
@@ -39,8 +35,7 @@ class AppListFolderView : public views::View,
public:
AppListFolderView(AppsContainerView* container_view,
AppListModel* model,
- AppListMainView* app_list_main_view,
- content::WebContents* start_page_contents);
+ AppListMainView* app_list_main_view);
virtual ~AppListFolderView();
void SetAppListFolderItem(AppListFolderItem* folder);
diff --git a/ui/app_list/views/apps_container_view.cc b/ui/app_list/views/apps_container_view.cc
index 2a0ca0c..a56b3a92 100644
--- a/ui/app_list/views/apps_container_view.cc
+++ b/ui/app_list/views/apps_container_view.cc
@@ -23,13 +23,11 @@ namespace app_list {
AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view,
PaginationModel* pagination_model,
- AppListModel* model,
- content::WebContents* start_page_contents)
+ AppListModel* model)
: model_(model),
show_state_(SHOW_APPS),
top_icon_animation_pending_count_(0) {
- apps_grid_view_ = new AppsGridView(
- app_list_main_view, pagination_model, start_page_contents);
+ apps_grid_view_ = new AppsGridView(app_list_main_view, pagination_model);
int cols = kPreferredCols;
int rows = kPreferredRows;
if (app_list::switches::IsExperimentalAppListPositionEnabled()) {
@@ -42,11 +40,8 @@ AppsContainerView::AppsContainerView(AppListMainView* app_list_main_view,
folder_background_view_ = new FolderBackgroundView();
AddChildView(folder_background_view_);
- app_list_folder_view_ = new AppListFolderView(
- this,
- model,
- app_list_main_view,
- start_page_contents);
+ app_list_folder_view_ =
+ new AppListFolderView(this, model, app_list_main_view);
AddChildView(app_list_folder_view_);
apps_grid_view_->SetModel(model_);
diff --git a/ui/app_list/views/apps_container_view.h b/ui/app_list/views/apps_container_view.h
index 7b23f8f..1c8a913 100644
--- a/ui/app_list/views/apps_container_view.h
+++ b/ui/app_list/views/apps_container_view.h
@@ -33,8 +33,7 @@ class AppsContainerView : public views::View,
public:
AppsContainerView(AppListMainView* app_list_main_view,
PaginationModel* pagination_model,
- AppListModel* model,
- content::WebContents* start_page_contents);
+ AppListModel* model);
virtual ~AppsContainerView();
// Shows the active folder content specified by |folder_item|.
diff --git a/ui/app_list/views/apps_grid_view.cc b/ui/app_list/views/apps_grid_view.cc
index 6be7b42..da22ef0 100644
--- a/ui/app_list/views/apps_grid_view.cc
+++ b/ui/app_list/views/apps_grid_view.cc
@@ -318,14 +318,12 @@ class SynchronousDrag : public ui::DragSourceWin {
#endif // defined(OS_WIN)
AppsGridView::AppsGridView(AppsGridViewDelegate* delegate,
- PaginationModel* pagination_model,
- content::WebContents* start_page_contents)
+ PaginationModel* pagination_model)
: model_(NULL),
item_list_(NULL),
delegate_(delegate),
pagination_model_(pagination_model),
page_switcher_view_(new PageSwitcher(pagination_model)),
- start_page_view_(NULL),
cols_(0),
rows_per_page_(0),
selected_view_(NULL),
@@ -347,13 +345,6 @@ AppsGridView::AppsGridView(AppsGridViewDelegate* delegate,
pagination_model_->AddObserver(this);
AddChildView(page_switcher_view_);
-
- if (start_page_contents) {
- start_page_view_ =
- new views::WebView(start_page_contents->GetBrowserContext());
- start_page_view_->SetWebContents(start_page_contents);
- AddChildView(start_page_view_);
- }
}
AppsGridView::~AppsGridView() {
@@ -824,8 +815,6 @@ void AppsGridView::Layout() {
rect.set_y(rect.bottom() - page_switcher_height);
rect.set_height(page_switcher_height);
page_switcher_view_->SetBoundsRect(rect);
-
- LayoutStartPage();
}
bool AppsGridView::OnKeyPressed(const ui::KeyEvent& event) {
@@ -902,9 +891,9 @@ void AppsGridView::Update() {
}
void AppsGridView::UpdatePaging() {
- int total_page = start_page_view_ ? 1 : 0;
- if (view_model_.view_size() && tiles_per_page())
- total_page += (view_model_.view_size() - 1) / tiles_per_page() + 1;
+ int total_page = view_model_.view_size() && tiles_per_page()
+ ? (view_model_.view_size() - 1) / tiles_per_page() + 1
+ : 0;
pagination_model_->SetTotalPages(total_page);
}
@@ -949,19 +938,11 @@ views::View* AppsGridView::CreateViewForItemAtIndex(size_t index) {
AppsGridView::Index AppsGridView::GetIndexFromModelIndex(
int model_index) const {
- int page = model_index / tiles_per_page();
- if (start_page_view_)
- ++page;
-
- return Index(page, model_index % tiles_per_page());
+ return Index(model_index / tiles_per_page(), model_index % tiles_per_page());
}
int AppsGridView::GetModelIndexFromIndex(const Index& index) const {
- int model_index = index.page * tiles_per_page() + index.slot;
- if (start_page_view_)
- model_index -= tiles_per_page();
-
- return model_index;
+ return index.page * tiles_per_page() + index.slot;
}
void AppsGridView::SetSelectedItemByIndex(const Index& index) {
@@ -983,11 +964,8 @@ void AppsGridView::SetSelectedItemByIndex(const Index& index) {
}
bool AppsGridView::IsValidIndex(const Index& index) const {
- const int item_page_start = start_page_view_ ? 1 : 0;
- return index.page >= item_page_start &&
- index.page < pagination_model_->total_pages() &&
- index.slot >= 0 &&
- index.slot < tiles_per_page() &&
+ return index.page >= 0 && index.page < pagination_model_->total_pages() &&
+ index.slot >= 0 && index.slot < tiles_per_page() &&
GetModelIndexFromIndex(index) < view_model_.view_size();
}
@@ -1829,29 +1807,6 @@ void AppsGridView::ButtonPressed(views::Button* sender,
}
}
-void AppsGridView::LayoutStartPage() {
- if (!start_page_view_)
- return;
-
- gfx::Rect start_page_bounds(GetLocalBounds());
- start_page_bounds.set_height(start_page_bounds.height() -
- page_switcher_view_->height());
-
- const int page_width = width() + kPagePadding;
- const int current_page = pagination_model_->selected_page();
- if (current_page > 0)
- start_page_bounds.Offset(-page_width, 0);
-
- const PaginationModel::Transition& transition =
- pagination_model_->transition();
- if (current_page == 0 || transition.target_page == 0) {
- const int dir = transition.target_page > current_page ? -1 : 1;
- start_page_bounds.Offset(transition.progress * page_width * dir, 0);
- }
-
- start_page_view_->SetBoundsRect(start_page_bounds);
-}
-
void AppsGridView::OnListItemAdded(size_t index, AppListItem* item) {
EndDrag(true);
diff --git a/ui/app_list/views/apps_grid_view.h b/ui/app_list/views/apps_grid_view.h
index 096730e..536a835 100644
--- a/ui/app_list/views/apps_grid_view.h
+++ b/ui/app_list/views/apps_grid_view.h
@@ -70,12 +70,9 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
// Constructs the app icon grid view. |delegate| is the delegate of this
// view, which usually is the hosting AppListView. |pagination_model| is
- // the paging info shared within the launcher UI. |start_page_contents| is
- // the contents for the launcher start page. It could be NULL if the start
- // page is not available.
+ // the paging info shared within the launcher UI.
AppsGridView(AppsGridViewDelegate* delegate,
- PaginationModel* pagination_model,
- content::WebContents* start_page_contents);
+ PaginationModel* pagination_model);
virtual ~AppsGridView();
// Sets fixed layout parameters. After setting this, CalculateLayout below
@@ -343,9 +340,6 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
// buffer area surrounding it.
bool IsPointWithinDragBuffer(const gfx::Point& point) const;
- // Handles start page layout and transition animation.
- void LayoutStartPage();
-
// Overridden from views::ButtonListener:
virtual void ButtonPressed(views::Button* sender,
const ui::Event& event) OVERRIDE;
@@ -448,7 +442,6 @@ class APP_LIST_EXPORT AppsGridView : public views::View,
AppsGridViewDelegate* delegate_;
PaginationModel* pagination_model_; // Owned by AppListController.
PageSwitcher* page_switcher_view_; // Owned by views hierarchy.
- views::WebView* start_page_view_; // Owned by views hierarchy.
gfx::Size icon_size_;
int cols_;
diff --git a/ui/app_list/views/apps_grid_view_unittest.cc b/ui/app_list/views/apps_grid_view_unittest.cc
index ed88983..a519674 100644
--- a/ui/app_list/views/apps_grid_view_unittest.cc
+++ b/ui/app_list/views/apps_grid_view_unittest.cc
@@ -105,8 +105,7 @@ class AppsGridViewTest : public views::ViewsTestBase {
model_.reset(new AppListTestModel);
pagination_model_.reset(new PaginationModel);
- apps_grid_view_.reset(
- new AppsGridView(NULL, pagination_model_.get(), NULL));
+ apps_grid_view_.reset(new AppsGridView(NULL, pagination_model_.get()));
apps_grid_view_->SetLayout(kIconDimension, kCols, kRows);
apps_grid_view_->SetBoundsRect(gfx::Rect(gfx::Size(kWidth, kHeight)));
apps_grid_view_->SetModel(model_.get());
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc
index 0121cf6..4353f4b 100644
--- a/ui/app_list/views/contents_view.cc
+++ b/ui/app_list/views/contents_view.cc
@@ -58,10 +58,8 @@ ContentsView::ContentsView(AppListMainView* app_list_main_view,
kPageTransitionDurationInMs,
kOverscrollPageTransitionDurationMs);
- content::WebContents* start_page_contents =
- view_delegate ? view_delegate->GetStartPageContents() : NULL;
- apps_container_view_ = new AppsContainerView(
- app_list_main_view, pagination_model, model, start_page_contents);
+ apps_container_view_ =
+ new AppsContainerView(app_list_main_view, pagination_model, model);
AddChildView(apps_container_view_);
view_model_->Add(apps_container_view_, kIndexAppsContainer);