Lines Matching refs:command_updater
5 #include "chrome/browser/command_updater.h"
35 CommandUpdater command_updater(&handler);
38 EXPECT_FALSE(command_updater.SupportsCommand(0));
39 EXPECT_FALSE(command_updater.IsCommandEnabled(0));
42 command_updater.ExecuteCommand(0);
45 command_updater.UpdateCommandEnabled(1, true);
46 EXPECT_TRUE(command_updater.SupportsCommand(1));
47 EXPECT_TRUE(command_updater.IsCommandEnabled(1));
48 command_updater.ExecuteCommand(1);
51 command_updater.UpdateCommandEnabled(2, false);
52 EXPECT_TRUE(command_updater.SupportsCommand(2));
53 EXPECT_FALSE(command_updater.IsCommandEnabled(2));
55 // the command_updater is disabled
56 command_updater.ExecuteCommand(2);
61 CommandUpdater command_updater(&handler);
66 command_updater.AddCommandObserver(2, &observer);
67 command_updater.UpdateCommandEnabled(2, true);
69 command_updater.UpdateCommandEnabled(2, false);
73 command_updater.RemoveCommandObserver(2, &observer);
74 command_updater.UpdateCommandEnabled(2, true);
80 CommandUpdater command_updater(&handler);
88 command_updater.AddCommandObserver(1, &observer_remove);
89 command_updater.AddCommandObserver(2, &observer_remove);
90 command_updater.AddCommandObserver(3, &observer_remove);
91 command_updater.AddCommandObserver(1, &observer_keep);
92 command_updater.AddCommandObserver(2, &observer_keep);
93 command_updater.AddCommandObserver(3, &observer_keep);
94 command_updater.UpdateCommandEnabled(1, true);
95 command_updater.UpdateCommandEnabled(2, true);
96 command_updater.UpdateCommandEnabled(3, true);
101 command_updater.RemoveCommandObserver(&observer_remove);
102 command_updater.UpdateCommandEnabled(1, false);
103 command_updater.UpdateCommandEnabled(2, false);
104 command_updater.UpdateCommandEnabled(3, false);