| 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/canvas.h" | 10 #include "app/gfx/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/back_forward_menu_model_views.h" |
| 18 #include "chrome/browser/bookmarks/bookmark_model.h" | 19 #include "chrome/browser/bookmarks/bookmark_model.h" |
| 19 #include "chrome/browser/browser.h" | 20 #include "chrome/browser/browser.h" |
| 20 #include "chrome/browser/browser_process.h" | 21 #include "chrome/browser/browser_process.h" |
| 21 #include "chrome/browser/character_encoding.h" | 22 #include "chrome/browser/character_encoding.h" |
| 22 #include "chrome/browser/metrics/user_metrics.h" | 23 #include "chrome/browser/metrics/user_metrics.h" |
| 23 #include "chrome/browser/profile.h" | 24 #include "chrome/browser/profile.h" |
| 24 #include "chrome/browser/tab_contents/navigation_controller.h" | 25 #include "chrome/browser/tab_contents/navigation_controller.h" |
| 25 #include "chrome/browser/tab_contents/navigation_entry.h" | 26 #include "chrome/browser/tab_contents/navigation_entry.h" |
| 26 #include "chrome/browser/browser_theme_provider.h" | 27 #include "chrome/browser/browser_theme_provider.h" |
| 27 #include "chrome/browser/user_data_manager.h" | 28 #include "chrome/browser/user_data_manager.h" |
| (...skipping 67 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 95 profile_(NULL), | 96 profile_(NULL), |
| 96 browser_(browser), | 97 browser_(browser), |
| 97 tab_(NULL), | 98 tab_(NULL), |
| 98 profiles_menu_(NULL), | 99 profiles_menu_(NULL), |
| 99 profiles_helper_(new GetProfilesHelper(this)) { | 100 profiles_helper_(new GetProfilesHelper(this)) { |
| 100 browser_->command_updater()->AddCommandObserver(IDC_BACK, this); | 101 browser_->command_updater()->AddCommandObserver(IDC_BACK, this); |
| 101 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this); | 102 browser_->command_updater()->AddCommandObserver(IDC_FORWARD, this); |
| 102 browser_->command_updater()->AddCommandObserver(IDC_RELOAD, this); | 103 browser_->command_updater()->AddCommandObserver(IDC_RELOAD, this); |
| 103 browser_->command_updater()->AddCommandObserver(IDC_HOME, this); | 104 browser_->command_updater()->AddCommandObserver(IDC_HOME, this); |
| 104 browser_->command_updater()->AddCommandObserver(IDC_STAR, this); | 105 browser_->command_updater()->AddCommandObserver(IDC_STAR, this); |
| 105 back_menu_model_.reset(new BackForwardMenuModelWin( | 106 back_menu_model_.reset(new BackForwardMenuModelViews( |
| 106 browser, BackForwardMenuModel::BACKWARD_MENU_DELEGATE)); | 107 browser, BackForwardMenuModel::BACKWARD_MENU_DELEGATE)); |
| 107 forward_menu_model_.reset(new BackForwardMenuModelWin( | 108 forward_menu_model_.reset(new BackForwardMenuModelViews( |
| 108 browser, BackForwardMenuModel::FORWARD_MENU_DELEGATE)); | 109 browser, BackForwardMenuModel::FORWARD_MENU_DELEGATE)); |
| 109 if (browser->type() == Browser::TYPE_NORMAL) | 110 if (browser->type() == Browser::TYPE_NORMAL) |
| 110 display_mode_ = DISPLAYMODE_NORMAL; | 111 display_mode_ = DISPLAYMODE_NORMAL; |
| 111 else | 112 else |
| 112 display_mode_ = DISPLAYMODE_LOCATION; | 113 display_mode_ = DISPLAYMODE_LOCATION; |
| 113 | 114 |
| 114 if (!kPopupBackgroundEdge) { | 115 if (!kPopupBackgroundEdge) { |
| 115 kPopupBackgroundEdge = ResourceBundle::GetSharedInstance().GetBitmapNamed( | 116 kPopupBackgroundEdge = ResourceBundle::GetSharedInstance().GetBitmapNamed( |
| 116 IDR_LOCATIONBG_POPUPMODE_EDGE); | 117 IDR_LOCATIONBG_POPUPMODE_EDGE); |
| 117 } | 118 } |
| (...skipping 857 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 975 case IDC_COPY: | 976 case IDC_COPY: |
| 976 *accel = views::Accelerator(L'C', false, true, false); | 977 *accel = views::Accelerator(L'C', false, true, false); |
| 977 return true; | 978 return true; |
| 978 case IDC_PASTE: | 979 case IDC_PASTE: |
| 979 *accel = views::Accelerator(L'V', false, true, false); | 980 *accel = views::Accelerator(L'V', false, true, false); |
| 980 return true; | 981 return true; |
| 981 } | 982 } |
| 982 // Else, we retrieve the accelerator information from the frame. | 983 // Else, we retrieve the accelerator information from the frame. |
| 983 return GetWidget()->GetAccelerator(id, accel); | 984 return GetWidget()->GetAccelerator(id, accel); |
| 984 } | 985 } |
| OLD | NEW |