| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/renderer_context_menu/spellchecker_submenu_observer.h" | 5 #include "chrome/browser/renderer_context_menu/spellchecker_submenu_observer.h" |
| 6 | 6 |
| 7 #include "base/prefs/pref_service.h" | 7 #include "base/prefs/pref_service.h" |
| 8 #include "base/strings/utf_string_conversions.h" | 8 #include "base/strings/utf_string_conversions.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" | 10 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h" |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 62 void AddMenuItem(int command_id, const base::string16& title) override {} | 62 void AddMenuItem(int command_id, const base::string16& title) override {} |
| 63 void AddCheckItem(int command_id, const base::string16& title) override {} | 63 void AddCheckItem(int command_id, const base::string16& title) override {} |
| 64 void AddSeparator() override {} | 64 void AddSeparator() override {} |
| 65 void AddSubMenu(int command_id, | 65 void AddSubMenu(int command_id, |
| 66 const base::string16& label, | 66 const base::string16& label, |
| 67 ui::MenuModel* model) override {} | 67 ui::MenuModel* model) override {} |
| 68 void UpdateMenuItem(int command_id, | 68 void UpdateMenuItem(int command_id, |
| 69 bool enabled, | 69 bool enabled, |
| 70 bool hidden, | 70 bool hidden, |
| 71 const base::string16& title) override {} | 71 const base::string16& title) override {} |
| 72 void SetIcon(int command_id, const gfx::Image& icon) override {} |
| 72 RenderViewHost* GetRenderViewHost() const override { return NULL; } | 73 RenderViewHost* GetRenderViewHost() const override { return NULL; } |
| 73 content::BrowserContext* GetBrowserContext() const override { | 74 content::BrowserContext* GetBrowserContext() const override { |
| 74 return profile_.get(); | 75 return profile_.get(); |
| 75 } | 76 } |
| 76 content::WebContents* GetWebContents() const override { return NULL; } | 77 content::WebContents* GetWebContents() const override { return NULL; } |
| 77 | 78 |
| 78 // Attaches a RenderViewContextMenuObserver to be tested. | 79 // Attaches a RenderViewContextMenuObserver to be tested. |
| 79 void SetObserver(RenderViewContextMenuObserver* observer) { | 80 void SetObserver(RenderViewContextMenuObserver* observer) { |
| 80 observer_ = observer; | 81 observer_ = observer; |
| 81 } | 82 } |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 EXPECT_TRUE(menu->IsCommandIdChecked(IDC_CHECK_SPELLING_WHILE_TYPING)); | 142 EXPECT_TRUE(menu->IsCommandIdChecked(IDC_CHECK_SPELLING_WHILE_TYPING)); |
| 142 | 143 |
| 143 // Select this item and verify that the "Check Spelling While Typing" item is | 144 // Select this item and verify that the "Check Spelling While Typing" item is |
| 144 // not checked. Also, verify that the value of "browser.enable_spellchecking" | 145 // not checked. Also, verify that the value of "browser.enable_spellchecking" |
| 145 // is now false. | 146 // is now false. |
| 146 menu->ExecuteCommand(IDC_CHECK_SPELLING_WHILE_TYPING, 0); | 147 menu->ExecuteCommand(IDC_CHECK_SPELLING_WHILE_TYPING, 0); |
| 147 EXPECT_FALSE( | 148 EXPECT_FALSE( |
| 148 menu->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); | 149 menu->GetPrefs()->GetBoolean(prefs::kEnableContinuousSpellcheck)); |
| 149 EXPECT_FALSE(menu->IsCommandIdChecked(IDC_CHECK_SPELLING_WHILE_TYPING)); | 150 EXPECT_FALSE(menu->IsCommandIdChecked(IDC_CHECK_SPELLING_WHILE_TYPING)); |
| 150 } | 151 } |
| OLD | NEW |