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 "content/public/browser/context_factory.h" | 17 #include "content/public/browser/context_factory.h" |
17 #include "grit/chrome_unscaled_resources.h" | 18 #include "grit/chrome_unscaled_resources.h" |
18 #include "ui/base/resource/resource_bundle.h" | 19 #include "ui/base/resource/resource_bundle.h" |
19 #include "ui/base/ui_base_switches.h" | 20 #include "ui/base/ui_base_switches.h" |
20 #include "ui/gfx/geometry/rect.h" | 21 #include "ui/gfx/geometry/rect.h" |
21 #include "ui/gfx/screen.h" | 22 #include "ui/gfx/screen.h" |
22 #include "ui/views/widget/native_widget.h" | 23 #include "ui/views/widget/native_widget.h" |
23 #include "ui/views/widget/widget.h" | 24 #include "ui/views/widget/widget.h" |
24 | 25 |
25 #if defined(OS_WIN) | 26 #if defined(OS_WIN) |
(...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
376 // windows. | 377 // windows. |
377 views::LinuxUI* ui = views::LinuxUI::instance(); | 378 views::LinuxUI* ui = views::LinuxUI::instance(); |
378 return maximized && ui && ui->UnityIsRunning(); | 379 return maximized && ui && ui->UnityIsRunning(); |
379 } | 380 } |
380 #endif | 381 #endif |
381 | 382 |
382 ui::ContextFactory* ChromeViewsDelegate::GetContextFactory() { | 383 ui::ContextFactory* ChromeViewsDelegate::GetContextFactory() { |
383 return content::GetContextFactory(); | 384 return content::GetContextFactory(); |
384 } | 385 } |
385 | 386 |
| 387 std::string ChromeViewsDelegate::GetApplicationName() { |
| 388 return chrome::VersionInfo().Name(); |
| 389 } |
| 390 |
386 #if defined(OS_WIN) | 391 #if defined(OS_WIN) |
387 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, | 392 int ChromeViewsDelegate::GetAppbarAutohideEdges(HMONITOR monitor, |
388 const base::Closure& callback) { | 393 const base::Closure& callback) { |
389 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an | 394 // Initialize the map with EDGE_BOTTOM. This is important, as if we return an |
390 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and | 395 // initial value of 0 (no auto-hide edges) then we'll go fullscreen and |
391 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting | 396 // windows will automatically remove WS_EX_TOPMOST from the appbar resulting |
392 // in us thinking there is no auto-hide edges. By returning at least one edge | 397 // in us thinking there is no auto-hide edges. By returning at least one edge |
393 // we don't initially go fullscreen until we figure out the real auto-hide | 398 // we don't initially go fullscreen until we figure out the real auto-hide |
394 // edges. | 399 // edges. |
395 if (!appbar_autohide_edge_map_.count(monitor)) | 400 if (!appbar_autohide_edge_map_.count(monitor)) |
(...skipping 27 matching lines...) Expand all Loading... |
423 } | 428 } |
424 #endif | 429 #endif |
425 | 430 |
426 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 431 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
427 views::Widget::InitParams::WindowOpacity | 432 views::Widget::InitParams::WindowOpacity |
428 ChromeViewsDelegate::GetOpacityForInitParams( | 433 ChromeViewsDelegate::GetOpacityForInitParams( |
429 const views::Widget::InitParams& params) { | 434 const views::Widget::InitParams& params) { |
430 return views::Widget::InitParams::OPAQUE_WINDOW; | 435 return views::Widget::InitParams::OPAQUE_WINDOW; |
431 } | 436 } |
432 #endif | 437 #endif |
OLD | NEW |