| 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 "chrome/browser/ui/views/chrome_views_delegate.h" | 5 #include "chrome/browser/ui/views/chrome_views_delegate.h" |
| 6 | 6 |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "base/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
| 9 #include "base/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 167 | 167 |
| 168 views::NonClientFrameView* ChromeViewsDelegate::CreateDefaultNonClientFrameView( | 168 views::NonClientFrameView* ChromeViewsDelegate::CreateDefaultNonClientFrameView( |
| 169 views::Widget* widget) { | 169 views::Widget* widget) { |
| 170 #if defined(USE_ASH) | 170 #if defined(USE_ASH) |
| 171 if (chrome::IsNativeViewInAsh(widget->GetNativeView())) | 171 if (chrome::IsNativeViewInAsh(widget->GetNativeView())) |
| 172 return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(widget); | 172 return ash::Shell::GetInstance()->CreateDefaultNonClientFrameView(widget); |
| 173 #endif | 173 #endif |
| 174 return NULL; | 174 return NULL; |
| 175 } | 175 } |
| 176 | 176 |
| 177 bool ChromeViewsDelegate::UseTransparentWindows() const { | 177 bool ChromeViewsDelegate::UseTransparentWindows( |
| 178 #if defined(USE_ASH) | 178 views::Widget::InitParams* params) const { |
| 179 // TODO(scottmg): http://crbug.com/133312. This needs context to determine | 179 if (!params) |
| 180 // if it's desktop or ash. | 180 return false; |
| 181 #if defined(OS_CHROMEOS) | 181 |
| 182 if (params->type != views::Widget::InitParams::TYPE_WINDOW && |
| 183 params->type != views::Widget::InitParams::TYPE_PANEL) |
| 184 return false; |
| 185 |
| 186 // For ChromeOS we always want transparent windows. |
| 187 #if defined(USE_ASH) && defined(OS_CHROMEOS) |
| 182 return true; | 188 return true; |
| 183 #else | 189 #endif |
| 184 NOTIMPLEMENTED(); | 190 |
| 191 // For Windows using Aura, we want transparent windows only if windows is |
| 192 // either on ASH desktop or it's top level and not of type window. |
| 193 #if defined(OS_WIN) && defined(USE_AURA) |
| 194 if (chrome::IsNativeViewInAsh(params->context)) |
| 195 return true; |
| 196 |
| 197 // By default, make all top-level windows but the main window transparent |
| 198 // initially so that they can be made to fade in. |
| 199 if (params->top_level && params->type != |
| 200 views::Widget::InitParams::TYPE_WINDOW) |
| 201 return true; |
| 202 #endif |
| 203 |
| 204 // For everything else we want opaque windows. |
| 185 return false; | 205 return false; |
| 186 #endif | |
| 187 #else | |
| 188 return false; | |
| 189 #endif | |
| 190 } | 206 } |
| 191 | 207 |
| 192 void ChromeViewsDelegate::AddRef() { | 208 void ChromeViewsDelegate::AddRef() { |
| 193 g_browser_process->AddRefModule(); | 209 g_browser_process->AddRefModule(); |
| 194 } | 210 } |
| 195 | 211 |
| 196 void ChromeViewsDelegate::ReleaseRef() { | 212 void ChromeViewsDelegate::ReleaseRef() { |
| 197 g_browser_process->ReleaseModule(); | 213 g_browser_process->ReleaseModule(); |
| 198 } | 214 } |
| 199 | 215 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 303 params->native_widget = new views::DesktopNativeWidgetAura(delegate); | 319 params->native_widget = new views::DesktopNativeWidgetAura(delegate); |
| 304 } | 320 } |
| 305 } | 321 } |
| 306 #endif | 322 #endif |
| 307 } | 323 } |
| 308 | 324 |
| 309 base::TimeDelta | 325 base::TimeDelta |
| 310 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { | 326 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { |
| 311 return base::TimeDelta(); | 327 return base::TimeDelta(); |
| 312 } | 328 } |
| OLD | NEW |