| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 223 void ToolbarView::Update(TabContents* tab, bool should_restore_state) { | 223 void ToolbarView::Update(TabContents* tab, bool should_restore_state) { |
| 224 if (location_bar_) | 224 if (location_bar_) |
| 225 location_bar_->Update(should_restore_state ? tab : NULL); | 225 location_bar_->Update(should_restore_state ? tab : NULL); |
| 226 | 226 |
| 227 if (browser_actions_) | 227 if (browser_actions_) |
| 228 browser_actions_->RefreshBrowserActionViews(); | 228 browser_actions_->RefreshBrowserActionViews(); |
| 229 } | 229 } |
| 230 | 230 |
| 231 void ToolbarView::SetAppMenuModel(menus::SimpleMenuModel* model) { | 231 void ToolbarView::SetAppMenuModel(menus::SimpleMenuModel* model) { |
| 232 app_menu_model_.reset(model); | 232 app_menu_model_.reset(model); |
| 233 app_menu_menu_.reset(new views::Menu2(app_menu_model_.get())); | 233 if (!WrenchMenuModel::IsEnabled()) |
| 234 app_menu_menu_.reset(new views::Menu2(app_menu_model_.get())); |
| 234 } | 235 } |
| 235 | 236 |
| 236 void ToolbarView::SetToolbarFocusAndFocusLocationBar(int view_storage_id) { | 237 void ToolbarView::SetToolbarFocusAndFocusLocationBar(int view_storage_id) { |
| 237 SetToolbarFocus(view_storage_id, location_bar_); | 238 SetToolbarFocus(view_storage_id, location_bar_); |
| 238 } | 239 } |
| 239 | 240 |
| 240 void ToolbarView::SetToolbarFocusAndFocusPageMenu(int view_storage_id) { | 241 void ToolbarView::SetToolbarFocusAndFocusPageMenu(int view_storage_id) { |
| 241 if (page_menu_) | 242 if (page_menu_) |
| 242 SetToolbarFocus(view_storage_id, page_menu_); | 243 SetToolbarFocus(view_storage_id, page_menu_); |
| 243 else | 244 else |
| (...skipping 575 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 819 } | 820 } |
| 820 #endif | 821 #endif |
| 821 | 822 |
| 822 // Tell the menu button to activate, opening its pop-up menu. | 823 // Tell the menu button to activate, opening its pop-up menu. |
| 823 menu_button->Activate(); | 824 menu_button->Activate(); |
| 824 | 825 |
| 825 #if defined(OS_WIN) | 826 #if defined(OS_WIN) |
| 826 SetToolbarFocus(NULL, menu_button); | 827 SetToolbarFocus(NULL, menu_button); |
| 827 #endif | 828 #endif |
| 828 } | 829 } |
| OLD | NEW |