diff options
-rw-r--r-- | chrome/app/chrome_dll_resource.h | 9 | ||||
-rw-r--r-- | chrome/app/generated_resources.grd | 3 | ||||
-rw-r--r-- | chrome/app/theme/frozen_plugin.png | bin | 571 -> 0 bytes | |||
-rw-r--r-- | chrome/app/theme/theme_resources.h | 103 | ||||
-rw-r--r-- | chrome/app/theme/theme_resources.rc | 1 | ||||
-rw-r--r-- | chrome/browser/browser.cc | 65 | ||||
-rw-r--r-- | chrome/browser/browser.h | 4 | ||||
-rw-r--r-- | chrome/browser/render_view_context_menu.cc | 4 | ||||
-rw-r--r-- | chrome/browser/render_view_context_menu_controller.cc | 5 | ||||
-rw-r--r-- | chrome/browser/views/options/languages_page_view.cc | 8 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.cc | 36 | ||||
-rw-r--r-- | chrome/browser/views/toolbar_view.h | 1 |
12 files changed, 80 insertions, 159 deletions
diff --git a/chrome/app/chrome_dll_resource.h b/chrome/app/chrome_dll_resource.h index d040e6d..edc7539 100644 --- a/chrome/app/chrome_dll_resource.h +++ b/chrome/app/chrome_dll_resource.h @@ -7,7 +7,6 @@ // Values around 300 are used by common/common_resources.h // Values around 400 are used by common/net/net_resources.h // Values around 500 are used by renderer/renderer_resources.h -#define IDB_SADTABBROWSER 1000 // Values around 1600 are used by installer/setup/build/ // Values around 2000 are used by webkit/glue/webkit_resources.h #define IDD_IPC_SETTINGS 3000 @@ -62,9 +61,7 @@ #define IDC_SELECT_TAB_7 32799 #define IDC_SELECT_LAST_TAB 32800 #define IDC_CREATE_SHORTCUTS 32801 -#define IDC_SHOWALLTABS_NEXT 32802 -#define IDC_SHOWALLTABS_PREV 32803 -#define IDC_SHOWALLTABS 32804 +// Free space 32802 - 32804 #define IDC_EDIT_SEARCH_ENGINES 32805 #define IDC_ZOOM_PLUS 32806 #define IDC_ZOOM_MINUS 32807 @@ -79,13 +76,13 @@ #define IDC_DUPLICATE_TAB 32817 #define IDC_NEW_INCOGNITO_WINDOW 32818 #define IDC_VIEW_PASSWORDS 32819 -#define IDC_SHOW_APPLICATIONS 32820 +// Free space 32820 #define IDC_SHOW_DOWNLOADS 32821 #define IDC_HOME 32822 #define IDC_SHOW_HISTORY 32823 #define IDC_FOCUS_TOOLBAR 32825 #define IDC_CLEAR_BROWSING_DATA 32826 -#define IDC_CLOSE_WEB_APP 32827 +// Free space 32827 #define IDC_APPMENU 32828 #define IDC_ABOUT 32829 #define IDC_IMPORT_SETTINGS 32830 diff --git a/chrome/app/generated_resources.grd b/chrome/app/generated_resources.grd index 24d568d..d4d22a6 100644 --- a/chrome/app/generated_resources.grd +++ b/chrome/app/generated_resources.grd @@ -509,9 +509,6 @@ each locale. --> <message name="IDS_VIEW_SOURCE" desc="The text label of the View Page Source menu item" > View s&ource </message> - <message name="IDS_VIEWPAGEINFO" desc="The text label of the View Page Info menu item" > - Page &info - </message> <message name="IDS_DEBUGGER" desc="The text label of the JavaScript debugger menu item"> Debug JavaScript </message> diff --git a/chrome/app/theme/frozen_plugin.png b/chrome/app/theme/frozen_plugin.png Binary files differdeleted file mode 100644 index 5b50247..0000000 --- a/chrome/app/theme/frozen_plugin.png +++ /dev/null diff --git a/chrome/app/theme/theme_resources.h b/chrome/app/theme/theme_resources.h index 01e0cc6..05f9f06 100644 --- a/chrome/app/theme/theme_resources.h +++ b/chrome/app/theme/theme_resources.h @@ -3,7 +3,7 @@ // NOTE: If you change an id you can use the following awk script to // regenerate this file with no holes in the ids: -// awk '$1 != "#define"{print$0} $1 == "#define" {row++;printf "#define %-48s %d\n", $2, (row+9000)}' < theme_resources.h +// awk '$1 != "#define"{print$0} $1 == "#define" {row++;printf "#define %-48s %d\n", $2, (row+8999)}' < theme_resources.h #define IDR_BACK 9000 #define IDR_BACK_D 9001 @@ -267,54 +267,53 @@ #define IDR_WIZARD_ICON 9259 #define IDR_MENU_MARKER 9260 #define IDR_FROZEN_TAB_ICON 9261 -#define IDR_FROZEN_PLUGIN_ICON 9262 -#define IDR_UPDATE_AVAILABLE 9263 -#define IDR_MENU_PAGE 9264 -#define IDR_MENU_CHROME 9265 -#define IDR_ABOUT_BACKGROUND_RTL 9266 -#define IDR_WIZARD_ICON_RTL 9267 -#define IDR_LOCATIONBG_POPUPMODE_LEFT 9268 -#define IDR_LOCATIONBG_POPUPMODE_CENTER 9269 -#define IDR_LOCATIONBG_POPUPMODE_RIGHT 9270 -#define IDR_CLOSE_SA 9271 -#define IDR_CLOSE_SA_H 9272 -#define IDR_CLOSE_SA_P 9273 -#define IDR_HISTORY_SECTION 9274 -#define IDR_DOWNLOADS_SECTION 9275 -#define IDR_DEFAULT_THUMBNAIL 9276 -#define IDR_THROBBER_WAITING 9277 -#define IDR_INFOBAR_PLUGIN_CRASHED 9278 -#define IDR_UPDATE_UPTODATE 9279 -#define IDR_UPDATE_FAIL 9280 -#define IDR_CLOSE_BAR 9281 -#define IDR_CLOSE_BAR_H 9282 -#define IDR_CLOSE_BAR_P 9283 -#define IDR_HOME 9284 -#define IDR_HOME_H 9285 -#define IDR_HOME_P 9286 -#define IDR_FIND_BOX_BACKGROUND_LEFT_RTL 9287 -#define IDR_INPUT_GOOD 9288 -#define IDR_INPUT_ALERT 9289 -#define IDR_HISTORY_FAVICON 9290 -#define IDR_DOWNLOADS_FAVICON 9291 -#define IDR_MENU_PAGE_RTL 9292 -#define IDR_MENU_CHROME_RTL 9293 -#define IDR_DOWNLOAD_ANIMATION_BEGIN 9294 -#define IDR_TAB_HOVER_LEFT 9295 -#define IDR_TAB_HOVER_CENTER 9296 -#define IDR_TAB_HOVER_RIGHT 9297 -#define IDR_FOLDER_CLOSED_RTL 9298 -#define IDR_FOLDER_OPEN_RTL 9299 -#define IDR_BOOKMARK_BAR_FOLDER 9300 -#define IDR_FIND_DLG_LEFT_BB_BACKGROUND 9301 -#define IDR_FIND_DLG_RIGHT_BB_BACKGROUND 9302 -#define IDR_FIND_DLG_MIDDLE_BB_BACKGROUND 9303 -#define IDR_THROBBER_LIGHT 9304 -#define IDR_OTR_ICON_STANDALONE 9305 -#define IDR_PRODUCT_LOGO 9306 -#define IDR_DISTRIBUTOR_LOGO 9307 -#define IDR_DISTRIBUTOR_LOGO_LIGHT 9308 -#define IDR_BOOKMARK_MANAGER_RECENT_ICON 9309 -#define IDR_BOOKMARK_MANAGER_SEARCH_ICON 9310 -#define IDR_MENU_DROPARROW 9311 -#define IDR_ABOUT_BACKGROUND_COLOR 9312 +#define IDR_UPDATE_AVAILABLE 9262 +#define IDR_MENU_PAGE 9263 +#define IDR_MENU_CHROME 9264 +#define IDR_ABOUT_BACKGROUND_RTL 9265 +#define IDR_WIZARD_ICON_RTL 9266 +#define IDR_LOCATIONBG_POPUPMODE_LEFT 9267 +#define IDR_LOCATIONBG_POPUPMODE_CENTER 9268 +#define IDR_LOCATIONBG_POPUPMODE_RIGHT 9269 +#define IDR_CLOSE_SA 9270 +#define IDR_CLOSE_SA_H 9271 +#define IDR_CLOSE_SA_P 9272 +#define IDR_HISTORY_SECTION 9273 +#define IDR_DOWNLOADS_SECTION 9274 +#define IDR_DEFAULT_THUMBNAIL 9275 +#define IDR_THROBBER_WAITING 9276 +#define IDR_INFOBAR_PLUGIN_CRASHED 9277 +#define IDR_UPDATE_UPTODATE 9278 +#define IDR_UPDATE_FAIL 9279 +#define IDR_CLOSE_BAR 9280 +#define IDR_CLOSE_BAR_H 9281 +#define IDR_CLOSE_BAR_P 9282 +#define IDR_HOME 9283 +#define IDR_HOME_H 9284 +#define IDR_HOME_P 9285 +#define IDR_FIND_BOX_BACKGROUND_LEFT_RTL 9286 +#define IDR_INPUT_GOOD 9287 +#define IDR_INPUT_ALERT 9288 +#define IDR_HISTORY_FAVICON 9289 +#define IDR_DOWNLOADS_FAVICON 9290 +#define IDR_MENU_PAGE_RTL 9291 +#define IDR_MENU_CHROME_RTL 9292 +#define IDR_DOWNLOAD_ANIMATION_BEGIN 9293 +#define IDR_TAB_HOVER_LEFT 9294 +#define IDR_TAB_HOVER_CENTER 9295 +#define IDR_TAB_HOVER_RIGHT 9296 +#define IDR_FOLDER_CLOSED_RTL 9297 +#define IDR_FOLDER_OPEN_RTL 9298 +#define IDR_BOOKMARK_BAR_FOLDER 9299 +#define IDR_FIND_DLG_LEFT_BB_BACKGROUND 9300 +#define IDR_FIND_DLG_RIGHT_BB_BACKGROUND 9301 +#define IDR_FIND_DLG_MIDDLE_BB_BACKGROUND 9302 +#define IDR_THROBBER_LIGHT 9303 +#define IDR_OTR_ICON_STANDALONE 9304 +#define IDR_PRODUCT_LOGO 9305 +#define IDR_DISTRIBUTOR_LOGO 9306 +#define IDR_DISTRIBUTOR_LOGO_LIGHT 9307 +#define IDR_BOOKMARK_MANAGER_RECENT_ICON 9308 +#define IDR_BOOKMARK_MANAGER_SEARCH_ICON 9309 +#define IDR_MENU_DROPARROW 9310 +#define IDR_ABOUT_BACKGROUND_COLOR 9311 diff --git a/chrome/app/theme/theme_resources.rc b/chrome/app/theme/theme_resources.rc index ab835ee..572b5da 100644 --- a/chrome/app/theme/theme_resources.rc +++ b/chrome/app/theme/theme_resources.rc @@ -262,7 +262,6 @@ IDR_INFO_BUBBLE_CORNER_BOTTOM_LEFT BINDATA "bubble_corner_bl.png" IDR_INFO_BUBBLE_CORNER_BOTTOM_RIGHT BINDATA "bubble_corner_br.png" IDR_MENU_MARKER BINDATA "menu_marker.png" IDR_FROZEN_TAB_ICON BINDATA "frozen_tab.png" -IDR_FROZEN_PLUGIN_ICON BINDATA "frozen_plugin.png" IDR_UPDATE_AVAILABLE BINDATA "update_available.png" IDR_MENU_PAGE BINDATA "menu_page.png" IDR_MENU_CHROME BINDATA "menu_chrome.png" diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 1b3968d..41d59a9 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -298,19 +298,20 @@ bool Browser::SupportsCommand(int id) const { bool Browser::IsCommandEnabled(int id) const { // No commands are enabled if there is not yet any selected tab. + // TODO(pkasting): It seems like we should not need this, because either + // most/all commands should not have been enabled yet anyway or the ones that + // are enabled should be global, or safe themselves against having no selected + // tab. However, Ben says he tried removing this before and got lots of + // crashes, e.g. from Windows sending WM_COMMANDs at random times during + // window construction. This probably could use closer examination someday. if (!GetSelectedTabContents()) return false; - switch (id) { - case IDC_BACK: - return GetSelectedTabContents()->controller()->CanGoBack(); - case IDC_FORWARD: - return GetSelectedTabContents()->controller()->CanGoForward(); - case IDC_STOP: - return IsCurrentPageLoading(); - default: - break; - } + // TODO(pkasting): Should maybe enable/disable this in + // NavigationStateChanged()? + if (id == IDC_STOP) + return IsCurrentPageLoading(); + return controller_.IsCommandEnabled(id); } @@ -631,8 +632,6 @@ void Browser::OpenCurrentURL() { if (lbv) { OpenURL(GURL(lbv->location_input()), GURL(), lbv->disposition(), lbv->transition()); - } else { - OpenURL(GURL(), GURL(), CURRENT_TAB, PageTransition::TYPED); } } @@ -652,11 +651,6 @@ void Browser::CloseTab() { tabstrip_model_.CloseTabContentsAt(tabstrip_model_.selected_index()); } -void Browser::CloseApp() { - UserMetrics::RecordAction(L"CloseWebApp", profile_); - tabstrip_model_.CloseTabContentsAt(tabstrip_model_.selected_index()); -} - void Browser::NewWindow() { UserMetrics::RecordAction(L"NewWindow", profile_); Browser::OpenEmptyWindow(profile_->GetOriginalProfile()); @@ -672,11 +666,6 @@ void Browser::OpenNewProfileDialog() { NewProfileDialog::RunDialog(); } -void Browser::NewProfileWindowByName(const std::wstring& profile) { - UserMetrics::RecordAction(L"NewProfileWindowByName", profile_); - UserDataManager::Get()->LaunchChromeForProfile(profile); -} - void Browser::NewProfileWindowByIndex(int index) { UserMetrics::RecordAction(L"NewProfileWindowByIndex", profile_); UserDataManager::Get()->LaunchChromeForProfile(index); @@ -1113,7 +1102,6 @@ void Browser::ExecuteCommand(int id) { case IDC_NEW_TAB: NewTab(); break; case IDC_CLOSE_TAB: CloseTab(); break; - case IDC_CLOSE_WEB_APP: CloseApp(); break; case IDC_NEW_WINDOW: NewWindow(); break; case IDC_NEW_INCOGNITO_WINDOW: NewIncognitoWindow(); break; case IDC_CLOSE_WINDOW: CloseWindow(); break; @@ -1211,7 +1199,6 @@ void Browser::ExecuteCommand(int id) { case IDC_SHOW_DOWNLOADS: ShowDownloadsTab(); break; case IDC_SHOW_BOOKMARK_MANAGER: OpenBookmarkManager(); break; case IDC_SHOW_BOOKMARK_BAR: ToggleBookmarkBar(); break; - case IDC_PROFILE_MENU: case IDC_SELECT_PROFILE: OpenSelectProfileDialog(); break; case IDC_NEW_PROFILE: OpenNewProfileDialog(); break; @@ -1424,12 +1411,9 @@ void Browser::TabSelectedAt(TabContents* old_contents, UpdateToolbar(true); // Force the go/stop button to change. - if (new_contents->AsWebContents()) { - GetGoButton()->ChangeMode( - new_contents->is_loading() ? GoButton::MODE_STOP : GoButton::MODE_GO); - } else { - GetGoButton()->ChangeMode(GoButton::MODE_GO); - } + GetGoButton()->ChangeMode( + (new_contents->AsWebContents() && new_contents->is_loading()) ? + GoButton::MODE_STOP : GoButton::MODE_GO); // Update other parts of the toolbar. UpdateNavigationCommands(); @@ -1879,7 +1863,6 @@ void Browser::InitCommandState() { // (like Back & Forward with initial page load) must have their state // initialized here, otherwise they will be forever disabled. - controller_.UpdateCommandEnabled(IDC_STOP, true); controller_.UpdateCommandEnabled(IDC_RELOAD, true); controller_.UpdateCommandEnabled(IDC_HOME, type() == TYPE_NORMAL); controller_.UpdateCommandEnabled(IDC_GO, true); @@ -1890,19 +1873,11 @@ void Browser::InitCommandState() { controller_.UpdateCommandEnabled(IDC_FOCUS_LOCATION, true); controller_.UpdateCommandEnabled(IDC_FOCUS_SEARCH, true); controller_.UpdateCommandEnabled(IDC_FOCUS_TOOLBAR, true); - controller_.UpdateCommandEnabled(IDC_STAR, true); controller_.UpdateCommandEnabled(IDC_OPEN_CURRENT_URL, true); - controller_.UpdateCommandEnabled(IDC_SHOWALLTABS_NEXT, true); - controller_.UpdateCommandEnabled(IDC_SHOWALLTABS_PREV, true); - controller_.UpdateCommandEnabled(IDC_SHOWALLTABS, true); controller_.UpdateCommandEnabled(IDC_CUT, true); controller_.UpdateCommandEnabled(IDC_COPY, true); controller_.UpdateCommandEnabled(IDC_PASTE, true); - controller_.UpdateCommandEnabled(IDC_FIND, true); - controller_.UpdateCommandEnabled(IDC_FIND_NEXT, true); - controller_.UpdateCommandEnabled(IDC_FIND_PREVIOUS, true); controller_.UpdateCommandEnabled(IDC_REPORT_BUG, true); - controller_.UpdateCommandEnabled(IDC_JS_CONSOLE, true); controller_.UpdateCommandEnabled(IDC_SELECT_NEXT_TAB, true); controller_.UpdateCommandEnabled(IDC_SELECT_PREVIOUS_TAB, true); controller_.UpdateCommandEnabled(IDC_SELECT_TAB_0, true); @@ -1914,16 +1889,11 @@ void Browser::InitCommandState() { controller_.UpdateCommandEnabled(IDC_SELECT_TAB_6, true); controller_.UpdateCommandEnabled(IDC_SELECT_TAB_7, true); controller_.UpdateCommandEnabled(IDC_SELECT_LAST_TAB, true); - controller_.UpdateCommandEnabled(IDC_VIEW_SOURCE, true); controller_.UpdateCommandEnabled(IDC_CREATE_SHORTCUTS, false); controller_.UpdateCommandEnabled(IDC_EDIT_SEARCH_ENGINES, true); - controller_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); - controller_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); - controller_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); controller_.UpdateCommandEnabled(IDC_OPEN_FILE, true); controller_.UpdateCommandEnabled(IDC_TASK_MANAGER, true); controller_.UpdateCommandEnabled(IDC_CLOSE_POPUPS, true); - controller_.UpdateCommandEnabled(IDC_PRINT, true); controller_.UpdateCommandEnabled(IDC_COPY_URL, true); controller_.UpdateCommandEnabled(IDC_DUPLICATE_TAB, true); controller_.UpdateCommandEnabled(IDC_NEW_INCOGNITO_WINDOW, true); @@ -1935,7 +1905,6 @@ void Browser::InitCommandState() { controller_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_BAR, true); controller_.UpdateCommandEnabled(IDC_SHOW_BOOKMARK_MANAGER, true); controller_.UpdateCommandEnabled(IDC_SHOW_DOWNLOADS, true); - controller_.UpdateCommandEnabled(IDC_ENCODING_MENU, true); controller_.UpdateCommandEnabled(IDC_ENCODING_AUTO_DETECT, true); controller_.UpdateCommandEnabled(IDC_ENCODING_UTF8, true); controller_.UpdateCommandEnabled(IDC_ENCODING_UTF16LE, true); @@ -1974,7 +1943,6 @@ void Browser::InitCommandState() { controller_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1255, true); controller_.UpdateCommandEnabled(IDC_ENCODING_WINDOWS1258, true); controller_.UpdateCommandEnabled(IDC_OPTIONS, true); - controller_.UpdateCommandEnabled(IDC_CLOSE_WEB_APP, type() != TYPE_NORMAL); controller_.UpdateCommandEnabled(IDC_SHOW_AS_TAB, type() == TYPE_POPUP); controller_.UpdateCommandEnabled( IDC_RESTORE_TAB, (!profile_->IsOffTheRecord() && @@ -1999,7 +1967,6 @@ void Browser::UpdateNavigationCommands() { controller_.UpdateCommandEnabled(IDC_FORWARD, nc->CanGoForward()); WebContents* web_contents = current_tab->AsWebContents(); - if (web_contents) { controller_.UpdateCommandEnabled(IDC_STAR, true); SetStarredButtonToggled(web_contents->is_starred()); @@ -2024,8 +1991,6 @@ void Browser::UpdateNavigationCommands() { controller_.UpdateCommandEnabled(IDC_ZOOM_PLUS, true); controller_.UpdateCommandEnabled(IDC_ZOOM_MINUS, true); controller_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, true); - controller_.UpdateCommandEnabled(IDC_STOP, true); - controller_.UpdateCommandEnabled(IDC_JS_CONSOLE, true); controller_.UpdateCommandEnabled(IDC_PRINT, true); } else { controller_.UpdateCommandEnabled(IDC_VIEW_SOURCE, false); @@ -2044,8 +2009,6 @@ void Browser::UpdateNavigationCommands() { controller_.UpdateCommandEnabled(IDC_ZOOM_PLUS, false); controller_.UpdateCommandEnabled(IDC_ZOOM_MINUS, false); controller_.UpdateCommandEnabled(IDC_ZOOM_NORMAL, false); - controller_.UpdateCommandEnabled(IDC_STOP, false); - controller_.UpdateCommandEnabled(IDC_JS_CONSOLE, false); controller_.UpdateCommandEnabled(IDC_PRINT, false); } diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 648a04a..97ccd16 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -227,11 +227,7 @@ class Browser : public TabStripModelDelegate, // Window management commands void NewTab(); void CloseTab(); - void CloseApp(); void NewWindow(); - // Commands to create a new window in a specific profile. - void NewProfileWindowByName(const std::wstring& profile); - // The index starts with 0, and specifies the index in the profiles vector. void NewProfileWindowByIndex(int index); void NewIncognitoWindow(); void CloseWindow(); diff --git a/chrome/browser/render_view_context_menu.cc b/chrome/browser/render_view_context_menu.cc index 5806eb8..8a073a2 100644 --- a/chrome/browser/render_view_context_menu.cc +++ b/chrome/browser/render_view_context_menu.cc @@ -152,8 +152,8 @@ void RenderViewContextMenu::AppendEditableItems() { // Add Spell Check languages to sub menu. std::vector<std::wstring> language_vector; - int current_language_index = SpellChecker:: - GetSpellCheckLanguagesToDisplayInContextMenu(profile_, &language_vector); + SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu(profile_, + &language_vector); // Add the spell check languages. DCHECK(language_vector.size() < IDC_SPELLCHECK_LANGUAGES_LAST - IDC_SPELLCHECK_LANGUAGES_FIRST); diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc index f8c77cb..bedad0e 100644 --- a/chrome/browser/render_view_context_menu_controller.cc +++ b/chrome/browser/render_view_context_menu_controller.cc @@ -249,9 +249,8 @@ void RenderViewContextMenuController::ExecuteCommand(int id) { if (id >= IDC_SPELLCHECK_LANGUAGES_FIRST && id < IDC_SPELLCHECK_LANGUAGES_LAST) { std::vector<std::wstring> display_language_vector; - int current_language = SpellChecker:: - GetSpellCheckLanguagesToDisplayInContextMenu( - source_web_contents_->profile(), &display_language_vector); + SpellChecker::GetSpellCheckLanguagesToDisplayInContextMenu( + source_web_contents_->profile(), &display_language_vector); if (id - IDC_SPELLCHECK_LANGUAGES_FIRST < static_cast<int>(display_language_vector.size())) { StringPrefMember dictionary_language; diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 5972e38..eabf1d7 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -615,16 +615,10 @@ void LanguagesPageView::InitControlLayout() { enable_spellchecking_checkbox_->SetMultiLine(true); // Determine Locale Codes. - std::vector<std::wstring> locale_codes; std::vector<std::wstring> spell_check_languages; SpellChecker::SpellCheckLanguages(&spell_check_languages); - for (size_t i = 0; - i < spell_check_languages.size(); - ++i) { - locale_codes.push_back(spell_check_languages.at(i)); - } dictionary_language_model_.reset(new LanguageComboboxModel(profile(), - locale_codes)); + spell_check_languages)); change_dictionary_language_combobox_ = new views::ComboBox(dictionary_language_model_.get()); change_dictionary_language_combobox_->SetListener(this); diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index e46ca09..766ecf8 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -468,8 +468,6 @@ void BrowserToolbarView::RunPageMenu(const CPoint& pt, HWND hwnd) { anchor = Menu::TOPLEFT; Menu menu(this, anchor, hwnd); - // The install menu may be dynamically generated with a contextual label. - // See browser_commands.cc. menu.AppendMenuItemWithLabel(IDC_CREATE_SHORTCUTS, l10n_util::GetString(IDS_CREATE_SHORTCUTS)); menu.AppendSeparator(); @@ -543,14 +541,12 @@ void BrowserToolbarView::RunAppMenu(const CPoint& pt, HWND hwnd) { menu.AppendMenuItemWithLabel(IDC_NEW_INCOGNITO_WINDOW, l10n_util::GetString(IDS_NEW_INCOGNITO_WINDOW)); - // Enumerate profiles asynchronously and then create the parent menu item - // "Open new window in profile...". We will create the child menu items for - // this once the asynchronous call is done. See OnGetProfilesDone. + // Enumerate profiles asynchronously and then create the parent menu item. + // We will create the child menu items for this once the asynchronous call is + // done. See OnGetProfilesDone(). profiles_helper_->GetProfiles(NULL); - Menu* profiles_menu = menu.AppendSubMenu( - IDC_PROFILE_MENU, - l10n_util::GetString(IDS_PROFILE_MENU)); - profiles_menu_ = profiles_menu; + profiles_menu_ = menu.AppendSubMenu(IDC_PROFILE_MENU, + l10n_util::GetString(IDS_PROFILE_MENU)); menu.AppendSeparator(); menu.AppendMenuItemWithLabel(IDC_SHOW_BOOKMARK_BAR, @@ -588,8 +584,7 @@ bool BrowserToolbarView::IsItemChecked(int id) const { return false; if (id == IDC_SHOW_BOOKMARK_BAR) return profile_->GetPrefs()->GetBoolean(prefs::kShowBookmarkBar); - else - return EncodingMenuControllerDelegate::IsItemChecked(id); + return EncodingMenuControllerDelegate::IsItemChecked(id); } void BrowserToolbarView::RunMenu(views::View* source, const CPoint& pt, @@ -615,16 +610,12 @@ void BrowserToolbarView::OnGetProfilesDone( // Store the latest list of profiles in the browser. browser_->set_user_data_dir_profiles(profiles); - // Number of sub menu items that we can show directly. - const int sub_items_count = IDC_NEW_WINDOW_PROFILE_0 - - IDC_NEW_WINDOW_PROFILE_LAST + 1; std::vector<std::wstring>::const_iterator iter = profiles.begin(); // Add direct sub menu items for profiles. for (int i = IDC_NEW_WINDOW_PROFILE_0; i <= IDC_NEW_WINDOW_PROFILE_LAST && iter != profiles.end(); - ++i, ++iter) { + ++i, ++iter) profiles_menu_->AppendMenuItemWithLabel(i, *iter); - } // If there are more profiles then show "Other" link. if (iter != profiles.end()) { profiles_menu_->AppendSeparator(); @@ -746,19 +737,6 @@ void BrowserToolbarView::Observe(NotificationType type, } } -void BrowserToolbarView::ExecuteCommand(int id) { - // If the command id is for one of the sub-menu-items of the new profile - // window menu then we need to get the name of the profile from the menu - // item id and then pass on that to the browser to take action. - if (id >= IDC_NEW_WINDOW_PROFILE_0 && id <= IDC_NEW_WINDOW_PROFILE_LAST) { - browser_->NewProfileWindowByIndex(id - IDC_NEW_WINDOW_PROFILE_0); - return; - } - - // For all other menu items, use the method in the base class. - EncodingMenuControllerDelegate::ExecuteCommand(id); -} - bool BrowserToolbarView::GetAcceleratorInfo(int id, views::Accelerator* accel) { // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index a8067e2..879c107 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -60,7 +60,6 @@ class BrowserToolbarView : public views::View, virtual bool IsItemChecked(int id) const; // Overridden from Menu::BaseControllerDelegate: - virtual void ExecuteCommand(int id); virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); // views::MenuDelegate |