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

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

Issue 5544002: Move a bunch more browser stuff around.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 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
« no previous file with comments | « chrome/browser/dock_info_win.cc ('k') | chrome/browser/encoding_menu_controller.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_ENCODING_MENU_CONTROLLER_H_
6 #define CHROME_BROWSER_ENCODING_MENU_CONTROLLER_H_
7 #pragma once
8
9 #include <utility>
10 #include <string>
11 #include <vector>
12
13 #include "base/basictypes.h" // For DISALLOW_COPY_AND_ASSIGN
14 #include "base/gtest_prod_util.h"
15 #include "base/string16.h"
16
17 class Profile;
18
19 // Cross-platform logic needed for the encoding menu.
20 // For now, we don't need to track state so all methods are static.
21 class EncodingMenuController {
22 FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, EncodingIDsBelongTest);
23 FRIEND_TEST_ALL_PREFIXES(EncodingMenuControllerTest, IsItemChecked);
24
25 public:
26 typedef std::pair<int, string16> EncodingMenuItem;
27 typedef std::vector<EncodingMenuItem> EncodingMenuItemList;
28
29 public:
30 EncodingMenuController() {}
31
32 // Given a command ID, does this command belong to the encoding menu?
33 bool DoesCommandBelongToEncodingMenu(int id);
34
35 // Returns true if the given encoding menu item (specified by item_id)
36 // is checked. Note that this header is included from objc, where the name
37 // "id" is reserved.
38 bool IsItemChecked(Profile* browser_profile,
39 const std::string& current_tab_encoding,
40 int item_id);
41
42 // Fills in a list of menu items in the order they should appear in the menu.
43 // Items whose ids are 0 are separators.
44 void GetEncodingMenuItems(Profile* profile,
45 EncodingMenuItemList* menuItems);
46
47 private:
48 // List of all valid encoding GUI IDs.
49 static const int kValidEncodingIds[];
50 const int* ValidGUIEncodingIDs();
51 int NumValidGUIEncodingIDs();
52
53 DISALLOW_COPY_AND_ASSIGN(EncodingMenuController);
54 };
55
56 #endif // CHROME_BROWSER_ENCODING_MENU_CONTROLLER_H_
OLDNEW
« no previous file with comments | « chrome/browser/dock_info_win.cc ('k') | chrome/browser/encoding_menu_controller.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698