Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(350)

Side by Side Diff: chrome/browser/ui/toolbar/wrench_menu_model.cc

Issue 8949061: Move a bunch of methods from TabContents into the WebContents interface. This change either moves... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/ui/toolbar/wrench_menu_model.h" 5 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 } 95 }
96 } 96 }
97 } 97 }
98 98
99 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const { 99 bool EncodingMenuModel::IsCommandIdChecked(int command_id) const {
100 TabContents* current_tab = browser_->GetSelectedTabContents(); 100 TabContents* current_tab = browser_->GetSelectedTabContents();
101 if (!current_tab) 101 if (!current_tab)
102 return false; 102 return false;
103 EncodingMenuController controller; 103 EncodingMenuController controller;
104 return controller.IsItemChecked(browser_->profile(), 104 return controller.IsItemChecked(browser_->profile(),
105 current_tab->encoding(), command_id); 105 current_tab->GetEncoding(), command_id);
106 } 106 }
107 107
108 bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const { 108 bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const {
109 bool enabled = browser_->command_updater()->IsCommandEnabled(command_id); 109 bool enabled = browser_->command_updater()->IsCommandEnabled(command_id);
110 // Special handling for the contents of the Encoding submenu. On Mac OS, 110 // Special handling for the contents of the Encoding submenu. On Mac OS,
111 // instead of enabling/disabling the top-level menu item, the submenu's 111 // instead of enabling/disabling the top-level menu item, the submenu's
112 // contents get disabled, per Apple's HIG. 112 // contents get disabled, per Apple's HIG.
113 #if defined(OS_MACOSX) 113 #if defined(OS_MACOSX)
114 enabled &= browser_->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU); 114 enabled &= browser_->command_updater()->IsCommandEnabled(IDC_ENCODING_MENU);
115 #endif 115 #endif
(...skipping 478 matching lines...) Expand 10 before | Expand all | Expand 10 after
594 &enable_increment, &enable_decrement); 594 &enable_increment, &enable_decrement);
595 } 595 }
596 zoom_label_ = l10n_util::GetStringFUTF16( 596 zoom_label_ = l10n_util::GetStringFUTF16(
597 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent)); 597 IDS_ZOOM_PERCENT, base::IntToString16(zoom_percent));
598 } 598 }
599 599
600 string16 WrenchMenuModel::GetSyncMenuLabel() const { 600 string16 WrenchMenuModel::GetSyncMenuLabel() const {
601 return sync_ui_util::GetSyncMenuLabel( 601 return sync_ui_util::GetSyncMenuLabel(
602 browser_->profile()->GetOriginalProfile()->GetProfileSyncService()); 602 browser_->profile()->GetOriginalProfile()->GetProfileSyncService());
603 } 603 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/tab_contents/core_tab_helper.cc ('k') | chrome/browser/ui/views/aura/app_list_window.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698