| 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 203 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 344 ticker_.Stop(); | 346 ticker_.Stop(); |
| 345 ticker_.UnregisterTickHandler(&hung_window_detector_); | 347 ticker_.UnregisterTickHandler(&hung_window_detector_); |
| 346 | 348 |
| 347 // Terminate the jumplist (must be called before browser_->profile() is | 349 // Terminate the jumplist (must be called before browser_->profile() is |
| 348 // destroyed. | 350 // destroyed. |
| 349 if (jumplist_) { | 351 if (jumplist_) { |
| 350 jumplist_->Terminate(); | 352 jumplist_->Terminate(); |
| 351 } | 353 } |
| 352 #endif | 354 #endif |
| 353 | 355 |
| 354 #if !defined(OS_CHROMEOS) | 356 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 355 // We destroy the download shelf before |browser_| to remove its child | 357 // We destroy the download shelf before |browser_| to remove its child |
| 356 // download views from the set of download observers (since the observed | 358 // download views from the set of download observers (since the observed |
| 357 // downloads can be destroyed along with |browser_| and the observer | 359 // downloads can be destroyed along with |browser_| and the observer |
| 358 // notifications will call back into deleted objects). | 360 // notifications will call back into deleted objects). |
| 359 download_shelf_.reset(); | 361 download_shelf_.reset(); |
| 360 #endif | 362 #endif |
| 361 | 363 |
| 362 // The TabStrip attaches a listener to the model. Make sure we shut down the | 364 // The TabStrip attaches a listener to the model. Make sure we shut down the |
| 363 // TabStrip first so that it can cleanly remove the listener. | 365 // TabStrip first so that it can cleanly remove the listener. |
| 364 if (tabstrip_) { | 366 if (tabstrip_) { |
| (...skipping 708 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1073 if (browser_ != NULL) | 1075 if (browser_ != NULL) |
| 1074 browser_->UpdateDownloadShelfVisibility(visible); | 1076 browser_->UpdateDownloadShelfVisibility(visible); |
| 1075 | 1077 |
| 1076 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out | 1078 // SetDownloadShelfVisible can force-close the shelf, so make sure we lay out |
| 1077 // everything correctly, as if the animation had finished. This doesn't | 1079 // everything correctly, as if the animation had finished. This doesn't |
| 1078 // matter for showing the shelf, as the show animation will do it. | 1080 // matter for showing the shelf, as the show animation will do it. |
| 1079 ToolbarSizeChanged(false); | 1081 ToolbarSizeChanged(false); |
| 1080 } | 1082 } |
| 1081 | 1083 |
| 1082 bool BrowserView::IsDownloadShelfVisible() const { | 1084 bool BrowserView::IsDownloadShelfVisible() const { |
| 1083 #if defined(OS_CHROMEOS) | 1085 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 1084 return false; | 1086 return false; |
| 1085 #else | 1087 #else |
| 1086 return download_shelf_.get() && download_shelf_->IsShowing(); | 1088 return download_shelf_.get() && download_shelf_->IsShowing(); |
| 1087 #endif | 1089 #endif |
| 1088 } | 1090 } |
| 1089 | 1091 |
| 1090 DownloadShelf* BrowserView::GetDownloadShelf() { | 1092 DownloadShelf* BrowserView::GetDownloadShelf() { |
| 1091 #if defined(OS_CHROMEOS) | 1093 #if defined(OS_CHROMEOS) && !defined(USE_AURA) |
| 1092 NOTREACHED(); | 1094 NOTREACHED(); |
| 1093 return NULL; | 1095 return NULL; |
| 1094 #else | 1096 #else |
| 1095 if (!download_shelf_.get()) { | 1097 if (!download_shelf_.get()) { |
| 1096 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); | 1098 download_shelf_.reset(new DownloadShelfView(browser_.get(), this)); |
| 1097 download_shelf_->set_parent_owned(false); | 1099 download_shelf_->set_parent_owned(false); |
| 1098 } | 1100 } |
| 1099 return download_shelf_.get(); | 1101 return download_shelf_.get(); |
| 1100 #endif | 1102 #endif |
| 1101 } | 1103 } |
| (...skipping 614 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1716 void BrowserView::GetAccessiblePanes( | 1718 void BrowserView::GetAccessiblePanes( |
| 1717 std::vector<views::AccessiblePaneView*>* panes) { | 1719 std::vector<views::AccessiblePaneView*>* panes) { |
| 1718 // This should be in the order of pane traversal of the panes using F6. | 1720 // This should be in the order of pane traversal of the panes using F6. |
| 1719 // If one of these is invisible or has no focusable children, it will be | 1721 // If one of these is invisible or has no focusable children, it will be |
| 1720 // automatically skipped. | 1722 // automatically skipped. |
| 1721 panes->push_back(toolbar_); | 1723 panes->push_back(toolbar_); |
| 1722 if (bookmark_bar_view_.get()) | 1724 if (bookmark_bar_view_.get()) |
| 1723 panes->push_back(bookmark_bar_view_.get()); | 1725 panes->push_back(bookmark_bar_view_.get()); |
| 1724 if (infobar_container_) | 1726 if (infobar_container_) |
| 1725 panes->push_back(infobar_container_); | 1727 panes->push_back(infobar_container_); |
| 1726 #if !defined(OS_CHROMEOS) | 1728 #if !defined(OS_CHROMEOS) || defined(USE_AURA) |
| 1727 if (download_shelf_.get()) | 1729 if (download_shelf_.get()) |
| 1728 panes->push_back(download_shelf_.get()); | 1730 panes->push_back(download_shelf_.get()); |
| 1729 #endif | 1731 #endif |
| 1730 } | 1732 } |
| 1731 | 1733 |
| 1732 /////////////////////////////////////////////////////////////////////////////// | 1734 /////////////////////////////////////////////////////////////////////////////// |
| 1733 // BrowserView, views::View overrides: | 1735 // BrowserView, views::View overrides: |
| 1734 | 1736 |
| 1735 std::string BrowserView::GetClassName() const { | 1737 std::string BrowserView::GetClassName() const { |
| 1736 return kViewClassName; | 1738 return kViewClassName; |
| (...skipping 862 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2599 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, | 2601 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, |
| 2600 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, | 2602 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, |
| 2601 bubble_view, bubble_view); | 2603 bubble_view, bubble_view); |
| 2602 } | 2604 } |
| 2603 | 2605 |
| 2604 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2606 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
| 2605 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2607 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
| 2606 if (button) | 2608 if (button) |
| 2607 button->ShowAvatarBubble(); | 2609 button->ShowAvatarBubble(); |
| 2608 } | 2610 } |
| OLD | NEW |