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 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
102 #include "views/focus/view_storage.h" | 102 #include "views/focus/view_storage.h" |
103 #include "views/layout/grid_layout.h" | 103 #include "views/layout/grid_layout.h" |
104 #include "views/widget/native_widget.h" | 104 #include "views/widget/native_widget.h" |
105 #include "views/widget/root_view.h" | 105 #include "views/widget/root_view.h" |
106 #include "views/widget/widget.h" | 106 #include "views/widget/widget.h" |
107 | 107 |
108 #if defined(USE_AURA) | 108 #if defined(USE_AURA) |
109 #include "chrome/browser/ui/views/accelerator_table.h" | 109 #include "chrome/browser/ui/views/accelerator_table.h" |
110 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" | 110 #include "chrome/browser/ui/views/aura/chrome_shell_delegate.h" |
111 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" | 111 #include "chrome/browser/ui/views/aura/launcher_icon_updater.h" |
112 #include "ui/aura/desktop.h" | |
112 #include "ui/aura_shell/launcher/launcher.h" | 113 #include "ui/aura_shell/launcher/launcher.h" |
113 #include "ui/aura_shell/launcher/launcher_model.h" | 114 #include "ui/aura_shell/launcher/launcher_model.h" |
114 #include "ui/aura_shell/shell.h" | 115 #include "ui/aura_shell/shell.h" |
115 #elif defined(OS_WIN) | 116 #elif defined(OS_WIN) |
116 #include "chrome/browser/aeropeek_manager.h" | 117 #include "chrome/browser/aeropeek_manager.h" |
117 #include "chrome/browser/jumplist_win.h" | 118 #include "chrome/browser/jumplist_win.h" |
118 #include "ui/base/message_box_win.h" | 119 #include "ui/base/message_box_win.h" |
119 #include "views/widget/native_widget_win.h" | 120 #include "views/widget/native_widget_win.h" |
120 #elif defined(TOOLKIT_USES_GTK) | 121 #elif defined(TOOLKIT_USES_GTK) |
121 #include "chrome/browser/ui/views/accelerator_table.h" | 122 #include "chrome/browser/ui/views/accelerator_table.h" |
(...skipping 1163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1285 delete preview_container_; | 1286 delete preview_container_; |
1286 preview_container_ = NULL; | 1287 preview_container_ = NULL; |
1287 } | 1288 } |
1288 | 1289 |
1289 gfx::Rect BrowserView::GetInstantBounds() { | 1290 gfx::Rect BrowserView::GetInstantBounds() { |
1290 return contents_->GetPreviewBounds(); | 1291 return contents_->GetPreviewBounds(); |
1291 } | 1292 } |
1292 | 1293 |
1293 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( | 1294 WindowOpenDisposition BrowserView::GetDispositionForPopupBounds( |
1294 const gfx::Rect& bounds) { | 1295 const gfx::Rect& bounds) { |
1296 #if defined(USE_AURA) && defined(OS_CHROMEOS) | |
1297 // If a popup is larger than a given fraction of the screen, turn it into | |
1298 // a foreground tab. Also check for width or height == 0, which would | |
1299 // indicate a tab sized popup window. | |
1300 gfx::Size size = aura::Desktop::GetInstance()->GetHostSize(); | |
sky
2011/11/18 20:21:05
Use screen instead.
Where was the code for this ha
sadrul
2011/11/18 20:29:25
Done. (chrome/browser/chromeos/frame/browser_view.
| |
1301 if (bounds.width() > size.width() || | |
1302 bounds.width() == 0 || | |
1303 bounds.height() > size.height() || | |
1304 bounds.height() == 0) { | |
1305 return NEW_FOREGROUND_TAB; | |
1306 } | |
1307 #endif | |
1295 return NEW_POPUP; | 1308 return NEW_POPUP; |
1296 } | 1309 } |
1297 | 1310 |
1298 FindBar* BrowserView::CreateFindBar() { | 1311 FindBar* BrowserView::CreateFindBar() { |
1299 return browser::CreateFindBar(this); | 1312 return browser::CreateFindBar(this); |
1300 } | 1313 } |
1301 | 1314 |
1302 #if defined(OS_CHROMEOS) | 1315 #if defined(OS_CHROMEOS) |
1303 void BrowserView::ShowMobileSetup() { | 1316 void BrowserView::ShowMobileSetup() { |
1304 MobileSetupDialog::Show(); | 1317 MobileSetupDialog::Show(); |
(...skipping 1299 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
2604 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, | 2617 Bubble::Show(this->GetWidget(), bounds, views::BubbleBorder::TOP_RIGHT, |
2605 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, | 2618 views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE, |
2606 bubble_view, bubble_view); | 2619 bubble_view, bubble_view); |
2607 } | 2620 } |
2608 | 2621 |
2609 void BrowserView::ShowAvatarBubbleFromAvatarButton() { | 2622 void BrowserView::ShowAvatarBubbleFromAvatarButton() { |
2610 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); | 2623 AvatarMenuButton* button = frame_->GetAvatarMenuButton(); |
2611 if (button) | 2624 if (button) |
2612 button->ShowAvatarBubble(); | 2625 button->ShowAvatarBubble(); |
2613 } | 2626 } |
OLD | NEW |