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" |
11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
12 #include "base/time/time.h" | 12 #include "base/time/time.h" |
13 #include "chrome/browser/browser_process.h" | 13 #include "chrome/browser/browser_process.h" |
14 #include "chrome/browser/profiles/profile_manager.h" | 14 #include "chrome/browser/profiles/profile_manager.h" |
15 #include "chrome/browser/ui/browser_window_state.h" | 15 #include "chrome/browser/ui/browser_window_state.h" |
16 #include "chrome/common/chrome_version_info.h" | 16 #include "chrome/common/chrome_version_info.h" |
| 17 #include "content/public/browser/browser_thread.h" |
17 #include "content/public/browser/context_factory.h" | 18 #include "content/public/browser/context_factory.h" |
18 #include "grit/chrome_unscaled_resources.h" | 19 #include "grit/chrome_unscaled_resources.h" |
19 #include "ui/base/resource/resource_bundle.h" | 20 #include "ui/base/resource/resource_bundle.h" |
20 #include "ui/base/ui_base_switches.h" | 21 #include "ui/base/ui_base_switches.h" |
21 #include "ui/gfx/geometry/rect.h" | 22 #include "ui/gfx/geometry/rect.h" |
22 #include "ui/gfx/screen.h" | 23 #include "ui/gfx/screen.h" |
23 #include "ui/views/widget/native_widget.h" | 24 #include "ui/views/widget/native_widget.h" |
24 #include "ui/views/widget/widget.h" | 25 #include "ui/views/widget/widget.h" |
25 | 26 |
26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
381 #endif | 382 #endif |
382 | 383 |
383 ui::ContextFactory* ChromeViewsDelegate::GetContextFactory() { | 384 ui::ContextFactory* ChromeViewsDelegate::GetContextFactory() { |
384 return content::GetContextFactory(); | 385 return content::GetContextFactory(); |
385 } | 386 } |
386 | 387 |
387 std::string ChromeViewsDelegate::GetApplicationName() { | 388 std::string ChromeViewsDelegate::GetApplicationName() { |
388 return chrome::VersionInfo().Name(); | 389 return chrome::VersionInfo().Name(); |
389 } | 390 } |
390 | 391 |
| 392 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) |
| 393 scoped_refptr<base::TaskRunner> |
| 394 ChromeViewsDelegate::GetTaskRunnerForAuraLinuxAccessibilityInit() { |
| 395 // This should be on the FILE thread so that we can open libatk-bridge.so |
| 396 // without blocking. |
| 397 return content::BrowserThread::GetMessageLoopProxyForThread( |
| 398 content::BrowserThread::FILE); |
| 399 } |
| 400 #endif |
| 401 |
391 #if defined(OS_WIN) | 402 #if defined(OS_WIN) |
392 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, | 403 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, |
393 const base::Closure& callback) { | 404 const base::Closure& callback) { |
394 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an | 405 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an |
395 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and | 406 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and |
396 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting | 407 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting |
397 // in us thinking there is no auto-hide edges. By returning at least one edge | 408 // in us thinking there is no auto-hide edges. By returning at least one edge |
398 // we don't initially go fullscreen until we figure out the real auto-hide | 409 // we don't initially go fullscreen until we figure out the real auto-hide |
399 // edges. | 410 // edges. |
400 if (!appbar_autohide_edge_map_.count(monitor)) | 411 if (!appbar_autohide_edge_map_.count(monitor)) |
(...skipping 27 matching lines...) Expand all Loading... |
428 } | 439 } |
429 #endif | 440 #endif |
430 | 441 |
431 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 442 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
432 views::Widget::InitParams::WindowOpacity | 443 views::Widget::InitParams::WindowOpacity |
433 ChromeViewsDelegate::GetOpacityForInitParams( | 444 ChromeViewsDelegate::GetOpacityForInitParams( |
434 const views::Widget::InitParams& params) { | 445 const views::Widget::InitParams& params) { |
435 return views::Widget::InitParams::OPAQUE_WINDOW; | 446 return views::Widget::InitParams::OPAQUE_WINDOW; |
436 } | 447 } |
437 #endif | 448 #endif |
OLD | NEW |