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

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

Issue 9023004: Revert 115515 - [Aura] Implement views-based applist. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 years 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/aura_shell/app_list/app_list_view.h ('k') | ui/aura_shell/app_list/app_list_view_delegate.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura_shell/app_list/app_list_view.cc
===================================================================
--- ui/aura_shell/app_list/app_list_view.cc (revision 115517)
+++ ui/aura_shell/app_list/app_list_view.cc (working copy)
@@ -1,80 +0,0 @@
-// Copyright (c) 2011 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "ui/aura_shell/app_list/app_list_view.h"
-
-#include "ui/aura_shell/app_list/app_list_groups_view.h"
-#include "ui/aura_shell/app_list/app_list_item_view.h"
-#include "ui/aura_shell/app_list/app_list_model.h"
-#include "ui/aura_shell/app_list/app_list_view_delegate.h"
-#include "ui/aura_shell/shell.h"
-#include "ui/views/layout/fill_layout.h"
-#include "ui/views/widget/widget.h"
-
-namespace aura_shell {
-
-AppListView::AppListView(
- AppListModel* model,
- AppListViewDelegate* delegate,
- const gfx::Rect& bounds,
- const aura_shell::ShellDelegate::SetWidgetCallback& callback)
- : model_(model),
- delegate_(delegate) {
- Init(bounds, callback);
-}
-
-AppListView::~AppListView() {
-}
-
-void AppListView::Close() {
- if (GetWidget()->IsVisible())
- Shell::GetInstance()->ToggleAppList();
-}
-
-void AppListView::Init(const gfx::Rect& bounds,
- const ShellDelegate::SetWidgetCallback& callback) {
- SetLayoutManager(new views::FillLayout);
- AppListGroupsView* groups_view = new AppListGroupsView(model_.get(), this);
- AddChildView(groups_view);
-
- views::Widget::InitParams widget_params(
- views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
- widget_params.bounds = bounds;
- widget_params.delegate = this;
- widget_params.keep_on_top = true;
- widget_params.transparent = true;
-
- views::Widget* widget = new views::Widget;
- widget->Init(widget_params);
- widget->SetContentsView(this);
-
- callback.Run(widget);
- if (groups_view->GetFocusedTile())
- groups_view->GetFocusedTile()->RequestFocus();
-}
-
-bool AppListView::OnKeyPressed(const views::KeyEvent& event) {
- if (event.key_code() == ui::VKEY_ESCAPE) {
- Close();
- return true;
- }
-
- return false;
-}
-
-bool AppListView::OnMousePressed(const views::MouseEvent& event) {
- // If mouse click reaches us, this means user clicks on blank area. So close.
- Close();
-
- return true;
-}
-
-void AppListView::AppListItemActivated(AppListItemView* sender,
- int event_flags) {
- if (delegate_.get())
- delegate_->OnAppListItemActivated(sender->model(), event_flags);
- Close();
-}
-
-} // namespace aura_shell
« no previous file with comments | « ui/aura_shell/app_list/app_list_view.h ('k') | ui/aura_shell/app_list/app_list_view_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698