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

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

Issue 8802003: Implement Widget::NotifyLocaleChanged for Aura. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Signal LocaleChanged() to all windows recursively Created 9 years 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
« no previous file with comments | « no previous file | no next file » | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "ui/aura/client/aura_constants.h" 9 #include "ui/aura/client/aura_constants.h"
10 #include "ui/aura/client/drag_drop_client.h" 10 #include "ui/aura/client/drag_drop_client.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 case Widget::InitParams::TYPE_MENU: 53 case Widget::InitParams::TYPE_MENU:
54 return aura::WINDOW_TYPE_MENU; 54 return aura::WINDOW_TYPE_MENU;
55 case Widget::InitParams::TYPE_TOOLTIP: 55 case Widget::InitParams::TYPE_TOOLTIP:
56 return aura::WINDOW_TYPE_TOOLTIP; 56 return aura::WINDOW_TYPE_TOOLTIP;
57 default: 57 default:
58 NOTREACHED() << "Unhandled widget type " << type; 58 NOTREACHED() << "Unhandled widget type " << type;
59 return aura::WINDOW_TYPE_UNKNOWN; 59 return aura::WINDOW_TYPE_UNKNOWN;
60 } 60 }
61 } 61 }
62 62
63 void NotifyLocaleChangedInternal(aura::Window* window) {
64 Widget* widget = Widget::GetWidgetForNativeWindow(window);
65 if (widget)
66 widget->LocaleChanged();
67
68 const aura::Window::Windows& children = window->children();
69 for (aura::Window::Windows::const_iterator it = children.begin();
70 it != children.end(); ++it) {
71 NotifyLocaleChangedInternal(*it);
72 }
73 }
74
63 } // namespace 75 } // namespace
64 76
65 // Used when SetInactiveRenderingDisabled() is invoked to track when active 77 // Used when SetInactiveRenderingDisabled() is invoked to track when active
66 // status changes in such a way that we should enable inactive rendering. 78 // status changes in such a way that we should enable inactive rendering.
67 class NativeWidgetAura::RootWindowObserverImpl 79 class NativeWidgetAura::RootWindowObserverImpl
68 : public aura::RootWindowObserver { 80 : public aura::RootWindowObserver {
69 public: 81 public:
70 explicit RootWindowObserverImpl(NativeWidgetAura* host) 82 explicit RootWindowObserverImpl(NativeWidgetAura* host)
71 : host_(host) { 83 : host_(host) {
72 aura::RootWindow::GetInstance()->AddObserver(this); 84 aura::RootWindow::GetInstance()->AddObserver(this);
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 DCHECK(drop_helper_.get() != NULL); 694 DCHECK(drop_helper_.get() != NULL);
683 return drop_helper_->OnDrop(event.data(), event.location(), 695 return drop_helper_->OnDrop(event.data(), event.location(),
684 event.source_operations()); 696 event.source_operations());
685 } 697 }
686 698
687 //////////////////////////////////////////////////////////////////////////////// 699 ////////////////////////////////////////////////////////////////////////////////
688 // Widget, public: 700 // Widget, public:
689 701
690 // static 702 // static
691 void Widget::NotifyLocaleChanged() { 703 void Widget::NotifyLocaleChanged() {
692 // http://crbug.com/102574 704 NotifyLocaleChangedInternal(aura::RootWindow::GetInstance());
693 NOTIMPLEMENTED();
694 } 705 }
695 706
696 // static 707 // static
697 void Widget::CloseAllSecondaryWidgets() { 708 void Widget::CloseAllSecondaryWidgets() {
698 // http://crbug.com/102575 709 // http://crbug.com/102575
699 NOTIMPLEMENTED(); 710 NOTIMPLEMENTED();
700 } 711 }
701 712
702 bool Widget::ConvertRect(const Widget* source, 713 bool Widget::ConvertRect(const Widget* source,
703 const Widget* target, 714 const Widget* target,
(...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after
791 } 802 }
792 } 803 }
793 804
794 // static 805 // static
795 bool NativeWidgetPrivate::IsMouseButtonDown() { 806 bool NativeWidgetPrivate::IsMouseButtonDown() {
796 return aura::RootWindow::GetInstance()->IsMouseButtonDown(); 807 return aura::RootWindow::GetInstance()->IsMouseButtonDown();
797 } 808 }
798 809
799 } // namespace internal 810 } // namespace internal
800 } // namespace views 811 } // namespace views
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698