Chromium Code Reviews| 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 scoped_refptr<base::TaskRunner> | |
| 393 ChromeViewsDelegate::GetInitializationTaskRunner() { | |
| 394 return content::BrowserThread::GetMessageLoopProxyForThread( | |
|
sky
2015/04/24 20:52:28
Why do we want to run this on the file thread?
dmazzoni
2015/04/24 21:23:43
It's the call to g_module_open in ui/accessibility
| |
| 395 content::BrowserThread::FILE); | |
| 396 } | |
| 397 | |
| 391 #if defined(OS_WIN) | 398 #if defined(OS_WIN) |
| 392 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, | 399 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, |
| 393 const base::Closure& callback) { | 400 const base::Closure& callback) { |
| 394 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an | 401 // 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 | 402 // 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 | 403 // 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 | 404 // 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 | 405 // we don't initially go fullscreen until we figure out the real auto-hide |
| 399 // edges. | 406 // edges. |
| 400 if (!appbar_autohide_edge_map_.count(monitor)) | 407 if (!appbar_autohide_edge_map_.count(monitor)) |
| (...skipping 27 matching lines...) Expand all Loading... | |
| 428 } | 435 } |
| 429 #endif | 436 #endif |
| 430 | 437 |
| 431 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 438 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
| 432 views::Widget::InitParams::WindowOpacity | 439 views::Widget::InitParams::WindowOpacity |
| 433 ChromeViewsDelegate::GetOpacityForInitParams( | 440 ChromeViewsDelegate::GetOpacityForInitParams( |
| 434 const views::Widget::InitParams& params) { | 441 const views::Widget::InitParams& params) { |
| 435 return views::Widget::InitParams::OPAQUE_WINDOW; | 442 return views::Widget::InitParams::OPAQUE_WINDOW; |
| 436 } | 443 } |
| 437 #endif | 444 #endif |
| OLD | NEW |