OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include "chrome/browser/ui/views/aura/app_list_window.h" | 5 #include "chrome/browser/ui/views/aura/app_list_window.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "chrome/browser/profiles/profile_manager.h" | 8 #include "chrome/browser/profiles/profile_manager.h" |
9 #include "chrome/browser/ui/views/dom_view.h" | 9 #include "chrome/browser/ui/views/dom_view.h" |
10 #include "chrome/common/url_constants.h" | 10 #include "chrome/common/url_constants.h" |
11 #include "content/browser/renderer_host/render_view_host.h" | 11 #include "content/browser/renderer_host/render_view_host.h" |
12 #include "content/browser/renderer_host/render_widget_host_view.h" | 12 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 13 #include "views/widget/widget.h" |
13 #include "ui/aura/desktop.h" | 14 #include "ui/aura/desktop.h" |
14 #include "ui/gfx/compositor/layer_animator.h" | 15 #include "ui/gfx/compositor/layer_animator.h" |
15 #include "ui/gfx/screen.h" | 16 #include "ui/gfx/screen.h" |
16 #include "ui/views/widget/widget.h" | |
17 | 17 |
18 namespace { | 18 namespace { |
19 | 19 |
20 // Gets preferred bounds of app list window in show/hide state. | 20 // Gets preferred bounds of app list window in show/hide state. |
21 gfx::Rect GetPreferredBounds(bool show) { | 21 gfx::Rect GetPreferredBounds(bool show) { |
22 // The y-axis offset used at the beginning of showing animation. | 22 // The y-axis offset used at the beginning of showing animation. |
23 static const int kMoveUpAnimationOffset = 50; | 23 static const int kMoveUpAnimationOffset = 50; |
24 | 24 |
25 gfx::Point cursor = gfx::Screen::GetCursorScreenPoint(); | 25 gfx::Point cursor = gfx::Screen::GetCursorScreenPoint(); |
26 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor); | 26 gfx::Rect work_area = gfx::Screen::GetMonitorWorkAreaNearestPoint(cursor); |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
175 layer->SetBounds(GetPreferredBounds(visible)); | 175 layer->SetBounds(GetPreferredBounds(visible)); |
176 layer->SetOpacity(visible ? 1.0 : 0.0); | 176 layer->SetOpacity(visible ? 1.0 : 0.0); |
177 | 177 |
178 if (visible) { | 178 if (visible) { |
179 widget_->Show(); | 179 widget_->Show(); |
180 widget_->Activate(); | 180 widget_->Activate(); |
181 } else { | 181 } else { |
182 instance_ = NULL; // Closing and don't reuse this instance_. | 182 instance_ = NULL; // Closing and don't reuse this instance_. |
183 } | 183 } |
184 } | 184 } |
OLD | NEW |