| OLD | NEW |
| 1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2009 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/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #if defined(OS_LINUX) | |
| 8 #include <gtk/gtk.h> | |
| 9 #endif | |
| 10 | |
| 11 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
| 12 #include "app/gfx/canvas.h" | 8 #include "app/gfx/canvas.h" |
| 13 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 14 #include "app/os_exchange_data.h" | 10 #include "app/os_exchange_data.h" |
| 15 #include "app/resource_bundle.h" | 11 #include "app/resource_bundle.h" |
| 16 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 17 #include "base/time.h" | 13 #include "base/time.h" |
| 18 #include "build/build_config.h" | 14 #include "build/build_config.h" |
| 19 #include "chrome/app/chrome_dll_resource.h" | 15 #include "chrome/app/chrome_dll_resource.h" |
| 20 #include "chrome/browser/app_modal_dialog_queue.h" | 16 #include "chrome/browser/app_modal_dialog_queue.h" |
| 21 #include "chrome/browser/bookmarks/bookmark_utils.h" | 17 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 22 #include "chrome/browser/browser.h" | 18 #include "chrome/browser/browser.h" |
| 23 #include "chrome/browser/browser_list.h" | 19 #include "chrome/browser/browser_list.h" |
| 24 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/browser_theme_provider.h" | 21 #include "chrome/browser/browser_theme_provider.h" |
| 26 #include "chrome/browser/debugger/devtools_window.h" | 22 #include "chrome/browser/debugger/devtools_window.h" |
| 27 #include "chrome/browser/download/download_manager.h" | 23 #include "chrome/browser/download/download_manager.h" |
| 28 #include "chrome/browser/find_bar.h" | 24 #include "chrome/browser/find_bar.h" |
| 29 #include "chrome/browser/find_bar_controller.h" | 25 #include "chrome/browser/find_bar_controller.h" |
| 30 #if defined(OS_WIN) | |
| 31 #include "chrome/browser/jumplist.h" | |
| 32 #endif | |
| 33 #include "chrome/browser/page_info_window.h" | 26 #include "chrome/browser/page_info_window.h" |
| 34 #include "chrome/browser/profile.h" | 27 #include "chrome/browser/profile.h" |
| 35 #include "chrome/browser/view_ids.h" | 28 #include "chrome/browser/view_ids.h" |
| 36 #include "chrome/browser/views/bookmark_bar_view.h" | 29 #include "chrome/browser/views/bookmark_bar_view.h" |
| 37 #include "chrome/browser/views/browser_bubble.h" | 30 #include "chrome/browser/views/browser_bubble.h" |
| 38 #include "chrome/browser/views/browser_dialogs.h" | 31 #include "chrome/browser/views/browser_dialogs.h" |
| 39 #include "chrome/browser/views/chrome_views_delegate.h" | 32 #include "chrome/browser/views/chrome_views_delegate.h" |
| 40 #include "chrome/browser/views/download_shelf_view.h" | 33 #include "chrome/browser/views/download_shelf_view.h" |
| 41 #include "chrome/browser/views/extensions/extension_shelf.h" | 34 #include "chrome/browser/views/extensions/extension_shelf.h" |
| 42 #include "chrome/browser/views/frame/browser_frame.h" | 35 #include "chrome/browser/views/frame/browser_frame.h" |
| (...skipping 13 matching lines...) Expand all Loading... |
| 56 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
| 57 #include "chrome/common/native_window_notification_source.h" | 50 #include "chrome/common/native_window_notification_source.h" |
| 58 #include "chrome/common/notification_service.h" | 51 #include "chrome/common/notification_service.h" |
| 59 #include "chrome/common/pref_names.h" | 52 #include "chrome/common/pref_names.h" |
| 60 #include "chrome/common/pref_service.h" | 53 #include "chrome/common/pref_service.h" |
| 61 #include "grit/app_resources.h" | 54 #include "grit/app_resources.h" |
| 62 #include "grit/chromium_strings.h" | 55 #include "grit/chromium_strings.h" |
| 63 #include "grit/generated_resources.h" | 56 #include "grit/generated_resources.h" |
| 64 #include "grit/theme_resources.h" | 57 #include "grit/theme_resources.h" |
| 65 #include "grit/webkit_resources.h" | 58 #include "grit/webkit_resources.h" |
| 66 #if defined(OS_WIN) | |
| 67 #include "views/controls/scrollbar/native_scroll_bar.h" | |
| 68 #endif | |
| 69 #include "views/controls/single_split_view.h" | 59 #include "views/controls/single_split_view.h" |
| 70 #include "views/fill_layout.h" | 60 #include "views/fill_layout.h" |
| 71 #include "views/focus/external_focus_tracker.h" | 61 #include "views/focus/external_focus_tracker.h" |
| 72 #include "views/view.h" | 62 #include "views/view.h" |
| 73 #include "views/widget/root_view.h" | 63 #include "views/widget/root_view.h" |
| 74 #include "views/window/dialog_delegate.h" | 64 #include "views/window/dialog_delegate.h" |
| 75 #if !defined(OS_WIN) | 65 #include "views/window/non_client_view.h" |
| 66 #include "views/window/window.h" |
| 67 |
| 68 #if defined(OS_WIN) |
| 69 #include "chrome/browser/jumplist.h" |
| 70 #include "views/controls/scrollbar/native_scroll_bar.h" |
| 71 #elif defined(OS_LINUX) |
| 72 #include <gtk/gtk.h> |
| 73 |
| 76 #include "views/window/hit_test.h" | 74 #include "views/window/hit_test.h" |
| 77 #endif | 75 #endif |
| 78 #include "views/window/non_client_view.h" | |
| 79 #include "views/window/window.h" | |
| 80 | 76 |
| 81 using base::TimeDelta; | 77 using base::TimeDelta; |
| 82 | 78 |
| 83 // static | 79 // static |
| 84 SkBitmap BrowserView::default_favicon_; | 80 SkBitmap BrowserView::default_favicon_; |
| 85 SkBitmap BrowserView::otr_avatar_; | 81 SkBitmap BrowserView::otr_avatar_; |
| 86 // The vertical overlap between the TabStrip and the Toolbar. | 82 // The vertical overlap between the TabStrip and the Toolbar. |
| 87 static const int kToolbarTabStripVerticalOverlap = 3; | 83 static const int kToolbarTabStripVerticalOverlap = 3; |
| 88 // The visible height of the shadow above the tabs. Clicks in this area are | 84 // The visible height of the shadow above the tabs. Clicks in this area are |
| 89 // treated as clicks to the frame, rather than clicks to the tab. | 85 // treated as clicks to the frame, rather than clicks to the tab. |
| (...skipping 544 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 634 | 630 |
| 635 gfx::NativeWindow BrowserView::GetNativeHandle() { | 631 gfx::NativeWindow BrowserView::GetNativeHandle() { |
| 636 return GetWidget()->GetWindow()->GetNativeWindow(); | 632 return GetWidget()->GetWindow()->GetNativeWindow(); |
| 637 } | 633 } |
| 638 | 634 |
| 639 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { | 635 BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() { |
| 640 return this; | 636 return this; |
| 641 } | 637 } |
| 642 | 638 |
| 643 StatusBubble* BrowserView::GetStatusBubble() { | 639 StatusBubble* BrowserView::GetStatusBubble() { |
| 644 #if defined(OS_WIN) | |
| 645 return status_bubble_.get(); | 640 return status_bubble_.get(); |
| 646 #else | |
| 647 return NULL; | |
| 648 #endif | |
| 649 } | 641 } |
| 650 | 642 |
| 651 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { | 643 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { |
| 652 if (is_animating) { | 644 if (is_animating) { |
| 653 contents_container_->SetFastResize(true); | 645 contents_container_->SetFastResize(true); |
| 654 UpdateUIForContents(browser_->GetSelectedTabContents()); | 646 UpdateUIForContents(browser_->GetSelectedTabContents()); |
| 655 contents_container_->SetFastResize(false); | 647 contents_container_->SetFastResize(false); |
| 656 } else { | 648 } else { |
| 657 UpdateUIForContents(browser_->GetSelectedTabContents()); | 649 UpdateUIForContents(browser_->GetSelectedTabContents()); |
| 658 contents_split_->Layout(); | 650 contents_split_->Layout(); |
| (...skipping 1285 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1944 | 1936 |
| 1945 // static | 1937 // static |
| 1946 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1938 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
| 1947 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1939 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
| 1948 } | 1940 } |
| 1949 | 1941 |
| 1950 // static | 1942 // static |
| 1951 void BrowserList::AllBrowsersClosed() { | 1943 void BrowserList::AllBrowsersClosed() { |
| 1952 views::Window::CloseAllSecondaryWindows(); | 1944 views::Window::CloseAllSecondaryWindows(); |
| 1953 } | 1945 } |
| OLD | NEW |