| 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 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 minimize_button()->GetMirroredBounds().Contains(point)) | 223 minimize_button()->GetMirroredBounds().Contains(point)) |
| 224 return true; | 224 return true; |
| 225 | 225 |
| 226 return false; | 226 return false; |
| 227 } | 227 } |
| 228 | 228 |
| 229 void TouchBrowserFrameView::ActiveTabChanged(TabContentsWrapper* old_contents, | 229 void TouchBrowserFrameView::ActiveTabChanged(TabContentsWrapper* old_contents, |
| 230 TabContentsWrapper* new_contents, | 230 TabContentsWrapper* new_contents, |
| 231 int index, | 231 int index, |
| 232 bool user_gesture) { | 232 bool user_gesture) { |
| 233 if (new_contents == old_contents) | |
| 234 return; | |
| 235 | |
| 236 TabContents* contents = new_contents->tab_contents(); | 233 TabContents* contents = new_contents->tab_contents(); |
| 237 if (!TabContentsHasFocus(contents)) | 234 if (!TabContentsHasFocus(contents)) |
| 238 return; | 235 return; |
| 239 | 236 |
| 240 bool* editable = GetFocusedStateAccessor()->GetProperty( | 237 bool* editable = GetFocusedStateAccessor()->GetProperty( |
| 241 contents->property_bag()); | 238 contents->property_bag()); |
| 242 UpdateKeyboardAndLayout(editable ? *editable : false); | 239 UpdateKeyboardAndLayout(editable ? *editable : false); |
| 243 } | 240 } |
| 244 | 241 |
| 245 | 242 |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 333 RenderViewHost* host = | 330 RenderViewHost* host = |
| 334 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); | 331 browser_view()->browser()->GetSelectedTabContents()->render_view_host(); |
| 335 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( | 332 host->Send(new ViewMsg_ScrollFocusedEditableNodeIntoView( |
| 336 host->routing_id())); | 333 host->routing_id())); |
| 337 } else { | 334 } else { |
| 338 // Notify the keyboard that it is hidden now. | 335 // Notify the keyboard that it is hidden now. |
| 339 keyboard_->SetVisible(false); | 336 keyboard_->SetVisible(false); |
| 340 } | 337 } |
| 341 SchedulePaint(); | 338 SchedulePaint(); |
| 342 } | 339 } |
| OLD | NEW |