| 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) | 7 #if defined(OS_LINUX) |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 #endif | 9 #endif |
| 10 | 10 |
| 11 #include "app/drag_drop_types.h" | 11 #include "app/drag_drop_types.h" |
| 12 #include "app/gfx/canvas.h" | 12 #include "app/gfx/canvas.h" |
| 13 #include "app/l10n_util.h" | 13 #include "app/l10n_util.h" |
| 14 #include "app/os_exchange_data.h" | 14 #include "app/os_exchange_data.h" |
| 15 #include "app/resource_bundle.h" | 15 #include "app/resource_bundle.h" |
| 16 #include "base/command_line.h" | 16 #include "base/command_line.h" |
| 17 #include "base/time.h" | 17 #include "base/time.h" |
| 18 #include "build/build_config.h" | 18 #include "build/build_config.h" |
| 19 #include "chrome/app/chrome_dll_resource.h" | 19 #include "chrome/app/chrome_dll_resource.h" |
| 20 #include "chrome/browser/app_modal_dialog_queue.h" | 20 #include "chrome/browser/app_modal_dialog_queue.h" |
| 21 #include "chrome/browser/bookmarks/bookmark_utils.h" | 21 #include "chrome/browser/bookmarks/bookmark_utils.h" |
| 22 #include "chrome/browser/browser.h" | 22 #include "chrome/browser/browser.h" |
| 23 #include "chrome/browser/browser_list.h" | 23 #include "chrome/browser/browser_list.h" |
| 24 #include "chrome/browser/browser_process.h" | 24 #include "chrome/browser/browser_process.h" |
| 25 #include "chrome/browser/browser_theme_provider.h" | 25 #include "chrome/browser/browser_theme_provider.h" |
| 26 #include "chrome/browser/debugger/devtools_window.h" | 26 #include "chrome/browser/debugger/devtools_window.h" |
| 27 #include "chrome/browser/download/download_manager.h" | 27 #include "chrome/browser/download/download_manager.h" |
| 28 #include "chrome/browser/find_bar.h" | 28 #include "chrome/browser/find_bar.h" |
| 29 #include "chrome/browser/find_bar_controller.h" | 29 #include "chrome/browser/find_bar_controller.h" |
| 30 #if defined(OS_WIN) |
| 31 #include "chrome/browser/jumplist.h" |
| 32 #endif |
| 30 #include "chrome/browser/profile.h" | 33 #include "chrome/browser/profile.h" |
| 31 #include "chrome/browser/view_ids.h" | 34 #include "chrome/browser/view_ids.h" |
| 32 #include "chrome/browser/views/bookmark_bar_view.h" | 35 #include "chrome/browser/views/bookmark_bar_view.h" |
| 33 #include "chrome/browser/views/browser_bubble.h" | 36 #include "chrome/browser/views/browser_bubble.h" |
| 34 #include "chrome/browser/views/browser_dialogs.h" | 37 #include "chrome/browser/views/browser_dialogs.h" |
| 35 #include "chrome/browser/views/chrome_views_delegate.h" | 38 #include "chrome/browser/views/chrome_views_delegate.h" |
| 36 #include "chrome/browser/views/download_shelf_view.h" | 39 #include "chrome/browser/views/download_shelf_view.h" |
| 37 #include "chrome/browser/views/extensions/extension_shelf.h" | 40 #include "chrome/browser/views/extensions/extension_shelf.h" |
| 38 #include "chrome/browser/views/frame/browser_frame.h" | 41 #include "chrome/browser/views/frame/browser_frame.h" |
| 39 #include "chrome/browser/views/fullscreen_exit_bubble.h" | 42 #include "chrome/browser/views/fullscreen_exit_bubble.h" |
| (...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1468 AddChildView(contents_split_); | 1471 AddChildView(contents_split_); |
| 1469 set_contents_view(contents_split_); | 1472 set_contents_view(contents_split_); |
| 1470 | 1473 |
| 1471 status_bubble_.reset(new StatusBubbleViews(GetWidget())); | 1474 status_bubble_.reset(new StatusBubbleViews(GetWidget())); |
| 1472 | 1475 |
| 1473 extension_shelf_ = new ExtensionShelf(browser_.get()); | 1476 extension_shelf_ = new ExtensionShelf(browser_.get()); |
| 1474 AddChildView(extension_shelf_); | 1477 AddChildView(extension_shelf_); |
| 1475 | 1478 |
| 1476 #if defined(OS_WIN) | 1479 #if defined(OS_WIN) |
| 1477 InitSystemMenu(); | 1480 InitSystemMenu(); |
| 1481 |
| 1482 // Create a custom JumpList and add it to an observer of TabRestoreService |
| 1483 // so we can update the custom JumpList when a tab is added or removed. |
| 1484 if (JumpList::Enabled()) { |
| 1485 jumplist_.reset(new JumpList); |
| 1486 jumplist_->AddObserver(browser_->profile()); |
| 1487 } |
| 1478 #endif | 1488 #endif |
| 1479 } | 1489 } |
| 1480 | 1490 |
| 1481 #if defined(OS_WIN) | 1491 #if defined(OS_WIN) |
| 1482 void BrowserView::InitSystemMenu() { | 1492 void BrowserView::InitSystemMenu() { |
| 1483 system_menu_contents_.reset(new views::SystemMenuModel(this)); | 1493 system_menu_contents_.reset(new views::SystemMenuModel(this)); |
| 1484 // We add the menu items in reverse order so that insertion_index never needs | 1494 // We add the menu items in reverse order so that insertion_index never needs |
| 1485 // to change. | 1495 // to change. |
| 1486 if (IsBrowserTypeNormal()) | 1496 if (IsBrowserTypeNormal()) |
| 1487 BuildSystemMenuForBrowserWindow(); | 1497 BuildSystemMenuForBrowserWindow(); |
| (...skipping 417 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1905 | 1915 |
| 1906 // static | 1916 // static |
| 1907 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1917 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
| 1908 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1918 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
| 1909 } | 1919 } |
| 1910 | 1920 |
| 1911 // static | 1921 // static |
| 1912 void BrowserList::AllBrowsersClosed() { | 1922 void BrowserList::AllBrowsersClosed() { |
| 1913 views::Window::CloseAllSecondaryWindows(); | 1923 views::Window::CloseAllSecondaryWindows(); |
| 1914 } | 1924 } |
| OLD | NEW |