| 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 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 74 #include "chrome/common/extensions/extension_resource.h" | 74 #include "chrome/common/extensions/extension_resource.h" |
| 75 #include "chrome/common/native_window_notification_source.h" | 75 #include "chrome/common/native_window_notification_source.h" |
| 76 #include "chrome/common/pref_names.h" | 76 #include "chrome/common/pref_names.h" |
| 77 #include "chrome/common/url_constants.h" | 77 #include "chrome/common/url_constants.h" |
| 78 #include "content/browser/download/download_manager.h" | 78 #include "content/browser/download/download_manager.h" |
| 79 #include "content/browser/renderer_host/render_view_host.h" | 79 #include "content/browser/renderer_host/render_view_host.h" |
| 80 #include "content/browser/renderer_host/render_widget_host_view.h" | 80 #include "content/browser/renderer_host/render_widget_host_view.h" |
| 81 #include "content/browser/tab_contents/tab_contents.h" | 81 #include "content/browser/tab_contents/tab_contents.h" |
| 82 #include "content/browser/tab_contents/tab_contents_view.h" | 82 #include "content/browser/tab_contents/tab_contents_view.h" |
| 83 #include "content/browser/user_metrics.h" | 83 #include "content/browser/user_metrics.h" |
| 84 #include "content/common/notification_service.h" | 84 #include "content/public/browser/notification_service.h" |
| 85 #include "content/public/common/content_switches.h" | 85 #include "content/public/common/content_switches.h" |
| 86 #include "grit/chromium_strings.h" | 86 #include "grit/chromium_strings.h" |
| 87 #include "grit/generated_resources.h" | 87 #include "grit/generated_resources.h" |
| 88 #include "grit/locale_settings.h" | 88 #include "grit/locale_settings.h" |
| 89 #include "grit/theme_resources.h" | 89 #include "grit/theme_resources.h" |
| 90 #include "grit/theme_resources_standard.h" | 90 #include "grit/theme_resources_standard.h" |
| 91 #include "grit/ui_resources.h" | 91 #include "grit/ui_resources.h" |
| 92 #include "grit/webkit_resources.h" | 92 #include "grit/webkit_resources.h" |
| 93 #include "ui/base/accessibility/accessible_view_state.h" | 93 #include "ui/base/accessibility/accessible_view_state.h" |
| 94 #include "ui/base/l10n/l10n_util.h" | 94 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1573 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1668 if (!browser_->tabstrip_model()->empty()) { | 1668 if (!browser_->tabstrip_model()->empty()) { |
| 1669 // Tab strip isn't empty. Hide the frame (so it appears to have closed | 1669 // Tab strip isn't empty. Hide the frame (so it appears to have closed |
| 1670 // immediately) and close all the tabs, allowing the renderers to shut | 1670 // immediately) and close all the tabs, allowing the renderers to shut |
| 1671 // down. When the tab strip is empty we'll be called back again. | 1671 // down. When the tab strip is empty we'll be called back again. |
| 1672 frame_->Hide(); | 1672 frame_->Hide(); |
| 1673 browser_->OnWindowClosing(); | 1673 browser_->OnWindowClosing(); |
| 1674 return false; | 1674 return false; |
| 1675 } | 1675 } |
| 1676 | 1676 |
| 1677 // Empty TabStripModel, it's now safe to allow the Window to be closed. | 1677 // Empty TabStripModel, it's now safe to allow the Window to be closed. |
| 1678 NotificationService::current()->Notify( | 1678 content::NotificationService::current()->Notify( |
| 1679 chrome::NOTIFICATION_WINDOW_CLOSED, | 1679 chrome::NOTIFICATION_WINDOW_CLOSED, |
| 1680 content::Source<gfx::NativeWindow>(frame_->GetNativeWindow()), | 1680 content::Source<gfx::NativeWindow>(frame_->GetNativeWindow()), |
| 1681 NotificationService::NoDetails()); | 1681 content::NotificationService::NoDetails()); |
| 1682 return true; | 1682 return true; |
| 1683 } | 1683 } |
| 1684 | 1684 |
| 1685 int BrowserView::NonClientHitTest(const gfx::Point& point) { | 1685 int BrowserView::NonClientHitTest(const gfx::Point& point) { |
| 1686 #if defined(OS_WIN) && !defined(USE_AURA) | 1686 #if defined(OS_WIN) && !defined(USE_AURA) |
| 1687 // The following code is not in the LayoutManager because it's | 1687 // The following code is not in the LayoutManager because it's |
| 1688 // independent of layout and also depends on the ResizeCorner which | 1688 // independent of layout and also depends on the ResizeCorner which |
| 1689 // is private. | 1689 // is private. |
| 1690 if (!frame_->IsMaximized() && !frame_->IsFullscreen()) { | 1690 if (!frame_->IsMaximized() && !frame_->IsFullscreen()) { |
| 1691 CRect client_rect; | 1691 CRect client_rect; |
| (...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2599 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); | 2599 views::View::ConvertPointToScreen(GetTabContentsContainerView(), &origin); |
| 2600 gfx::Rect bounds; | 2600 gfx::Rect bounds; |
| 2601 bounds.set_origin(origin); | 2601 bounds.set_origin(origin); |
| 2602 | 2602 |
| 2603 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); | 2603 AvatarMenuBubbleView* bubble_view = new AvatarMenuBubbleView(browser_.get()); |
| 2604 // Bubble::Show() takes ownership of the view. | 2604 // Bubble::Show() takes ownership of the view. |
| 2605 Bubble::Show(this->GetWidget(), bounds, | 2605 Bubble::Show(this->GetWidget(), bounds, |
| 2606 views::BubbleBorder::TOP_RIGHT, | 2606 views::BubbleBorder::TOP_RIGHT, |
| 2607 bubble_view, bubble_view); | 2607 bubble_view, bubble_view); |
| 2608 } | 2608 } |
| OLD | NEW |