Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(123)

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 11367041: Adds View::GetNativeTheme() to get the NativeTheme. The interesting (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix include Created 8 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_private.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/activation_change_observer.h" 10 #include "ui/aura/client/activation_change_observer.h"
11 #include "ui/aura/client/activation_client.h" 11 #include "ui/aura/client/activation_client.h"
12 #include "ui/aura/client/aura_constants.h" 12 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/client/cursor_client.h" 13 #include "ui/aura/client/cursor_client.h"
14 #include "ui/aura/client/drag_drop_client.h" 14 #include "ui/aura/client/drag_drop_client.h"
15 #include "ui/aura/client/screen_position_client.h" 15 #include "ui/aura/client/screen_position_client.h"
16 #include "ui/aura/client/stacking_client.h" 16 #include "ui/aura/client/stacking_client.h"
17 #include "ui/aura/client/window_move_client.h" 17 #include "ui/aura/client/window_move_client.h"
18 #include "ui/aura/client/window_types.h" 18 #include "ui/aura/client/window_types.h"
19 #include "ui/aura/env.h" 19 #include "ui/aura/env.h"
20 #include "ui/aura/focus_manager.h" 20 #include "ui/aura/focus_manager.h"
21 #include "ui/aura/root_window.h" 21 #include "ui/aura/root_window.h"
22 #include "ui/aura/window.h" 22 #include "ui/aura/window.h"
23 #include "ui/aura/window_observer.h" 23 #include "ui/aura/window_observer.h"
24 #include "ui/base/dragdrop/os_exchange_data.h" 24 #include "ui/base/dragdrop/os_exchange_data.h"
25 #include "ui/base/events/event.h" 25 #include "ui/base/events/event.h"
26 #include "ui/base/native_theme/native_theme_aura.h"
26 #include "ui/base/ui_base_types.h" 27 #include "ui/base/ui_base_types.h"
27 #include "ui/compositor/layer.h" 28 #include "ui/compositor/layer.h"
28 #include "ui/gfx/canvas.h" 29 #include "ui/gfx/canvas.h"
29 #include "ui/gfx/font.h" 30 #include "ui/gfx/font.h"
30 #include "ui/gfx/screen.h" 31 #include "ui/gfx/screen.h"
31 #include "ui/views/drag_utils.h" 32 #include "ui/views/drag_utils.h"
32 #include "ui/views/ime/input_method_bridge.h" 33 #include "ui/views/ime/input_method_bridge.h"
33 #include "ui/views/views_delegate.h" 34 #include "ui/views/views_delegate.h"
34 #include "ui/views/widget/desktop_native_widget_aura.h" 35 #include "ui/views/widget/desktop_native_widget_aura.h"
35 #include "ui/views/widget/drop_helper.h" 36 #include "ui/views/widget/drop_helper.h"
36 #include "ui/views/widget/native_widget_aura_window_observer.h" 37 #include "ui/views/widget/native_widget_aura_window_observer.h"
37 #include "ui/views/widget/native_widget_delegate.h" 38 #include "ui/views/widget/native_widget_delegate.h"
38 #include "ui/views/widget/root_view.h" 39 #include "ui/views/widget/root_view.h"
39 #include "ui/views/widget/tooltip_manager_aura.h" 40 #include "ui/views/widget/tooltip_manager_aura.h"
40 #include "ui/views/widget/widget_aura_utils.h" 41 #include "ui/views/widget/widget_aura_utils.h"
41 #include "ui/views/widget/widget_delegate.h" 42 #include "ui/views/widget/widget_delegate.h"
42 43
43 #if defined(OS_WIN) 44 #if defined(OS_WIN)
44 #include "base/win/scoped_gdi_object.h" 45 #include "base/win/scoped_gdi_object.h"
45 #include "base/win/win_util.h" 46 #include "base/win/win_util.h"
46 #include "ui/base/l10n/l10n_util_win.h" 47 #include "ui/base/l10n/l10n_util_win.h"
47 #endif 48 #endif
48 49
50 #if !defined(OS_CHROMEOS)
51 #include "ui/views/widget/desktop_root_window_host.h"
52 #endif
53
49 namespace views { 54 namespace views {
50 55
51 namespace { 56 namespace {
52 57
53 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) { 58 void SetRestoreBounds(aura::Window* window, const gfx::Rect& bounds) {
54 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds)); 59 window->SetProperty(aura::client::kRestoreBoundsKey, new gfx::Rect(bounds));
55 } 60 }
56 61
57 } // namespace 62 } // namespace
58 63
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 if (window_->parent() && 613 if (window_->parent() &&
609 aura::client::GetWindowMoveClient(window_->parent())) { 614 aura::client::GetWindowMoveClient(window_->parent())) {
610 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop(); 615 aura::client::GetWindowMoveClient(window_->parent())->EndMoveLoop();
611 } 616 }
612 } 617 }
613 618
614 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) { 619 void NativeWidgetAura::SetVisibilityChangedAnimationsEnabled(bool value) {
615 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value); 620 window_->SetProperty(aura::client::kAnimationsDisabledKey, !value);
616 } 621 }
617 622
623 ui::NativeTheme* NativeWidgetAura::GetNativeTheme() {
624 #if !defined(OS_CHROMEOS)
625 return DesktopRootWindowHost::GetNativeTheme(window_);
626 #endif
627 return ui::NativeThemeAura::instance();
628 }
629
618 //////////////////////////////////////////////////////////////////////////////// 630 ////////////////////////////////////////////////////////////////////////////////
619 // NativeWidgetAura, views::InputMethodDelegate implementation: 631 // NativeWidgetAura, views::InputMethodDelegate implementation:
620 632
621 void NativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) { 633 void NativeWidgetAura::DispatchKeyEventPostIME(const ui::KeyEvent& key) {
622 FocusManager* focus_manager = GetWidget()->GetFocusManager(); 634 FocusManager* focus_manager = GetWidget()->GetFocusManager();
623 if (delegate_->OnKeyEvent(key) || !focus_manager) 635 if (delegate_->OnKeyEvent(key) || !focus_manager)
624 return; 636 return;
625 focus_manager->OnKeyEvent(key); 637 focus_manager->OnKeyEvent(key);
626 } 638 }
627 639
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after
989 return aura::Env::GetInstance()->is_mouse_button_down(); 1001 return aura::Env::GetInstance()->is_mouse_button_down();
990 } 1002 }
991 1003
992 // static 1004 // static
993 bool NativeWidgetPrivate::IsTouchDown() { 1005 bool NativeWidgetPrivate::IsTouchDown() {
994 return aura::Env::GetInstance()->is_touch_down(); 1006 return aura::Env::GetInstance()->is_touch_down();
995 } 1007 }
996 1008
997 } // namespace internal 1009 } // namespace internal
998 } // namespace views 1010 } // namespace views
OLDNEW
« no previous file with comments | « ui/views/widget/native_widget_aura.h ('k') | ui/views/widget/native_widget_private.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698