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 15 matching lines...) Expand all Loading... |
26 #include <dwmapi.h> | 26 #include <dwmapi.h> |
27 #include <shellapi.h> | 27 #include <shellapi.h> |
28 #include "base/task_runner_util.h" | 28 #include "base/task_runner_util.h" |
29 #include "base/win/windows_version.h" | 29 #include "base/win/windows_version.h" |
30 #include "chrome/browser/app_icon_win.h" | 30 #include "chrome/browser/app_icon_win.h" |
31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
32 #include "ui/base/win/shell.h" | 32 #include "ui/base/win/shell.h" |
33 #endif | 33 #endif |
34 | 34 |
35 #if defined(USE_AURA) | 35 #if defined(USE_AURA) |
| 36 #include "content/public/browser/context_factory.h" |
36 #include "ui/aura/window.h" | 37 #include "ui/aura/window.h" |
37 #include "ui/aura/window_event_dispatcher.h" | 38 #include "ui/aura/window_event_dispatcher.h" |
38 #endif | 39 #endif |
39 | 40 |
40 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 41 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
41 #include "chrome/browser/ui/host_desktop.h" | 42 #include "chrome/browser/ui/host_desktop.h" |
42 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" | 43 #include "ui/views/widget/desktop_aura/desktop_native_widget_aura.h" |
43 #include "ui/views/widget/native_widget_aura.h" | 44 #include "ui/views/widget/native_widget_aura.h" |
44 #endif | 45 #endif |
45 | 46 |
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
364 | 365 |
365 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) | 366 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
366 bool ChromeViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) { | 367 bool ChromeViewsDelegate::WindowManagerProvidesTitleBar(bool maximized) { |
367 // On Ubuntu Unity, the system always provides a title bar for maximized | 368 // On Ubuntu Unity, the system always provides a title bar for maximized |
368 // windows. | 369 // windows. |
369 views::LinuxUI* ui = views::LinuxUI::instance(); | 370 views::LinuxUI* ui = views::LinuxUI::instance(); |
370 return maximized && ui && ui->UnityIsRunning(); | 371 return maximized && ui && ui->UnityIsRunning(); |
371 } | 372 } |
372 #endif | 373 #endif |
373 | 374 |
| 375 #if defined(USE_AURA) |
| 376 ui::ContextFactory* ChromeViewsDelegate::GetContextFactory() { |
| 377 return content::GetContextFactory(); |
| 378 } |
| 379 #endif |
| 380 |
374 #if defined(OS_WIN) | 381 #if defined(OS_WIN) |
375 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, | 382 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, |
376 const base::Closure& callback) { | 383 const base::Closure& callback) { |
377 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an | 384 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an |
378 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and | 385 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and |
379 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting | 386 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting |
380 // in us thinking there is no auto-hide edges. By returning at least one edge | 387 // in us thinking there is no auto-hide edges. By returning at least one edge |
381 // we don't initially go fullscreen until we figure out the real auto-hide | 388 // we don't initially go fullscreen until we figure out the real auto-hide |
382 // edges. | 389 // edges. |
383 if (!appbar_autohide_edge_map_.count(monitor)) | 390 if (!appbar_autohide_edge_map_.count(monitor)) |
(...skipping 27 matching lines...) Expand all Loading... |
411 } | 418 } |
412 #endif | 419 #endif |
413 | 420 |
414 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 421 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
415 views::Widget::InitParams::WindowOpacity | 422 views::Widget::InitParams::WindowOpacity |
416 ChromeViewsDelegate::GetOpacityForInitParams( | 423 ChromeViewsDelegate::GetOpacityForInitParams( |
417 const views::Widget::InitParams& params) { | 424 const views::Widget::InitParams& params) { |
418 return views::Widget::InitParams::OPAQUE_WINDOW; | 425 return views::Widget::InitParams::OPAQUE_WINDOW; |
419 } | 426 } |
420 #endif | 427 #endif |
OLD | NEW |