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

Side by Side Diff: chrome/browser/ui/ash/chrome_keyboard_ui.cc

Issue 2322513002: Check for null return from GetNativeView(). (Closed)
Patch Set: Created 4 years, 3 months 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) 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 "chrome/browser/ui/ash/chrome_keyboard_ui.h" 5 #include "chrome/browser/ui/ash/chrome_keyboard_ui.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "ash/common/shell_window_ids.h" 9 #include "ash/common/shell_window_ids.h"
10 #include "ash/root_window_controller.h" 10 #include "ash/root_window_controller.h"
(...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after
176 void ChromeKeyboardUI::ShowKeyboardContainer(aura::Window* container) { 176 void ChromeKeyboardUI::ShowKeyboardContainer(aura::Window* container) {
177 // TODO(bshe): Implement logic to decide which root window should display 177 // TODO(bshe): Implement logic to decide which root window should display
178 // virtual keyboard. http://crbug.com/303429 178 // virtual keyboard. http://crbug.com/303429
179 if (container->GetRootWindow() != ash::Shell::GetPrimaryRootWindow()) 179 if (container->GetRootWindow() != ash::Shell::GetPrimaryRootWindow())
180 NOTIMPLEMENTED(); 180 NOTIMPLEMENTED();
181 181
182 KeyboardUIContent::ShowKeyboardContainer(container); 182 KeyboardUIContent::ShowKeyboardContainer(container);
183 } 183 }
184 184
185 bool ChromeKeyboardUI::ShouldWindowOverscroll(aura::Window* window) const { 185 bool ChromeKeyboardUI::ShouldWindowOverscroll(aura::Window* window) const {
186 // Added while we determine if RenderWidgetHostViewChildFrame can be changed
187 // to always return a non-null value: https://crbug.com/644726 .
188 // If we cannot always return a non-null value, then this may need to stay.
189 if (!window)
190 return true;
Charlie Reis 2016/09/07 17:23:58 I would suggest putting the null check in Keyboard
wjmaclean 2016/09/07 17:41:05 Done. I also added a check in UpdateInsetsForWind
191
186 aura::Window* root_window = window->GetRootWindow(); 192 aura::Window* root_window = window->GetRootWindow();
187 if (!root_window) 193 if (!root_window)
188 return true; 194 return true;
189 195
190 if (root_window != GetKeyboardRootWindow()) 196 if (root_window != GetKeyboardRootWindow())
191 return false; 197 return false;
192 198
193 ash::RootWindowController* root_window_controller = 199 ash::RootWindowController* root_window_controller =
194 ash::GetRootWindowController(root_window); 200 ash::GetRootWindowController(root_window);
195 // Shell ime window container contains virtual keyboard windows and IME 201 // Shell ime window container contains virtual keyboard windows and IME
(...skipping 24 matching lines...) Expand all
220 event_args->Append(input_context.release()); 226 event_args->Append(input_context.release());
221 227
222 std::unique_ptr<extensions::Event> event(new extensions::Event( 228 std::unique_ptr<extensions::Event> event(new extensions::Event(
223 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED, 229 extensions::events::VIRTUAL_KEYBOARD_PRIVATE_ON_TEXT_INPUT_BOX_FOCUSED,
224 virtual_keyboard_private::OnTextInputBoxFocused::kEventName, 230 virtual_keyboard_private::OnTextInputBoxFocused::kEventName,
225 std::move(event_args))); 231 std::move(event_args)));
226 event->restrict_to_browser_context = browser_context(); 232 event->restrict_to_browser_context = browser_context();
227 router->DispatchEventToExtension(kVirtualKeyboardExtensionID, 233 router->DispatchEventToExtension(kVirtualKeyboardExtensionID,
228 std::move(event)); 234 std::move(event));
229 } 235 }
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