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

Side by Side Diff: chrome/browser/ui/toolbar/encoding_menu_controller.h

Issue 2254273003: Remove text encoding UI (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: rebased Created 4 years, 3 months 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #ifndef CHROME_BROWSER_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
7
8 #include <string>
9 #include <utility>
10 #include <vector>
11
12 #include "base/gtest_prod_util.h"
13 #include "base/macros.h"
14 #include "base/strings/string16.h"
15
16 class Profile;
17
18 // Cross-platform logic needed for the encoding menu.
19 // For now, we don't need to track state so all methods are static.
20 class EncodingMenuController {
21 FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, EncodingIDsBelongTest);
22 FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, IsItemChecked);
23
24 public:
25 typedef std::pair<int, base::string16> EncodingMenuItem;
26 typedef std::vector<EncodingMenuItem> EncodingMenuItemList;
27
28 public:
29 EncodingMenuController() {}
30
31 // Given a command ID, does this command belong to the encoding menu?
32 bool DoesCommandBelongToEncodingMenu(int id);
33
34 // Returns true if the given encoding menu item (specified by item_id)
35 // is checked. Note that this header is included from objc, where the name
36 // "id" is reserved.
37 bool IsItemChecked(Profile* browser_profile,
38 const std::string& current_tab_encoding,
39 int item_id);
40
41 // Fills in a list of menu items in the order they should appear in the menu.
42 // Items whose ids are 0 are separators.
43 void GetEncodingMenuItems(Profile* profile,
44 EncodingMenuItemList* menu_items);
45
46 private:
47 // List of all valid encoding GUI IDs.
48 static const int kValidEncodingIds[];
49 const int* ValidGUIEncodingIDs();
50 int NumValidGUIEncodingIDs();
51
52 DISALLOW_COPY_AND_ASSIGN(EncodingMenuController);
53 };
54
55 #endif // CHROME_BROWSER_UI_TOOLBAR_ENCODING_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/ui/toolbar/app_menu_model_unittest.cc ('k') | chrome/browser/ui/toolbar/encoding_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698