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

Unified Diff: chrome/browser/ui/views/app_list/win/app_list_win.cc

Issue 262643003: Revert of Refactor views app list services to allow more code sharing (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 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
« no previous file with comments | « chrome/browser/ui/views/app_list/win/app_list_win.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/views/app_list/win/app_list_win.cc
diff --git a/chrome/browser/ui/views/app_list/win/app_list_win.cc b/chrome/browser/ui/views/app_list/win/app_list_win.cc
index 70be41d92e58537b83fc19e6386828acf66993ea..c96ab6d5054f3e160ce820fd79dbb2dcac81ab98 100644
--- a/chrome/browser/ui/views/app_list/win/app_list_win.cc
+++ b/chrome/browser/ui/views/app_list/win/app_list_win.cc
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/views/app_list/win/app_list_win.h"
+#include "base/command_line.h"
+#include "chrome/browser/profiles/profile.h"
#include "chrome/browser/ui/app_list/app_list_positioner.h"
#include "ui/app_list/app_list_switches.h"
#include "ui/app_list/views/app_list_view.h"
@@ -42,7 +44,14 @@
} // namespace
-// static
+AppListWin::AppListWin(app_list::AppListView* view,
+ const base::Closure& on_should_dismiss)
+ : view_(view),
+ activation_tracker_(view, on_should_dismiss),
+ window_icon_updated_(false) {}
+
+AppListWin::~AppListWin() {}
+
gfx::Point AppListWin::FindAnchorPoint(const gfx::Size& view_size,
const gfx::Display& display,
const gfx::Point& cursor,
@@ -76,16 +85,45 @@
return positioner.GetAnchorPointForShelfCursor(edge, cursor);
}
-// static
-void AppListWin::MoveNearCursor(app_list::AppListView* view) {
+void AppListWin::Show() {
+ view_->GetWidget()->Show();
+ if (!window_icon_updated_) {
+ view_->GetWidget()->GetTopLevelWidget()->UpdateWindowIcon();
+ window_icon_updated_ = true;
+ }
+ view_->GetWidget()->Activate();
+}
+
+void AppListWin::Hide() {
+ view_->GetWidget()->Hide();
+ activation_tracker_.OnViewHidden();
+}
+
+void AppListWin::MoveNearCursor() {
gfx::Point cursor = gfx::Screen::GetNativeScreen()->GetCursorScreenPoint();
gfx::Screen* screen =
- gfx::Screen::GetScreenFor(view->GetWidget()->GetNativeView());
+ gfx::Screen::GetScreenFor(view_->GetWidget()->GetNativeView());
gfx::Display display = screen->GetDisplayNearestPoint(cursor);
- view->SetBubbleArrow(views::BubbleBorder::FLOAT);
+ view_->SetBubbleArrow(views::BubbleBorder::FLOAT);
gfx::Rect taskbar_rect;
GetTaskbarRect(&taskbar_rect);
- view->SetAnchorPoint(
- FindAnchorPoint(view->GetPreferredSize(), display, cursor, taskbar_rect));
+ view_->SetAnchorPoint(FindAnchorPoint(view_->GetPreferredSize(), display,
+ cursor, taskbar_rect));
}
+
+bool AppListWin::IsVisible() {
+ return view_->GetWidget()->IsVisible();
+}
+
+void AppListWin::Prerender() {
+ view_->Prerender();
+}
+
+gfx::NativeWindow AppListWin::GetWindow() {
+ return view_->GetWidget()->GetNativeWindow();
+}
+
+void AppListWin::SetProfile(Profile* profile) {
+ view_->SetProfileByPath(profile->GetPath());
+}
« no previous file with comments | « chrome/browser/ui/views/app_list/win/app_list_win.h ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698