OLD | NEW |
---|---|
1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
6 | 6 |
7 #include "base/bind.h" | 7 #include "base/bind.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "content/public/browser/render_widget_host.h" | 9 #include "content/public/browser/render_widget_host.h" |
10 #include "content/public/browser/render_widget_host_iterator.h" | 10 #include "content/public/browser/render_widget_host_iterator.h" |
(...skipping 125 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
136 else | 136 else |
137 command.AppendArg("0"); | 137 command.AppendArg("0"); |
138 VLOG(1) << "Running " << command.GetCommandLineString(); | 138 VLOG(1) << "Running " << command.GetCommandLineString(); |
139 base::LaunchOptions options; | 139 base::LaunchOptions options; |
140 options.wait = true; | 140 options.wait = true; |
141 base::LaunchProcess(command, options, NULL); | 141 base::LaunchProcess(command, options, NULL); |
142 #endif | 142 #endif |
143 } | 143 } |
144 | 144 |
145 aura::Window *GetFrameWindow(aura::Window *window) { | 145 aura::Window *GetFrameWindow(aura::Window *window) { |
146 // Each container window has a non-negative id. Stop traversing at the child | |
147 // of a container window. | |
148 if (!window) | 146 if (!window) |
149 return NULL; | 147 return NULL; |
150 while(window->parent() && window->parent()->id() < 0) { | 148 while(window->parent()) { |
Shu Chen
2014/09/02 04:43:42
Kevin/Biao, do you think there is a case that a to
bshe
2014/09/02 12:58:47
I am not familiar with this code. kevers@ could co
Shu Chen
2014/09/02 14:30:43
Done. I've changed to safer solution.
| |
151 window = window->parent(); | 149 window = window->parent(); |
152 } | 150 } |
153 return window; | 151 return window; |
154 } | 152 } |
155 | 153 |
156 } // namespace | 154 } // namespace |
157 | 155 |
158 namespace keyboard { | 156 namespace keyboard { |
159 | 157 |
160 // Observer for both keyboard show and hide animations. It should be owned by | 158 // Observer for both keyboard show and hide animations. It should be owned by |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 | 564 |
567 void KeyboardController::RemoveBoundsChangedObserver(aura::Window* window) { | 565 void KeyboardController::RemoveBoundsChangedObserver(aura::Window* window) { |
568 aura::Window* target_window = GetFrameWindow(window); | 566 aura::Window* target_window = GetFrameWindow(window); |
569 if (target_window && | 567 if (target_window && |
570 target_window->HasObserver(window_bounds_observer_.get())) { | 568 target_window->HasObserver(window_bounds_observer_.get())) { |
571 target_window->RemoveObserver(window_bounds_observer_.get()); | 569 target_window->RemoveObserver(window_bounds_observer_.get()); |
572 } | 570 } |
573 } | 571 } |
574 | 572 |
575 } // namespace keyboard | 573 } // namespace keyboard |
OLD | NEW |