OLD | NEW |
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 "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" | 5 #include "chrome/browser/ui/touch/frame/touch_browser_frame_view.h" |
6 | 6 |
7 #include "chrome/browser/profiles/profile.h" | 7 #include "chrome/browser/profiles/profile.h" |
8 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" | 8 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
9 #include "chrome/browser/tabs/tab_strip_model.h" | 9 #include "chrome/browser/tabs/tab_strip_model.h" |
10 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
219 minimize_button()->GetMirroredBounds().Contains(point)) | 219 minimize_button()->GetMirroredBounds().Contains(point)) |
220 return true; | 220 return true; |
221 | 221 |
222 return false; | 222 return false; |
223 } | 223 } |
224 | 224 |
225 void TouchBrowserFrameView::ActiveTabChanged(TabContentsWrapper* old_contents, | 225 void TouchBrowserFrameView::ActiveTabChanged(TabContentsWrapper* old_contents, |
226 TabContentsWrapper* new_contents, | 226 TabContentsWrapper* new_contents, |
227 int index, | 227 int index, |
228 bool user_gesture) { | 228 bool user_gesture) { |
229 if (new_contents == old_contents) | |
230 return; | |
231 | |
232 TabContents* contents = new_contents->tab_contents(); | 229 TabContents* contents = new_contents->tab_contents(); |
233 if (!TabContentsHasFocus(contents)) | 230 if (!TabContentsHasFocus(contents)) |
234 return; | 231 return; |
235 | 232 |
236 bool* editable = GetFocusedStateAccessor()->GetProperty( | 233 bool* editable = GetFocusedStateAccessor()->GetProperty( |
237 contents->property_bag()); | 234 contents->property_bag()); |
238 UpdateKeyboardAndLayout(editable ? *editable : false); | 235 UpdateKeyboardAndLayout(editable ? *editable : false); |
239 } | 236 } |
240 | 237 |
241 | 238 |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
318 RenderViewHost* host = | 315 RenderViewHost* host = |
319 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); | 316 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); |
320 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( | 317 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( |
321 host->routing_id())); | 318 host->routing_id())); |
322 } else { | 319 } else { |
323 // Notify the keyboard that it is hidden now. | 320 // Notify the keyboard that it is hidden now. |
324 keyboard_->SetVisible(false); | 321 keyboard_->SetVisible(false); |
325 } | 322 } |
326 SchedulePaint(); | 323 SchedulePaint(); |
327 } | 324 } |
OLD | NEW |