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

Side by Side Diff: content/shell/browser/shell_platform_data_aura.cc

Issue 686523002: Standardize usage of virtual/override/final specifiers. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebase Created 6 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "content/shell/browser/shell_platform_data_aura.h" 5 #include "content/shell/browser/shell_platform_data_aura.h"
6 6
7 #include "content/shell/browser/shell.h" 7 #include "content/shell/browser/shell.h"
8 #include "ui/aura/client/aura_constants.h" 8 #include "ui/aura/client/aura_constants.h"
9 #include "ui/aura/client/default_capture_client.h" 9 #include "ui/aura/client/default_capture_client.h"
10 #include "ui/aura/env.h" 10 #include "ui/aura/env.h"
(...skipping 11 matching lines...) Expand all
22 namespace content { 22 namespace content {
23 23
24 namespace { 24 namespace {
25 25
26 class FillLayout : public aura::LayoutManager { 26 class FillLayout : public aura::LayoutManager {
27 public: 27 public:
28 explicit FillLayout(aura::Window* root) 28 explicit FillLayout(aura::Window* root)
29 : root_(root) { 29 : root_(root) {
30 } 30 }
31 31
32 virtual ~FillLayout() {} 32 ~FillLayout() override {}
33 33
34 private: 34 private:
35 // aura::LayoutManager: 35 // aura::LayoutManager:
36 virtual void OnWindowResized() override { 36 void OnWindowResized() override {}
37 }
38 37
39 virtual void OnWindowAddedToLayout(aura::Window* child) override { 38 void OnWindowAddedToLayout(aura::Window* child) override {
40 child->SetBounds(root_->bounds()); 39 child->SetBounds(root_->bounds());
41 } 40 }
42 41
43 virtual void OnWillRemoveWindowFromLayout(aura::Window* child) override { 42 void OnWillRemoveWindowFromLayout(aura::Window* child) override {}
44 }
45 43
46 virtual void OnWindowRemovedFromLayout(aura::Window* child) override { 44 void OnWindowRemovedFromLayout(aura::Window* child) override {}
47 }
48 45
49 virtual void OnChildWindowVisibilityChanged(aura::Window* child, 46 void OnChildWindowVisibilityChanged(aura::Window* child,
50 bool visible) override { 47 bool visible) override {}
51 }
52 48
53 virtual void SetChildBounds(aura::Window* child, 49 void SetChildBounds(aura::Window* child,
54 const gfx::Rect& requested_bounds) override { 50 const gfx::Rect& requested_bounds) override {
55 SetChildBoundsDirect(child, requested_bounds); 51 SetChildBoundsDirect(child, requested_bounds);
56 } 52 }
57 53
58 aura::Window* root_; 54 aura::Window* root_;
59 55
60 DISALLOW_COPY_AND_ASSIGN(FillLayout); 56 DISALLOW_COPY_AND_ASSIGN(FillLayout);
61 }; 57 };
62 58
63 class MinimalInputEventFilter : public ui::internal::InputMethodDelegate, 59 class MinimalInputEventFilter : public ui::internal::InputMethodDelegate,
64 public ui::EventHandler { 60 public ui::EventHandler {
65 public: 61 public:
66 explicit MinimalInputEventFilter(aura::WindowTreeHost* host) 62 explicit MinimalInputEventFilter(aura::WindowTreeHost* host)
67 : host_(host), 63 : host_(host),
68 input_method_(ui::CreateInputMethod(this, 64 input_method_(ui::CreateInputMethod(this,
69 gfx::kNullAcceleratedWidget)) { 65 gfx::kNullAcceleratedWidget)) {
70 input_method_->Init(true); 66 input_method_->Init(true);
71 host_->window()->AddPreTargetHandler(this); 67 host_->window()->AddPreTargetHandler(this);
72 host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey, 68 host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey,
73 input_method_.get()); 69 input_method_.get());
74 } 70 }
75 71
76 virtual ~MinimalInputEventFilter() { 72 ~MinimalInputEventFilter() override {
77 host_->window()->RemovePreTargetHandler(this); 73 host_->window()->RemovePreTargetHandler(this);
78 host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey, 74 host_->window()->SetProperty(aura::client::kRootWindowInputMethodKey,
79 static_cast<ui::InputMethod*>(NULL)); 75 static_cast<ui::InputMethod*>(NULL));
80 } 76 }
81 77
82 private: 78 private:
83 // ui::EventHandler: 79 // ui::EventHandler:
84 virtual void OnKeyEvent(ui::KeyEvent* event) override { 80 void OnKeyEvent(ui::KeyEvent* event) override {
85 // See the comment in InputMethodEventFilter::OnKeyEvent() for details. 81 // See the comment in InputMethodEventFilter::OnKeyEvent() for details.
86 if (event->IsTranslated()) { 82 if (event->IsTranslated()) {
87 event->SetTranslated(false); 83 event->SetTranslated(false);
88 } else { 84 } else {
89 if (input_method_->DispatchKeyEvent(*event)) 85 if (input_method_->DispatchKeyEvent(*event))
90 event->StopPropagation(); 86 event->StopPropagation();
91 } 87 }
92 } 88 }
93 89
94 // ui::internal::InputMethodDelegate: 90 // ui::internal::InputMethodDelegate:
95 virtual bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override { 91 bool DispatchKeyEventPostIME(const ui::KeyEvent& event) override {
96 // See the comment in InputMethodEventFilter::DispatchKeyEventPostIME() for 92 // See the comment in InputMethodEventFilter::DispatchKeyEventPostIME() for
97 // details. 93 // details.
98 ui::KeyEvent aura_event(event); 94 ui::KeyEvent aura_event(event);
99 aura_event.SetTranslated(true); 95 aura_event.SetTranslated(true);
100 ui::EventDispatchDetails details = 96 ui::EventDispatchDetails details =
101 host_->dispatcher()->OnEventFromSource(&aura_event); 97 host_->dispatcher()->OnEventFromSource(&aura_event);
102 return aura_event.handled() || details.dispatcher_destroyed; 98 return aura_event.handled() || details.dispatcher_destroyed;
103 } 99 }
104 100
105 aura::WindowTreeHost* host_; 101 aura::WindowTreeHost* host_;
(...skipping 28 matching lines...) Expand all
134 130
135 void ShellPlatformDataAura::ShowWindow() { 131 void ShellPlatformDataAura::ShowWindow() {
136 host_->Show(); 132 host_->Show();
137 } 133 }
138 134
139 void ShellPlatformDataAura::ResizeWindow(const gfx::Size& size) { 135 void ShellPlatformDataAura::ResizeWindow(const gfx::Size& size) {
140 host_->SetBounds(gfx::Rect(size)); 136 host_->SetBounds(gfx::Rect(size));
141 } 137 }
142 138
143 } // namespace content 139 } // namespace content
OLDNEW
« no previous file with comments | « content/shell/browser/shell_content_browser_client.h ('k') | content/shell/browser/shell_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698