OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/auto_reset.h" | 9 #include "base/auto_reset.h" |
10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
(...skipping 2477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2488 UpdateUIForContents(new_contents); | 2488 UpdateUIForContents(new_contents); |
2489 if (change_tab_contents) | 2489 if (change_tab_contents) |
2490 contents_container_->SetWebContents(new_contents->web_contents()); | 2490 contents_container_->SetWebContents(new_contents->web_contents()); |
2491 | 2491 |
2492 #if defined(USE_AURA) | 2492 #if defined(USE_AURA) |
2493 // |change_tab_contents| can mean same WebContents but different TabContents, | 2493 // |change_tab_contents| can mean same WebContents but different TabContents, |
2494 // so let SearchViewController decide how it would handle |new_contents|. | 2494 // so let SearchViewController decide how it would handle |new_contents|. |
2495 if (search_view_controller_.get()) | 2495 if (search_view_controller_.get()) |
2496 search_view_controller_->SetTabContents(new_contents); | 2496 search_view_controller_->SetTabContents(new_contents); |
2497 #endif | 2497 #endif |
2498 RestackLocationBarContainer(); | |
2499 | 2498 |
2500 UpdateDevToolsForContents(new_contents); | 2499 UpdateDevToolsForContents(new_contents); |
2501 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && | 2500 if (!browser_->tab_strip_model()->closing_all() && GetWidget()->IsActive() && |
2502 GetWidget()->IsVisible()) { | 2501 GetWidget()->IsVisible()) { |
2503 // We only restore focus if our window is visible, to avoid invoking blur | 2502 // We only restore focus if our window is visible, to avoid invoking blur |
2504 // handlers when we are eventually shown. | 2503 // handlers when we are eventually shown. |
2505 new_contents->web_contents()->GetView()->RestoreFocus(); | 2504 new_contents->web_contents()->GetView()->RestoreFocus(); |
2506 } | 2505 } |
2507 | 2506 |
2508 // Update all the UI bits. | 2507 // Update all the UI bits. |
2509 UpdateTitleBar(); | 2508 UpdateTitleBar(); |
| 2509 |
| 2510 // Restacking needs to happen after other UI updates. This restores special |
| 2511 // "widget" stacking that governs the SearchViewController's NTP "content" |
| 2512 // area. |
| 2513 RestackLocationBarContainer(); |
| 2514 |
2510 // No need to update Toolbar because it's already updated in | 2515 // No need to update Toolbar because it's already updated in |
2511 // browser.cc. | 2516 // browser.cc. |
2512 } | 2517 } |
2513 | 2518 |
2514 gfx::Size BrowserView::GetResizeCornerSize() const { | 2519 gfx::Size BrowserView::GetResizeCornerSize() const { |
2515 return ResizeCorner::GetSize(); | 2520 return ResizeCorner::GetSize(); |
2516 } | 2521 } |
2517 | 2522 |
2518 void BrowserView::CreateLauncherIcon() { | 2523 void BrowserView::CreateLauncherIcon() { |
2519 #if defined(USE_ASH) | 2524 #if defined(USE_ASH) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2598 if (contents && contents->GetContentNativeView() && | 2603 if (contents && contents->GetContentNativeView() && |
2599 contents->GetContentNativeView()->HasFocus()) { | 2604 contents->GetContentNativeView()->HasFocus()) { |
2600 (contents->GetRenderViewHost()->*method)(); | 2605 (contents->GetRenderViewHost()->*method)(); |
2601 return true; | 2606 return true; |
2602 } | 2607 } |
2603 #elif defined(OS_WIN) | 2608 #elif defined(OS_WIN) |
2604 // TODO(yusukes): Support non-Aura Windows. | 2609 // TODO(yusukes): Support non-Aura Windows. |
2605 #endif | 2610 #endif |
2606 return false; | 2611 return false; |
2607 } | 2612 } |
OLD | NEW |