| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/native_ui_contents.h" | 5 #include "chrome/browser/native_ui_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/browser.h" | 7 #include "chrome/browser/browser.h" |
| 8 #include "chrome/browser/history_tab_ui.h" | 8 #include "chrome/browser/history_tab_ui.h" |
| 9 #include "chrome/browser/navigation_entry.h" | 9 #include "chrome/browser/navigation_entry.h" |
| 10 #include "chrome/browser/views/download_tab_view.h" | 10 #include "chrome/browser/views/download_tab_view.h" |
| (...skipping 304 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 315 } | 315 } |
| 316 | 316 |
| 317 void NativeUIContents::SetInitialFocus() { | 317 void NativeUIContents::SetInitialFocus() { |
| 318 if (!current_ui_ || !current_ui_->SetInitialFocus()) { | 318 if (!current_ui_ || !current_ui_->SetInitialFocus()) { |
| 319 int tab_index; | 319 int tab_index; |
| 320 Browser* browser = Browser::GetBrowserForController( | 320 Browser* browser = Browser::GetBrowserForController( |
| 321 this->controller(), &tab_index); | 321 this->controller(), &tab_index); |
| 322 if (browser) | 322 if (browser) |
| 323 browser->FocusLocationBar(); | 323 browser->FocusLocationBar(); |
| 324 else | 324 else |
| 325 ::SetFocus(GetHWND()); | 325 TabContents::SetInitialFocus(); // Will set focus to our HWND. |
| 326 } | 326 } |
| 327 } | 327 } |
| 328 | 328 |
| 329 void NativeUIContents::SetIsLoading(bool is_loading, | 329 void NativeUIContents::SetIsLoading(bool is_loading, |
| 330 LoadNotificationDetails* details) { | 330 LoadNotificationDetails* details) { |
| 331 TabContents::SetIsLoading(is_loading, details); | 331 TabContents::SetIsLoading(is_loading, details); |
| 332 } | 332 } |
| 333 | 333 |
| 334 // FocusTraversable Implementation | 334 // FocusTraversable Implementation |
| 335 ChromeViews::View* NativeUIContents::FindNextFocusableView( | 335 ChromeViews::View* NativeUIContents::FindNextFocusableView( |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 666 DoSearch(); | 666 DoSearch(); |
| 667 } | 667 } |
| 668 | 668 |
| 669 void SearchableUIContainer::DoSearch() { | 669 void SearchableUIContainer::DoSearch() { |
| 670 if (delegate_) | 670 if (delegate_) |
| 671 delegate_->DoSearch(search_field_->GetText()); | 671 delegate_->DoSearch(search_field_->GetText()); |
| 672 | 672 |
| 673 scroll_view_->ScrollToPosition(scroll_view_->vertical_scroll_bar(), 0); | 673 scroll_view_->ScrollToPosition(scroll_view_->vertical_scroll_bar(), 0); |
| 674 } | 674 } |
| 675 | 675 |
| OLD | NEW |