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 "base/command_line.h" | 5 #include "base/command_line.h" |
6 | 6 |
7 #include "chrome/browser/views/frame/browser_view.h" | 7 #include "chrome/browser/views/frame/browser_view.h" |
8 | 8 |
9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
10 #include "base/time.h" | 10 #include "base/time.h" |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
44 #include "chrome/common/l10n_util.h" | 44 #include "chrome/common/l10n_util.h" |
45 #include "chrome/common/notification_service.h" | 45 #include "chrome/common/notification_service.h" |
46 #include "chrome/common/os_exchange_data.h" | 46 #include "chrome/common/os_exchange_data.h" |
47 #include "chrome/common/pref_names.h" | 47 #include "chrome/common/pref_names.h" |
48 #include "chrome/common/pref_service.h" | 48 #include "chrome/common/pref_service.h" |
49 #include "chrome/common/resource_bundle.h" | 49 #include "chrome/common/resource_bundle.h" |
50 #include "chrome/common/win_util.h" | 50 #include "chrome/common/win_util.h" |
51 #include "chrome/views/hwnd_notification_source.h" | 51 #include "chrome/views/hwnd_notification_source.h" |
52 #include "chrome/views/native_scroll_bar.h" | 52 #include "chrome/views/native_scroll_bar.h" |
53 #include "chrome/views/non_client_view.h" | 53 #include "chrome/views/non_client_view.h" |
| 54 #include "chrome/views/root_view.h" |
54 #include "chrome/views/view.h" | 55 #include "chrome/views/view.h" |
55 #include "chrome/views/window.h" | 56 #include "chrome/views/window.h" |
56 #include "grit/chromium_strings.h" | 57 #include "grit/chromium_strings.h" |
57 #include "grit/generated_resources.h" | 58 #include "grit/generated_resources.h" |
58 #include "grit/theme_resources.h" | 59 #include "grit/theme_resources.h" |
59 #include "grit/webkit_resources.h" | 60 #include "grit/webkit_resources.h" |
60 | 61 |
61 | 62 |
62 using base::TimeDelta; | 63 using base::TimeDelta; |
63 | 64 |
(...skipping 611 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
675 | 676 |
676 void BrowserView::UpdateToolbar(TabContents* contents, | 677 void BrowserView::UpdateToolbar(TabContents* contents, |
677 bool should_restore_state) { | 678 bool should_restore_state) { |
678 toolbar_->Update(contents, should_restore_state); | 679 toolbar_->Update(contents, should_restore_state); |
679 } | 680 } |
680 | 681 |
681 void BrowserView::FocusToolbar() { | 682 void BrowserView::FocusToolbar() { |
682 // Do not restore the button that previously had accessibility focus, if | 683 // Do not restore the button that previously had accessibility focus, if |
683 // focus is set by using the toolbar focus keyboard shortcut. | 684 // focus is set by using the toolbar focus keyboard shortcut. |
684 toolbar_->set_acc_focused_view(NULL); | 685 toolbar_->set_acc_focused_view(NULL); |
685 toolbar_->RequestFocus(); | 686 // HACK: Do not use RequestFocus() here, as the toolbar is not marked as |
| 687 // "focusable". Instead bypass the sanity check in RequestFocus() and just |
| 688 // force it to focus, which will do the right thing. |
| 689 GetRootView()->FocusView(toolbar_); |
686 } | 690 } |
687 | 691 |
688 void BrowserView::DestroyBrowser() { | 692 void BrowserView::DestroyBrowser() { |
689 // Explicitly delete the BookmarkBarView now. That way we don't have to | 693 // Explicitly delete the BookmarkBarView now. That way we don't have to |
690 // worry about the BookmarkBarView potentially outliving the Browser & | 694 // worry about the BookmarkBarView potentially outliving the Browser & |
691 // Profile. | 695 // Profile. |
692 bookmark_bar_view_.reset(); | 696 bookmark_bar_view_.reset(); |
693 browser_.reset(); | 697 browser_.reset(); |
694 } | 698 } |
695 | 699 |
(...skipping 954 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1650 | 1654 |
1651 // static | 1655 // static |
1652 void BrowserView::InitClass() { | 1656 void BrowserView::InitClass() { |
1653 static bool initialized = false; | 1657 static bool initialized = false; |
1654 if (!initialized) { | 1658 if (!initialized) { |
1655 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1659 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
1656 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 1660 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
1657 initialized = true; | 1661 initialized = true; |
1658 } | 1662 } |
1659 } | 1663 } |
OLD | NEW |