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(); |
2510 // No need to update Toolbar because it's already updated in | 2509 // No need to update Toolbar because it's already updated in |
2511 // browser.cc. | 2510 // browser.cc. |
2511 RestackLocationBarContainer(); | |
sky
2012/07/28 02:27:53
The comment on 2509-2510 looks like it applies to
dhollowa
2012/07/31 17:03:46
Done.
| |
2512 } | 2512 } |
2513 | 2513 |
2514 gfx::Size BrowserView::GetResizeCornerSize() const { | 2514 gfx::Size BrowserView::GetResizeCornerSize() const { |
2515 return ResizeCorner::GetSize(); | 2515 return ResizeCorner::GetSize(); |
2516 } | 2516 } |
2517 | 2517 |
2518 void BrowserView::CreateLauncherIcon() { | 2518 void BrowserView::CreateLauncherIcon() { |
2519 #if defined(USE_ASH) | 2519 #if defined(USE_ASH) |
2520 if (chrome::IsNativeWindowInAsh(GetNativeWindow()) && | 2520 if (chrome::IsNativeWindowInAsh(GetNativeWindow()) && |
2521 !launcher_item_controller_.get()) { | 2521 !launcher_item_controller_.get()) { |
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2598 if (contents && contents->GetContentNativeView() && | 2598 if (contents && contents->GetContentNativeView() && |
2599 contents->GetContentNativeView()->HasFocus()) { | 2599 contents->GetContentNativeView()->HasFocus()) { |
2600 (contents->GetRenderViewHost()->*method)(); | 2600 (contents->GetRenderViewHost()->*method)(); |
2601 return true; | 2601 return true; |
2602 } | 2602 } |
2603 #elif defined(OS_WIN) | 2603 #elif defined(OS_WIN) |
2604 // TODO(yusukes): Support non-Aura Windows. | 2604 // TODO(yusukes): Support non-Aura Windows. |
2605 #endif | 2605 #endif |
2606 return false; | 2606 return false; |
2607 } | 2607 } |
OLD | NEW |