| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/toolbar_view.h" | 5 #include "chrome/browser/views/toolbar_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/drag_drop_types.h" | 9 #include "app/drag_drop_types.h" |
| 10 #include "app/gfx/chrome_canvas.h" | 10 #include "app/gfx/chrome_canvas.h" |
| 11 #include "app/l10n_util.h" | 11 #include "app/l10n_util.h" |
| 12 #include "app/os_exchange_data.h" | 12 #include "app/os_exchange_data.h" |
| 13 #include "app/resource_bundle.h" | 13 #include "app/resource_bundle.h" |
| 14 #include "base/command_line.h" | 14 #include "base/command_line.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/path_service.h" | 16 #include "base/path_service.h" |
| 17 #include "chrome/app/chrome_dll_resource.h" | 17 #include "chrome/app/chrome_dll_resource.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_model.h" | 18 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 19 #include "chrome/browser/browser.h" | 19 #include "chrome/browser/browser.h" |
| 20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/character_encoding.h" | 21 #include "chrome/browser/character_encoding.h" |
| 22 #include "chrome/browser/drag_utils.h" | |
| 23 #include "chrome/browser/metrics/user_metrics.h" | 22 #include "chrome/browser/metrics/user_metrics.h" |
| 24 #include "chrome/browser/profile.h" | 23 #include "chrome/browser/profile.h" |
| 25 #include "chrome/browser/tab_contents/navigation_controller.h" | 24 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 26 #include "chrome/browser/tab_contents/navigation_entry.h" | 25 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 27 #include "chrome/browser/user_data_manager.h" | 26 #include "chrome/browser/user_data_manager.h" |
| 28 #include "chrome/browser/views/bookmark_menu_button.h" | 27 #include "chrome/browser/views/bookmark_menu_button.h" |
| 29 #include "chrome/browser/views/dom_view.h" | 28 #include "chrome/browser/views/dom_view.h" |
| 30 #include "chrome/browser/views/event_utils.h" | 29 #include "chrome/browser/views/event_utils.h" |
| 31 #include "chrome/browser/views/go_button.h" | 30 #include "chrome/browser/views/go_button.h" |
| 32 #include "chrome/browser/views/location_bar_view.h" | 31 #include "chrome/browser/views/location_bar_view.h" |
| (...skipping 10 matching lines...) Expand all Loading... |
| 43 #include "chrome/personalization/personalization.h" | 42 #include "chrome/personalization/personalization.h" |
| 44 #endif | 43 #endif |
| 45 #include "grit/chromium_strings.h" | 44 #include "grit/chromium_strings.h" |
| 46 #include "grit/generated_resources.h" | 45 #include "grit/generated_resources.h" |
| 47 #include "grit/theme_resources.h" | 46 #include "grit/theme_resources.h" |
| 48 #include "net/base/net_util.h" | 47 #include "net/base/net_util.h" |
| 49 #include "views/background.h" | 48 #include "views/background.h" |
| 50 #include "views/controls/button/button_dropdown.h" | 49 #include "views/controls/button/button_dropdown.h" |
| 51 #include "views/controls/hwnd_view.h" | 50 #include "views/controls/hwnd_view.h" |
| 52 #include "views/controls/label.h" | 51 #include "views/controls/label.h" |
| 52 #include "views/drag_utils.h" |
| 53 #include "views/widget/tooltip_manager.h" | 53 #include "views/widget/tooltip_manager.h" |
| 54 #include "views/window/non_client_view.h" | 54 #include "views/window/non_client_view.h" |
| 55 #include "views/window/window.h" | 55 #include "views/window/window.h" |
| 56 | 56 |
| 57 static const int kControlHorizOffset = 4; | 57 static const int kControlHorizOffset = 4; |
| 58 static const int kControlVertOffset = 6; | 58 static const int kControlVertOffset = 6; |
| 59 static const int kControlIndent = 3; | 59 static const int kControlIndent = 3; |
| 60 static const int kStatusBubbleWidth = 480; | 60 static const int kStatusBubbleWidth = 480; |
| 61 | 61 |
| 62 // Separation between the location bar and the menus. | 62 // Separation between the location bar and the menus. |
| (...skipping 759 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 822 BookmarkNode* node = profile_->GetBookmarkModel()-> | 822 BookmarkNode* node = profile_->GetBookmarkModel()-> |
| 823 GetMostRecentlyAddedNodeForURL(tab_->GetURL()); | 823 GetMostRecentlyAddedNodeForURL(tab_->GetURL()); |
| 824 if (node) { | 824 if (node) { |
| 825 BookmarkDragData bookmark_data(node); | 825 BookmarkDragData bookmark_data(node); |
| 826 bookmark_data.Write(profile_, data); | 826 bookmark_data.Write(profile_, data); |
| 827 } | 827 } |
| 828 } | 828 } |
| 829 | 829 |
| 830 drag_utils::SetURLAndDragImage(tab_->GetURL(), | 830 drag_utils::SetURLAndDragImage(tab_->GetURL(), |
| 831 UTF16ToWideHack(tab_->GetTitle()), | 831 UTF16ToWideHack(tab_->GetTitle()), |
| 832 tab_->GetFavIcon(), data); | 832 tab_->GetFavIcon(), |
| 833 data); |
| 833 } | 834 } |
| 834 | 835 |
| 835 TabContents* BrowserToolbarView::GetTabContents() { | 836 TabContents* BrowserToolbarView::GetTabContents() { |
| 836 return tab_; | 837 return tab_; |
| 837 } | 838 } |
| 838 | 839 |
| 839 void BrowserToolbarView::EnabledStateChangedForCommand(int id, bool enabled) { | 840 void BrowserToolbarView::EnabledStateChangedForCommand(int id, bool enabled) { |
| 840 views::Button* button = NULL; | 841 views::Button* button = NULL; |
| 841 switch (id) { | 842 switch (id) { |
| 842 case IDC_BACK: | 843 case IDC_BACK: |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 916 case IDC_COPY: | 917 case IDC_COPY: |
| 917 *accel = views::Accelerator(L'C', false, true, false); | 918 *accel = views::Accelerator(L'C', false, true, false); |
| 918 return true; | 919 return true; |
| 919 case IDC_PASTE: | 920 case IDC_PASTE: |
| 920 *accel = views::Accelerator(L'V', false, true, false); | 921 *accel = views::Accelerator(L'V', false, true, false); |
| 921 return true; | 922 return true; |
| 922 } | 923 } |
| 923 // Else, we retrieve the accelerator information from the frame. | 924 // Else, we retrieve the accelerator information from the frame. |
| 924 return GetWidget()->GetAccelerator(id, accel); | 925 return GetWidget()->GetAccelerator(id, accel); |
| 925 } | 926 } |
| OLD | NEW |