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/views/frame/browser_view.h" | 5 #include "chrome/browser/ui/views/frame/browser_view.h" |
6 | 6 |
7 #if defined(TOOLKIT_USES_GTK) | 7 #if defined(TOOLKIT_USES_GTK) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 #elif defined(TOOLKIT_USES_GTK) | 121 #elif defined(TOOLKIT_USES_GTK) |
122 #include "chrome/browser/ui/views/accelerator_table.h" | 122 #include "chrome/browser/ui/views/accelerator_table.h" |
123 #if !defined(TOUCH_UI) | 123 #if !defined(TOUCH_UI) |
124 #include "chrome/browser/ui/views/handle_web_keyboard_event.h" | 124 #include "chrome/browser/ui/views/handle_web_keyboard_event.h" |
125 #endif | 125 #endif |
126 #endif | 126 #endif |
127 | 127 |
128 #if defined(OS_CHROMEOS) | 128 #if defined(OS_CHROMEOS) |
129 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" | 129 #include "chrome/browser/ui/views/keyboard_overlay_dialog_view.h" |
130 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" | 130 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" |
131 #endif | 131 #else |
132 | |
133 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | |
134 #include "chrome/browser/ui/views/download/download_shelf_view.h" | 132 #include "chrome/browser/ui/views/download/download_shelf_view.h" |
135 #endif | 133 #endif |
136 | 134 |
137 #if defined(TOUCH_UI) | 135 #if defined(TOUCH_UI) |
138 #include "chrome/browser/ui/touch/status_bubble_touch.h" | 136 #include "chrome/browser/ui/touch/status_bubble_touch.h" |
139 #endif | 137 #endif |
140 | 138 |
141 using base::TimeDelta; | 139 using base::TimeDelta; |
142 using views::ColumnSet; | 140 using views::ColumnSet; |
143 using views::GridLayout; | 141 using views::GridLayout; |
(...skipping 208 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
352 ticker_.Stop(); | 350 ticker_.Stop(); |
353 ticker_.UnregisterTickHandler(&hung_window_detector_); | 351 ticker_.UnregisterTickHandler(&hung_window_detector_); |
354 | 352 |
355 // Terminate the jumplist (must be called before browser_->profile() is | 353 // Terminate the jumplist (must be called before browser_->profile() is |
356 // destroyed. | 354 // destroyed. |
357 if (jumplist_) { | 355 if (jumplist_) { |
358 jumplist_->Terminate(); | 356 jumplist_->Terminate(); |
359 } | 357 } |
360 #endif | 358 #endif |
361 | 359 |
362 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 360 #if !defined(OS_CHROMEOS) |
363 // We destroy the download shelf before |browser_| to remove its child | 361 // We destroy the download shelf before |browser_| to remove its child |
364 // download views from the set of download observers (since the observed | 362 // download views from the set of download observers (since the observed |
365 // downloads can be destroyed along with |browser_| and the observer | 363 // downloads can be destroyed along with |browser_| and the observer |
366 // notifications will call back into deleted objects). | 364 // notifications will call back into deleted objects). |
367 download_shelf_.reset(); | 365 download_shelf_.reset(); |
368 #endif | 366 #endif |
369 | 367 |
370 // The TabStrip attaches a listener to the model. Make sure we shut down the | 368 // The TabStrip attaches a listener to the model. Make sure we shut down the |
371 // TabStrip first so that it can cleanly remove the listener. | 369 // TabStrip first so that it can cleanly remove the listener. |
372 if (tabstrip_) { | 370 if (tabstrip_) { |
(...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1081 if (browser_ != NULL) | 1079 if (browser_ != NULL) |
1082 browser_->UpdateDownloadShelfVisibility(visible); | 1080 browser_->UpdateDownloadShelfVisibility(visible); |
1083 | 1081 |
1084 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out | 1082 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out |
1085 // everything correctly, as if the animation had finished. This doesn't | 1083 // everything correctly, as if the animation had finished. This doesn't |
1086 // matter for showing the shelf, as the show animation will do it. | 1084 // matter for showing the shelf, as the show animation will do it. |
1087 ToolbarSizeChanged(false); | 1085 ToolbarSizeChanged(false); |
1088 } | 1086 } |
1089 | 1087 |
1090 bool BrowserView::IsDownloadShelfVisible() const { | 1088 bool BrowserView::IsDownloadShelfVisible() const { |
1091 #if defined(OS_CHROMEOS) && !defined(USE_AURA) | 1089 #if defined(OS_CHROMEOS) |
1092 return false; | 1090 return false; |
1093 #else | 1091 #else |
1094 return download_shelf_.get() && download_shelf_->IsShowing(); | 1092 return download_shelf_.get() && download_shelf_->IsShowing(); |
1095 #endif | 1093 #endif |
1096 } | 1094 } |
1097 | 1095 |
1098 DownloadShelf* BrowserView::GetDownloadShelf() { | 1096 DownloadShelf* BrowserView::GetDownloadShelf() { |
1099 #if defined(OS_CHROMEOS) && !defined(USE_AURA) | 1097 #if defined(OS_CHROMEOS) |
1100 NOTREACHED(); | 1098 NOTREACHED(); |
1101 return NULL; | 1099 return NULL; |
1102 #else | 1100 #else |
1103 if (!download_shelf_.get()) { | 1101 if (!download_shelf_.get()) { |
1104 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); | 1102 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); |
1105 download_shelf_->set_parent_owned(false); | 1103 download_shelf_->set_parent_owned(false); |
1106 } | 1104 } |
1107 return download_shelf_.get(); | 1105 return download_shelf_.get(); |
1108 #endif | 1106 #endif |
1109 } | 1107 } |
(...skipping 627 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1737 void BrowserView::GetAccessiblePanes( | 1735 void BrowserView::GetAccessiblePanes( |
1738 std::vector<views::AccessiblePaneView*>* panes) { | 1736 std::vector<views::AccessiblePaneView*>* panes) { |
1739 // This should be in the order of pane traversal of the panes using F6. | 1737 // This should be in the order of pane traversal of the panes using F6. |
1740 // If one of these is invisible or has no focusable children, it will be | 1738 // If one of these is invisible or has no focusable children, it will be |
1741 // automatically skipped. | 1739 // automatically skipped. |
1742 panes->push_back(toolbar_); | 1740 panes->push_back(toolbar_); |
1743 if (bookmark_bar_view_.get()) | 1741 if (bookmark_bar_view_.get()) |
1744 panes->push_back(bookmark_bar_view_.get()); | 1742 panes->push_back(bookmark_bar_view_.get()); |
1745 if (infobar_container_) | 1743 if (infobar_container_) |
1746 panes->push_back(infobar_container_); | 1744 panes->push_back(infobar_container_); |
1747 #if !defined(OS_CHROMEOS) || defined(USE_AURA) | 1745 #if !defined(OS_CHROMEOS) |
1748 if (download_shelf_.get()) | 1746 if (download_shelf_.get()) |
1749 panes->push_back(download_shelf_.get()); | 1747 panes->push_back(download_shelf_.get()); |
1750 #endif | 1748 #endif |
1751 } | 1749 } |
1752 | 1750 |
1753 /////////////////////////////////////////////////////////////////////////////// | 1751 /////////////////////////////////////////////////////////////////////////////// |
1754 // BrowserView, views::View overrides: | 1752 // BrowserView, views::View overrides: |
1755 | 1753 |
1756 std::string BrowserView::GetClassName() const { | 1754 std::string BrowserView::GetClassName() const { |
1757 return kViewClassName; | 1755 return kViewClassName; |
(...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2620 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, | 2618 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, |
2621 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, | 2619 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, |
2622 bubble_view, bubble_view); | 2620 bubble_view, bubble_view); |
2623 } | 2621 } |
2624 | 2622 |
2625 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2623 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2626 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2624 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2627 if (button) | 2625 if (button) |
2628 button->ShowAvatarBubble(); | 2626 button->ShowAvatarBubble(); |
2629 } | 2627 } |
OLD | NEW |