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