OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/strings/string_util.h" | 8 #include "base/strings/string_util.h" |
9 #include "base/win/windows_version.h" | 9 #include "base/win/windows_version.h" |
10 #include "ui/app_list/app_list_constants.h" | 10 #include "ui/app_list/app_list_constants.h" |
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
53 const int kSpeechUIMargin = 12; | 53 const int kSpeechUIMargin = 12; |
54 | 54 |
55 // The vertical position for the appearing animation of the speech UI. | 55 // The vertical position for the appearing animation of the speech UI. |
56 const float kSpeechUIAppearingPosition = 12; | 56 const float kSpeechUIAppearingPosition = 12; |
57 | 57 |
58 // The distance between the arrow tip and edge of the anchor view. | 58 // The distance between the arrow tip and edge of the anchor view. |
59 const int kArrowOffset = 10; | 59 const int kArrowOffset = 10; |
60 | 60 |
61 // Determines whether the current environment supports shadows bubble borders. | 61 // Determines whether the current environment supports shadows bubble borders. |
62 bool SupportsShadow() { | 62 bool SupportsShadow() { |
63 #if defined(USE_AURA) && defined(OS_WIN) | 63 #if defined(OS_WIN) |
64 // Shadows are not supported on Windows Aura without Aero Glass. | 64 // Shadows are not supported on Windows without Aero Glass. |
65 if (!ui::win::IsAeroGlassEnabled() || | 65 if (!ui::win::IsAeroGlassEnabled() || |
66 CommandLine::ForCurrentProcess()->HasSwitch( | 66 CommandLine::ForCurrentProcess()->HasSwitch( |
67 switches::kDisableDwmComposition)) { | 67 switches::kDisableDwmComposition)) { |
68 return false; | 68 return false; |
69 } | 69 } |
70 #elif defined(OS_LINUX) && !defined(USE_ASH) | 70 #elif defined(OS_LINUX) && !defined(USE_ASH) |
71 // Shadows are not supported on (non-ChromeOS) Linux. | 71 // Shadows are not supported on (non-ChromeOS) Linux. |
72 return false; | 72 return false; |
73 #endif | 73 #endif |
74 return true; | 74 return true; |
(...skipping 121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
196 | 196 |
197 void AppListView::Paint(gfx::Canvas* canvas) { | 197 void AppListView::Paint(gfx::Canvas* canvas) { |
198 views::BubbleDelegateView::Paint(canvas); | 198 views::BubbleDelegateView::Paint(canvas); |
199 if (g_next_paint_callback) { | 199 if (g_next_paint_callback) { |
200 g_next_paint_callback(); | 200 g_next_paint_callback(); |
201 g_next_paint_callback = NULL; | 201 g_next_paint_callback = NULL; |
202 } | 202 } |
203 } | 203 } |
204 | 204 |
205 void AppListView::OnThemeChanged() { | 205 void AppListView::OnThemeChanged() { |
206 #if defined(USE_AURA) && defined(OS_WIN) | 206 #if defined(OS_WIN) |
207 GetWidget()->Close(); | 207 GetWidget()->Close(); |
208 #endif | 208 #endif |
209 } | 209 } |
210 | 210 |
211 bool AppListView::ShouldHandleSystemCommands() const { | 211 bool AppListView::ShouldHandleSystemCommands() const { |
212 return true; | 212 return true; |
213 } | 213 } |
214 | 214 |
215 void AppListView::Prerender() { | 215 void AppListView::Prerender() { |
216 app_list_main_view_->Prerender(); | 216 app_list_main_view_->Prerender(); |
(...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
490 #else | 490 #else |
491 speech_view_->SetVisible(recognizing); | 491 speech_view_->SetVisible(recognizing); |
492 app_list_main_view_->SetVisible(!recognizing); | 492 app_list_main_view_->SetVisible(!recognizing); |
493 | 493 |
494 // Needs to schedule paint of AppListView itself, to repaint the background. | 494 // Needs to schedule paint of AppListView itself, to repaint the background. |
495 GetBubbleFrameView()->SchedulePaint(); | 495 GetBubbleFrameView()->SchedulePaint(); |
496 #endif | 496 #endif |
497 } | 497 } |
498 | 498 |
499 } // namespace app_list | 499 } // namespace app_list |
OLD | NEW |