diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 15:49:40 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2011-01-14 15:49:40 +0000 |
commit | 44cbd9e3734527f73a83f8a864be0bb5ccae0a7a (patch) | |
tree | a997fb0565558d63e0eab62b631ef984de3e9596 /chrome/browser | |
parent | 0c1c047d641a599ffffa280ab50d564cedb3e436 (diff) | |
download | chromium_src-44cbd9e3734527f73a83f8a864be0bb5ccae0a7a.zip chromium_src-44cbd9e3734527f73a83f8a864be0bb5ccae0a7a.tar.gz chromium_src-44cbd9e3734527f73a83f8a864be0bb5ccae0a7a.tar.bz2 |
Move models from app to ui/base/models
BUG=none
TEST=none
TBR=brettw
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@71446 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
186 files changed, 882 insertions, 866 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc index 7b9354d..376c18e2463 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.cc +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.cc @@ -1036,7 +1036,7 @@ bool AutocompleteEditViewWin::IsCommandIdEnabled(int command_id) const { bool AutocompleteEditViewWin::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return parent_view_->GetWidget()->GetAccelerator(command_id, accelerator); } @@ -2505,7 +2505,7 @@ void AutocompleteEditViewWin::BuildContextMenu() { if (context_menu_contents_.get()) return; - context_menu_contents_.reset(new menus::SimpleMenuModel(this)); + context_menu_contents_.reset(new ui::SimpleMenuModel(this)); // Set up context menu. if (popup_window_mode_) { context_menu_contents_->AddItemWithStringId(IDC_COPY, IDS_COPY); diff --git a/chrome/browser/autocomplete/autocomplete_edit_view_win.h b/chrome/browser/autocomplete/autocomplete_edit_view_win.h index c4b642a..847e62d 100644 --- a/chrome/browser/autocomplete/autocomplete_edit_view_win.h +++ b/chrome/browser/autocomplete/autocomplete_edit_view_win.h @@ -13,7 +13,6 @@ #include <atlmisc.h> #include <tom.h> // For ITextDocument, a COM interface to CRichEditCtrl. -#include "app/menus/simple_menu_model.h" #include "base/scoped_comptr_win.h" #include "base/scoped_ptr.h" #include "chrome/browser/autocomplete/autocomplete.h" @@ -22,6 +21,7 @@ #include "chrome/browser/ui/views/autocomplete/autocomplete_popup_contents_view.h" #include "chrome/common/page_transition_types.h" #include "gfx/font.h" +#include "ui/base/models/simple_menu_model.h" #include "views/controls/menu/menu_2.h" #include "webkit/glue/window_open_disposition.h" @@ -45,7 +45,7 @@ class AutocompleteEditViewWin CWinTraits<WS_CHILD | WS_VISIBLE | ES_AUTOHSCROLL | ES_NOHIDESEL> >, public CRichEditCommands<AutocompleteEditViewWin>, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public AutocompleteEditView { public: struct State { @@ -207,11 +207,11 @@ class AutocompleteEditViewWin DEFAULT_REFLECTION_HANDLER() // avoids black margin area END_MSG_MAP() - // menus::SimpleMenuModel::Delegate + // ui::SimpleMenuModel::Delegate virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual bool IsItemForCommandIdDynamic(int command_id) const; virtual std::wstring GetLabelForCommandId(int command_id) const; virtual void ExecuteCommand(int command_id); @@ -487,7 +487,7 @@ class AutocompleteEditViewWin bool delete_at_end_pressed_; // The context menu for the edit. - scoped_ptr<menus::SimpleMenuModel> context_menu_contents_; + scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; scoped_ptr<views::Menu2> context_menu_; // Font we're using. We keep a reference to make sure the font supplied to diff --git a/chrome/browser/background_mode_manager.cc b/chrome/browser/background_mode_manager.cc index 0757bc8..74594b0 100644 --- a/chrome/browser/background_mode_manager.cc +++ b/chrome/browser/background_mode_manager.cc @@ -270,7 +270,7 @@ void BackgroundModeManager::UpdateStatusTrayIconContextMenu() { return; // Create a context menu item for Chrome. - menus::SimpleMenuModel* menu = new menus::SimpleMenuModel(this); + ui::SimpleMenuModel* menu = new ui::SimpleMenuModel(this); // Add About item menu->AddItem(IDC_ABOUT, l10n_util::GetStringFUTF16(IDS_ABOUT, l10n_util::GetStringUTF16(IDS_PRODUCT_NAME))); @@ -307,7 +307,7 @@ bool BackgroundModeManager::IsCommandIdEnabled(int command_id) const { bool BackgroundModeManager::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { // No accelerators for status icon context menus. return false; } diff --git a/chrome/browser/background_mode_manager.h b/chrome/browser/background_mode_manager.h index 9407d4a..b874fd6 100644 --- a/chrome/browser/background_mode_manager.h +++ b/chrome/browser/background_mode_manager.h @@ -6,13 +6,13 @@ #define CHROME_BROWSER_BACKGROUND_MODE_MANAGER_H_ #pragma once -#include "app/menus/simple_menu_model.h" #include "base/gtest_prod_util.h" #include "chrome/browser/background_application_list_model.h" #include "chrome/browser/prefs/pref_change_registrar.h" #include "chrome/browser/status_icons/status_icon.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/models/simple_menu_model.h" class Browser; class CommandLine; @@ -38,7 +38,7 @@ class StatusTray; // background. class BackgroundModeManager : public NotificationObserver, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public BackgroundApplicationListModel::Observer { public: BackgroundModeManager(Profile* profile, CommandLine* command_line); @@ -69,7 +69,7 @@ class BackgroundModeManager virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // Open an application in a new tab, opening a new window if needed. @@ -151,7 +151,7 @@ class BackgroundModeManager // Reference to our status icon's context menu (if any) - owned by the // status_icon_ - menus::SimpleMenuModel* context_menu_; + ui::SimpleMenuModel* context_menu_; // Set to the position of the first application entry in the status icon's // context menu. diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc index 32b9d07..8eed100 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.cc +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.cc @@ -36,7 +36,7 @@ BookmarkContextMenuController::BookmarkContextMenuController( model_(profile->GetBookmarkModel()) { DCHECK(profile_); DCHECK(model_->IsLoaded()); - menu_model_.reset(new menus::SimpleMenuModel(this)); + menu_model_.reset(new ui::SimpleMenuModel(this)); model_->AddObserver(this); BuildMenu(); @@ -280,7 +280,7 @@ bool BookmarkContextMenuController::IsCommandIdEnabled(int command_id) const { bool BookmarkContextMenuController::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/bookmarks/bookmark_context_menu_controller.h b/chrome/browser/bookmarks/bookmark_context_menu_controller.h index f5f04af..8180953 100644 --- a/chrome/browser/bookmarks/bookmark_context_menu_controller.h +++ b/chrome/browser/bookmarks/bookmark_context_menu_controller.h @@ -8,10 +8,10 @@ #include <vector> -#include "app/menus/simple_menu_model.h" #include "base/basictypes.h" #include "chrome/browser/bookmarks/base_bookmark_model_observer.h" #include "gfx/native_widget_types.h" +#include "ui/base/models/simple_menu_model.h" class PageNavigator; class Profile; @@ -35,7 +35,7 @@ class BookmarkContextMenuControllerDelegate { // BookmarkContextMenuController creates and manages state for the context menu // shown for any bookmark item. class BookmarkContextMenuController : public BaseBookmarkModelObserver, - public menus::SimpleMenuModel::Delegate { + public ui::SimpleMenuModel::Delegate { public: // Creates the bookmark context menu. // |profile| is used for opening urls as well as enabling 'open incognito'. @@ -54,13 +54,13 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver, void BuildMenu(); - menus::SimpleMenuModel* menu_model() const { return menu_model_.get(); } + ui::SimpleMenuModel* menu_model() const { return menu_model_.get(); } - // menus::SimpleMenuModel::Delegate implementation: + // ui::SimpleMenuModel::Delegate implementation: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // Accessors: @@ -89,7 +89,7 @@ class BookmarkContextMenuController : public BaseBookmarkModelObserver, const BookmarkNode* parent_; std::vector<const BookmarkNode*> selection_; BookmarkModel* model_; - scoped_ptr<menus::SimpleMenuModel> menu_model_; + scoped_ptr<ui::SimpleMenuModel> menu_model_; DISALLOW_COPY_AND_ASSIGN(BookmarkContextMenuController); }; diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 3155103..703a78a 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -11,7 +11,6 @@ #include <set> #include <vector> -#include "app/tree_node_model.h" #include "base/lock.h" #include "base/observer_list.h" #include "base/string16.h" @@ -26,6 +25,7 @@ #include "googleurl/src/gurl.h" #include "third_party/skia/include/core/SkBitmap.h" #include "testing/gtest/include/gtest/gtest_prod.h" +#include "ui/base/models/tree_node_model.h" class BookmarkIndex; class BookmarkLoadDetails; @@ -42,7 +42,7 @@ struct TitleMatch; // BookmarkNode contains information about a starred entry: title, URL, favicon, // star id and type. BookmarkNodes are returned from a BookmarkModel. // -class BookmarkNode : public TreeNode<BookmarkNode> { +class BookmarkNode : public ui::TreeNode<BookmarkNode> { friend class BookmarkModel; public: diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index ef486fb..ec769ba 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -5,8 +5,6 @@ #include <string> #include <set> -#include "app/tree_node_iterator.h" -#include "app/tree_node_model.h" #include "base/base_paths.h" #include "base/file_util.h" #include "base/hash_tables.h" @@ -29,6 +27,8 @@ #include "chrome/test/model_test_utils.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/models/tree_node_model.h" +#include "ui/base/models/tree_node_iterator.h" using base::Time; using base::TimeDelta; @@ -566,7 +566,7 @@ TEST_F(BookmarkModelTest, NotifyURLsStarred) { namespace { // See comment in PopulateNodeFromString. -typedef TreeNodeWithValue<BookmarkNode::Type> TestNode; +typedef ui::TreeNodeWithValue<BookmarkNode::Type> TestNode; // Does the work of PopulateNodeFromString. index gives the index of the current // element in description to process. @@ -688,7 +688,7 @@ class BookmarkModelTestWithProfile : public testing::Test, } void VerifyNoDuplicateIDs(BookmarkModel* model) { - TreeNodeIterator<const BookmarkNode> it(model->root_node()); + ui::TreeNodeIterator<const BookmarkNode> it(model->root_node()); base::hash_set<int64> ids; while (it.has_next()) ASSERT_TRUE(ids.insert(it.Next()->id()).second); diff --git a/chrome/browser/bookmarks/bookmark_utils.cc b/chrome/browser/bookmarks/bookmark_utils.cc index 848215a..8021f4e 100644 --- a/chrome/browser/bookmarks/bookmark_utils.cc +++ b/chrome/browser/bookmarks/bookmark_utils.cc @@ -8,7 +8,6 @@ #include "app/drag_drop_types.h" #include "app/l10n_util.h" -#include "app/tree_node_iterator.h" #include "base/basictypes.h" #include "base/file_path.h" #include "base/string_number_conversions.h" @@ -36,6 +35,7 @@ #include "grit/generated_resources.h" #include "net/base/net_util.h" #include "views/event.h" +#include "ui/base/models/tree_node_iterator.h" #if defined(TOOLKIT_VIEWS) #include "ui/base/dragdrop/os_exchange_data.h" @@ -441,7 +441,7 @@ std::vector<const BookmarkNode*> GetMostRecentlyModifiedGroups( BookmarkModel* model, size_t max_count) { std::vector<const BookmarkNode*> nodes; - TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); + ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); while (iterator.has_next()) { const BookmarkNode* parent = iterator.Next(); if (parent->is_folder() && parent->date_group_modified() > base::Time()) { @@ -479,7 +479,7 @@ std::vector<const BookmarkNode*> GetMostRecentlyModifiedGroups( void GetMostRecentlyAddedEntries(BookmarkModel* model, size_t count, std::vector<const BookmarkNode*>* nodes) { - TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); + ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); while (iterator.has_next()) { const BookmarkNode* node = iterator.Next(); if (node->is_url()) { @@ -510,7 +510,7 @@ void GetBookmarksContainingText(BookmarkModel* model, if (words.empty()) return; - TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); + ui::TreeNodeIterator<const BookmarkNode> iterator(model->root_node()); while (iterator.has_next()) { const BookmarkNode* node = iterator.Next(); if (node->is_url() && DoesBookmarkContainWords(node, words, languages)) { diff --git a/chrome/browser/bookmarks/recently_used_folders_combo_model.h b/chrome/browser/bookmarks/recently_used_folders_combo_model.h index e8fcc75..b405899 100644 --- a/chrome/browser/bookmarks/recently_used_folders_combo_model.h +++ b/chrome/browser/bookmarks/recently_used_folders_combo_model.h @@ -8,19 +8,19 @@ #include <vector> -#include "app/combobox_model.h" #include "base/string16.h" #include "chrome/browser/bookmarks/bookmark_model.h" +#include "ui/base/models/combobox_model.h" // Model for the combobox showing the list of folders to choose from. The // list always contains the bookmark bar, other node and parent. The list // also contains an extra item that shows the text 'Choose another folder...'. -class RecentlyUsedFoldersComboModel : public ComboboxModel { +class RecentlyUsedFoldersComboModel : public ui::ComboboxModel { public: RecentlyUsedFoldersComboModel(BookmarkModel* model, const BookmarkNode* node); virtual ~RecentlyUsedFoldersComboModel(); - // Overridden from ComboboxModel: + // Overridden from ui::ComboboxModel: virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/chromeos/dom_ui/domui_menu_control.h b/chrome/browser/chromeos/dom_ui/domui_menu_control.h index 417103b..2e4cc93 100644 --- a/chrome/browser/chromeos/dom_ui/domui_menu_control.h +++ b/chrome/browser/chromeos/dom_ui/domui_menu_control.h @@ -10,9 +10,9 @@ namespace gfx { class Size; } // namespace gfx -namespace menus { +namespace ui { class MenuModel; -} // namespace menus +} // namespace ui namespace chromeos { @@ -29,10 +29,10 @@ class DOMUIMenuControl { virtual ~DOMUIMenuControl() {} // Returns the MenuModel associated with this control. - virtual menus::MenuModel* GetMenuModel() = 0; + virtual ui::MenuModel* GetMenuModel() = 0; // Activates an item in the |model| at |index|. - virtual void Activate(menus::MenuModel* model, + virtual void Activate(ui::MenuModel* model, int index, ActivationMode activation_mode) = 0; diff --git a/chrome/browser/chromeos/dom_ui/menu_ui.cc b/chrome/browser/chromeos/dom_ui/menu_ui.cc index 70f49b9..08b6440 100644 --- a/chrome/browser/chromeos/dom_ui/menu_ui.cc +++ b/chrome/browser/chromeos/dom_ui/menu_ui.cc @@ -6,7 +6,6 @@ #include <algorithm> -#include "app/menus/menu_model.h" #include "app/resource_bundle.h" #include "base/callback.h" #include "base/command_line.h" @@ -32,6 +31,7 @@ #include "gfx/font.h" #include "grit/app_resources.h" #include "grit/browser_resources.h" +#include "ui/base/models/menu_model.h" #include "views/accelerator.h" #include "views/controls/menu/menu_config.h" #include "views/controls/menu/radio_button_image_gtk.h" @@ -405,7 +405,7 @@ void MenuHandler::HandleActivate(const ListValue* values) { DCHECK(success); chromeos::DOMUIMenuControl* control = GetMenuControl(); if (control) { - menus::MenuModel* model = GetMenuModel(); + ui::MenuModel* model = GetMenuModel(); DCHECK(model); DCHECK_GE(index, 0); DCHECK(activation == "close_and_activate" || @@ -464,7 +464,7 @@ void MenuHandler::HandleCloseAll(const ListValue* values) { } void MenuHandler::HandleModelUpdated(const ListValue* values) { - menus::MenuModel* model = GetMenuModel(); + ui::MenuModel* model = GetMenuModel(); if (model) static_cast<chromeos::MenuUI*>(dom_ui_)->ModelUpdated(model); } @@ -514,7 +514,7 @@ chromeos::DOMUIMenuControl* MenuHandlerBase::GetMenuControl() { return NULL; } -menus::MenuModel* MenuHandlerBase::GetMenuModel() { +ui::MenuModel* MenuHandlerBase::GetMenuModel() { DOMUIMenuControl* control = GetMenuControl(); if (control) return control->GetMenuModel(); @@ -553,34 +553,34 @@ MenuUI::MenuUI(TabContents* contents, ChromeURLDataManager::DataSource* source) make_scoped_refptr(source))); } -void MenuUI::ModelUpdated(const menus::MenuModel* model) { +void MenuUI::ModelUpdated(const ui::MenuModel* model) { DictionaryValue json_model; ListValue* items = new ListValue(); json_model.Set("items", items); int max_icon_width = 0; bool has_accelerator = false; for (int index = 0; index < model->GetItemCount(); ++index) { - menus::MenuModel::ItemType type = model->GetTypeAt(index); + ui::MenuModel::ItemType type = model->GetTypeAt(index); DictionaryValue* item; switch (type) { - case menus::MenuModel::TYPE_SEPARATOR: + case ui::MenuModel::TYPE_SEPARATOR: item = CreateMenuItem(model, index, "separator", &max_icon_width, &has_accelerator); break; - case menus::MenuModel::TYPE_RADIO: + case ui::MenuModel::TYPE_RADIO: max_icon_width = std::max(max_icon_width, 12); item = CreateMenuItem(model, index, "radio", &max_icon_width, &has_accelerator); break; - case menus::MenuModel::TYPE_SUBMENU: + case ui::MenuModel::TYPE_SUBMENU: item = CreateMenuItem(model, index, "submenu", &max_icon_width, &has_accelerator); break; - case menus::MenuModel::TYPE_COMMAND: + case ui::MenuModel::TYPE_COMMAND: item = CreateMenuItem(model, index, "command", &max_icon_width, &has_accelerator); break; - case menus::MenuModel::TYPE_CHECK: + case ui::MenuModel::TYPE_CHECK: // Add space even when unchecked. max_icon_width = std::max(max_icon_width, 12); item = CreateMenuItem(model, index, "check", @@ -603,7 +603,7 @@ void MenuUI::ModelUpdated(const menus::MenuModel* model) { CallJavascriptFunction(L"updateModel", json_model); } -DictionaryValue* MenuUI::CreateMenuItem(const menus::MenuModel* model, +DictionaryValue* MenuUI::CreateMenuItem(const ui::MenuModel* model, int index, const char* type, int* max_icon_width, diff --git a/chrome/browser/chromeos/dom_ui/menu_ui.h b/chrome/browser/chromeos/dom_ui/menu_ui.h index 9f8c5db..dd3c85a 100644 --- a/chrome/browser/chromeos/dom_ui/menu_ui.h +++ b/chrome/browser/chromeos/dom_ui/menu_ui.h @@ -13,9 +13,9 @@ class DictionaryValue; -namespace menus { +namespace ui{ class MenuModel; -} // namespace menus +} // namespace ui namespace chromeos { @@ -41,10 +41,10 @@ class MenuUI : public DOMUI { // A callback method that is invoked when a menu model associated // with the DOMUI Menu gets updated. - virtual void ModelUpdated(const menus::MenuModel* new_model); + virtual void ModelUpdated(const ui::MenuModel* new_model); // Creates a menu item for the menu item at index in the model. - virtual DictionaryValue* CreateMenuItem(const menus::MenuModel* model, + virtual DictionaryValue* CreateMenuItem(const ui::MenuModel* model, int index, const char* type, int* max_icon_width, @@ -86,7 +86,7 @@ class MenuHandlerBase : public DOMMessageHandler { // Returns the menu model for this menu ui. // This may return null when menu is being deleted. - menus::MenuModel* GetMenuModel(); + ui::MenuModel* GetMenuModel(); private: DISALLOW_COPY_AND_ASSIGN(MenuHandlerBase); diff --git a/chrome/browser/chromeos/dom_ui/network_menu_ui.cc b/chrome/browser/chromeos/dom_ui/network_menu_ui.cc index 2973432..8e1f50d 100644 --- a/chrome/browser/chromeos/dom_ui/network_menu_ui.cc +++ b/chrome/browser/chromeos/dom_ui/network_menu_ui.cc @@ -70,7 +70,7 @@ void NetworkMenuHandler::RegisterMessages() { } void NetworkMenuHandler::HandleAction(const ListValue* values) { - menus::MenuModel* model = GetMenuModel(); + ui::MenuModel* model = GetMenuModel(); if (model) { chromeos::NetworkMenuUI* network_menu_ui = static_cast<chromeos::NetworkMenuUI*>(dom_ui_); @@ -126,7 +126,7 @@ NetworkMenuUI::NetworkMenuUI(TabContents* contents) make_scoped_refptr(theme))); } -bool NetworkMenuUI::ModelAction(const menus::MenuModel* model, +bool NetworkMenuUI::ModelAction(const ui::MenuModel* model, const ListValue* values) { const NetworkMenu* network_menu = static_cast<const NetworkMenu*>(model); std::string action; @@ -165,7 +165,7 @@ bool NetworkMenuUI::ModelAction(const menus::MenuModel* model, return close_menu; } -DictionaryValue* NetworkMenuUI::CreateMenuItem(const menus::MenuModel* model, +DictionaryValue* NetworkMenuUI::CreateMenuItem(const ui::MenuModel* model, int index, const char* type, int* max_icon_width, @@ -192,7 +192,7 @@ DictionaryValue* NetworkMenuUI::CreateMenuItem(const menus::MenuModel* model, return item; } -views::Menu2* NetworkMenuUI::CreateMenu2(menus::MenuModel* model) { +views::Menu2* NetworkMenuUI::CreateMenu2(ui::MenuModel* model) { views::Menu2* menu = new views::Menu2(model); NativeMenuDOMUI::SetMenuURL( menu, GURL(StringPrintf("chrome://%s", chrome::kChromeUINetworkMenu))); diff --git a/chrome/browser/chromeos/dom_ui/network_menu_ui.h b/chrome/browser/chromeos/dom_ui/network_menu_ui.h index 70a3a4d..1a236dc 100644 --- a/chrome/browser/chromeos/dom_ui/network_menu_ui.h +++ b/chrome/browser/chromeos/dom_ui/network_menu_ui.h @@ -8,14 +8,14 @@ #include "chrome/browser/chromeos/dom_ui/menu_ui.h" +namespace ui { +class MenuModel; +} // namespace ui + namespace views { class Menu2; } // namespace views -namespace menus { -class MenuModel; -} // namespace menus - namespace chromeos { class NetworkMenuUI : public MenuUI { @@ -26,18 +26,18 @@ class NetworkMenuUI : public MenuUI { // to invoke an action in the model. // By convention the first member of 'values' describes the action. // Returns true if the menu should be closed. - bool ModelAction(const menus::MenuModel* model, + bool ModelAction(const ui::MenuModel* model, const ListValue* values); // MenuUI overrides - virtual DictionaryValue* CreateMenuItem(const menus::MenuModel* model, + virtual DictionaryValue* CreateMenuItem(const ui::MenuModel* model, int index, const char* type, int* max_icon_width, bool* has_accel) const; // A convenient factory method to create Menu2 for the network menu. - static views::Menu2* CreateMenu2(menus::MenuModel* model); + static views::Menu2* CreateMenu2(ui::MenuModel* model); private: diff --git a/chrome/browser/chromeos/dom_ui/wrench_menu_ui.cc b/chrome/browser/chromeos/dom_ui/wrench_menu_ui.cc index 547615e..1f3459e 100644 --- a/chrome/browser/chromeos/dom_ui/wrench_menu_ui.cc +++ b/chrome/browser/chromeos/dom_ui/wrench_menu_ui.cc @@ -69,7 +69,7 @@ WrenchMenuUI::WrenchMenuUI(TabContents* contents) Source<Profile>(GetProfile())); } -void WrenchMenuUI::ModelUpdated(const menus::MenuModel* new_model) { +void WrenchMenuUI::ModelUpdated(const ui::MenuModel* new_model) { MenuUI::ModelUpdated(new_model); UpdateZoomControls(); } @@ -104,7 +104,7 @@ void WrenchMenuUI::UpdateZoomControls() { CallJavascriptFunction(L"updateZoomControls", params); } -views::Menu2* WrenchMenuUI::CreateMenu2(menus::MenuModel* model) { +views::Menu2* WrenchMenuUI::CreateMenu2(ui::MenuModel* model) { views::Menu2* menu = new views::Menu2(model); NativeMenuDOMUI::SetMenuURL( menu, GURL(StringPrintf("chrome://%s", chrome::kChromeUIWrenchMenu))); diff --git a/chrome/browser/chromeos/dom_ui/wrench_menu_ui.h b/chrome/browser/chromeos/dom_ui/wrench_menu_ui.h index c12528c..3b4f1cd 100644 --- a/chrome/browser/chromeos/dom_ui/wrench_menu_ui.h +++ b/chrome/browser/chromeos/dom_ui/wrench_menu_ui.h @@ -14,14 +14,14 @@ class NotificationSource; class NotificationDetails; +namespace ui { +class MenuModel; +} // namespace ui + namespace views { class Menu2; } // namespace views -namespace menus { -class MenuModel; -} // namespace menus - namespace chromeos { class WrenchMenuUI : public MenuUI, @@ -30,7 +30,7 @@ class WrenchMenuUI : public MenuUI, explicit WrenchMenuUI(TabContents* contents); // MenuUI overrides: - virtual void ModelUpdated(const menus::MenuModel* new_model); + virtual void ModelUpdated(const ui::MenuModel* new_model); // NotificationObserver: virtual void Observe(NotificationType type, @@ -41,7 +41,7 @@ class WrenchMenuUI : public MenuUI, void UpdateZoomControls(); // A convenient factory method to create Menu2 for wrench menu. - static views::Menu2* CreateMenu2(menus::MenuModel* model); + static views::Menu2* CreateMenu2(ui::MenuModel* model); private: NotificationRegistrar registrar_; diff --git a/chrome/browser/chromeos/frame/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc index fb47a8d..8fe05f0 100644 --- a/chrome/browser/chromeos/frame/browser_view.cc +++ b/chrome/browser/chromeos/frame/browser_view.cc @@ -8,7 +8,6 @@ #include <string> #include <vector> -#include "app/menus/simple_menu_model.h" #include "base/command_line.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/chromeos/frame/panel_browser_view.h" @@ -30,6 +29,7 @@ #include "gfx/canvas.h" #include "grit/generated_resources.h" #include "third_party/cros/chromeos_wm_ipc_enums.h" +#include "ui/base/models/simple_menu_model.h" #include "views/controls/button/button.h" #include "views/controls/button/image_button.h" #include "views/controls/menu/menu_2.h" @@ -373,7 +373,7 @@ void BrowserView::GetAccessiblePanes( // BrowserView private: void BrowserView::InitSystemMenu() { - system_menu_contents_.reset(new menus::SimpleMenuModel(this)); + system_menu_contents_.reset(new ui::SimpleMenuModel(this)); system_menu_contents_->AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); system_menu_contents_->AddItemWithStringId(IDC_NEW_TAB, IDS_NEW_TAB); diff --git a/chrome/browser/chromeos/frame/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h index e4848e2..4f39b39 100644 --- a/chrome/browser/chromeos/frame/browser_view.h +++ b/chrome/browser/chromeos/frame/browser_view.h @@ -13,11 +13,12 @@ #include "views/controls/menu/menu_wrapper.h" class AccessibleToolbarView; +class Profile; class TabStripModel; -namespace menus { +namespace ui { class SimpleMenuModel; -} // namespace menus +} // namespace ui namespace views { class ImageButton; @@ -25,8 +26,6 @@ class ImageView; class Menu2; } // namespace views -class Profile; - namespace chromeos { class StatusAreaView; @@ -91,7 +90,7 @@ class BrowserView : public ::BrowserView, StatusAreaView* status_area_; // System menus. - scoped_ptr<menus::SimpleMenuModel> system_menu_contents_; + scoped_ptr<ui::SimpleMenuModel> system_menu_contents_; scoped_ptr<views::Menu2> system_menu_menu_; // Focused native widget before wench menu shows up. We need this to properly diff --git a/chrome/browser/chromeos/login/language_switch_menu.cc b/chrome/browser/chromeos/login/language_switch_menu.cc index 595515a..c94182e 100644 --- a/chrome/browser/chromeos/login/language_switch_menu.cc +++ b/chrome/browser/chromeos/login/language_switch_menu.cc @@ -129,7 +129,7 @@ void LanguageSwitchMenu::RunMenu(views::View* source, const gfx::Point& pt) { } //////////////////////////////////////////////////////////////////////////////// -// menus::SimpleMenuModel::Delegate implementation. +// ui::SimpleMenuModel::Delegate implementation. bool LanguageSwitchMenu::IsCommandIdChecked(int command_id) const { return false; @@ -140,7 +140,7 @@ bool LanguageSwitchMenu::IsCommandIdEnabled(int command_id) const { } bool LanguageSwitchMenu::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/chromeos/login/language_switch_menu.h b/chrome/browser/chromeos/login/language_switch_menu.h index 6455a1a..c3fdb25 100644 --- a/chrome/browser/chromeos/login/language_switch_menu.h +++ b/chrome/browser/chromeos/login/language_switch_menu.h @@ -8,10 +8,10 @@ #include <string> -#include "app/menus/simple_menu_model.h" #include "base/scoped_ptr.h" #include "chrome/browser/language_combobox_model.h" #include "testing/gtest/include/gtest/gtest_prod.h" +#include "ui/base/models/simple_menu_model.h" #include "views/controls/menu/menu_2.h" #include "views/controls/menu/view_menu_delegate.h" #include "views/view.h" @@ -23,7 +23,7 @@ namespace chromeos { class ScreenObserver; class LanguageSwitchMenu : public views::ViewMenuDelegate, - public menus::SimpleMenuModel::Delegate { + public ui::SimpleMenuModel::Delegate { public: LanguageSwitchMenu(); @@ -48,16 +48,16 @@ class LanguageSwitchMenu : public views::ViewMenuDelegate, // views::ViewMenuDelegate implementation. virtual void RunMenu(views::View* source, const gfx::Point& pt); - // menus::SimpleMenuModel::Delegate implementation. + // ui::SimpleMenuModel::Delegate implementation. virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // Dialog controls that we own ourselves. - menus::SimpleMenuModel menu_model_; - menus::SimpleMenuModel menu_model_submenu_; + ui::SimpleMenuModel menu_model_; + ui::SimpleMenuModel menu_model_submenu_; scoped_ptr<views::Menu2> menu_; // Language locale name storage. diff --git a/chrome/browser/chromeos/login/network_screen_browsertest.cc b/chrome/browser/chromeos/login/network_screen_browsertest.cc index aa1e845..575ebc5 100644 --- a/chrome/browser/chromeos/login/network_screen_browsertest.cc +++ b/chrome/browser/chromeos/login/network_screen_browsertest.cc @@ -4,7 +4,6 @@ #include <string> -#include "app/combobox_model.h" #include "app/l10n_util.h" #include "base/message_loop.h" #include "base/scoped_ptr.h" @@ -27,7 +26,6 @@ #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" #include "views/controls/button/text_button.h" -#include "views/controls/combobox/combobox.h" namespace chromeos { using ::testing::AnyNumber; diff --git a/chrome/browser/chromeos/login/network_screen_delegate.h b/chrome/browser/chromeos/login/network_screen_delegate.h index e64e380..807093a 100644 --- a/chrome/browser/chromeos/login/network_screen_delegate.h +++ b/chrome/browser/chromeos/login/network_screen_delegate.h @@ -6,10 +6,8 @@ #define CHROME_BROWSER_CHROMEOS_LOGIN_NETWORK_SCREEN_DELEGATE_H_ #pragma once -#include "app/combobox_model.h" #include "chrome/browser/chromeos/cros/network_library.h" #include "views/controls/button/button.h" -#include "views/controls/combobox/combobox.h" namespace gfx { class Size; diff --git a/chrome/browser/chromeos/notifications/balloon_view.cc b/chrome/browser/chromeos/notifications/balloon_view.cc index 5519354..63cc00d 100644 --- a/chrome/browser/chromeos/notifications/balloon_view.cc +++ b/chrome/browser/chromeos/notifications/balloon_view.cc @@ -7,7 +7,6 @@ #include <vector> #include "app/l10n_util.h" -#include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "base/message_loop.h" #include "base/utf_string_conversions.h" @@ -25,6 +24,7 @@ #include "chrome/common/notification_type.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/simple_menu_model.h" #include "views/background.h" #include "views/controls/button/button.h" #include "views/controls/button/image_button.h" @@ -54,7 +54,7 @@ namespace chromeos { // overlays on top of renderer view. class NotificationControlView : public views::View, public views::ViewMenuDelegate, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public views::ButtonListener { public: explicit NotificationControlView(BalloonViewImpl* view) @@ -125,7 +125,7 @@ class NotificationControlView : public views::View, balloon_view_->Close(true); } - // menus::SimpleMenuModel::Delegate impglements. + // ui::SimpleMenuModel::Delegate impglements. virtual bool IsCommandIdChecked(int /* command_id */) const { // Nothing in the menu is checked. return false; @@ -137,7 +137,7 @@ class NotificationControlView : public views::View, } virtual bool GetAcceleratorForCommandId( - int /* command_id */, menus::Accelerator* /* accelerator */) { + int /* command_id */, ui::Accelerator* /* accelerator */) { // Currently no accelerators. return false; } @@ -162,7 +162,7 @@ class NotificationControlView : public views::View, IDS_NOTIFICATION_BALLOON_REVOKE_MESSAGE, balloon_view_->balloon_->notification().display_source()); - options_menu_contents_.reset(new menus::SimpleMenuModel(this)); + options_menu_contents_.reset(new ui::SimpleMenuModel(this)); // TODO(oshima): Showing the source info in the menu for now. // Figure out where to show the source info. options_menu_contents_->AddItem(kNoopCommand, source_label_text); @@ -176,7 +176,7 @@ class NotificationControlView : public views::View, views::ImageButton* close_button_; // The options menu. - scoped_ptr<menus::SimpleMenuModel> options_menu_contents_; + scoped_ptr<ui::SimpleMenuModel> options_menu_contents_; scoped_ptr<views::Menu2> options_menu_menu_; views::MenuButton* options_menu_button_; diff --git a/chrome/browser/chromeos/options/language_config_util.h b/chrome/browser/chromeos/options/language_config_util.h index 808fefc..dcd248c 100644 --- a/chrome/browser/chromeos/options/language_config_util.h +++ b/chrome/browser/chromeos/options/language_config_util.h @@ -6,16 +6,16 @@ #define CHROME_BROWSER_CHROMEOS_OPTIONS_LANGUAGE_CONFIG_UTIL_H_ #pragma once -#include "app/combobox_model.h" #include "base/string16.h" #include "chrome/browser/chromeos/language_preferences.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/combobox/combobox.h" namespace chromeos { // The combobox model for Language input method prefs. template <typename DataType> -class LanguageComboboxModel : public ComboboxModel { +class LanguageComboboxModel : public ui::ComboboxModel { public: explicit LanguageComboboxModel( const language_prefs::LanguageMultipleChoicePreference<DataType>* @@ -33,12 +33,12 @@ class LanguageComboboxModel : public ComboboxModel { } } - // Implements ComboboxModel interface. + // Implements ui::ComboboxModel interface. virtual int GetItemCount() { return num_items_; } - // Implements ComboboxModel interface. + // Implements ui::ComboboxModel interface. virtual string16 GetItemAt(int index) { if (index < 0 || index >= num_items_) { LOG(ERROR) << "Index is out of bounds: " << index; @@ -79,7 +79,7 @@ class LanguageComboboxModel : public ComboboxModel { // The combobox for the dialog which has minimum width. class LanguageCombobox : public views::Combobox { public: - explicit LanguageCombobox(ComboboxModel* model) : Combobox(model) { + explicit LanguageCombobox(ui::ComboboxModel* model) : Combobox(model) { } virtual gfx::Size GetPreferredSize() { diff --git a/chrome/browser/chromeos/options/language_config_view.cc b/chrome/browser/chromeos/options/language_config_view.cc index c728909..5198ef9 100644 --- a/chrome/browser/chromeos/options/language_config_view.cc +++ b/chrome/browser/chromeos/options/language_config_view.cc @@ -246,7 +246,7 @@ string16 LanguageConfigView::GetText(int row, int column_id) { return string16(); } -void LanguageConfigView::SetObserver(TableModelObserver* observer) { +void LanguageConfigView::SetObserver(ui::TableModelObserver* observer) { // We don't need the observer for the table mode, since we implement the // table model as part of the LanguageConfigView class. // http://crbug.com/38266 diff --git a/chrome/browser/chromeos/options/language_config_view.h b/chrome/browser/chromeos/options/language_config_view.h index b61ca77..08a8083 100644 --- a/chrome/browser/chromeos/options/language_config_view.h +++ b/chrome/browser/chromeos/options/language_config_view.h @@ -10,10 +10,10 @@ #include <set> #include <string> -#include "app/table_model.h" #include "base/compiler_specific.h" #include "chrome/browser/chromeos/options/language_config_model.h" #include "chrome/browser/ui/views/options/options_page_view.h" +#include "ui/base/models/table_model.h" #include "views/controls/button/native_button.h" #include "views/controls/combobox/combobox.h" #include "views/controls/label.h" @@ -29,7 +29,7 @@ class InputMethodCheckbox; class PreferredLanguageTableModel; // A dialog box for configuring the languages. -class LanguageConfigView : public TableModel, +class LanguageConfigView : public ui::TableModel, public views::ButtonListener, public views::Combobox::Listener, public views::DialogDelegate, @@ -66,7 +66,7 @@ class LanguageConfigView : public TableModel, // TODO(satorux): Implement TableModel as a separate class once the bug // is fixed. virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual int RowCount() OVERRIDE; // views::Combobox::Listener overrides: diff --git a/chrome/browser/chromeos/options/language_hangul_config_view.cc b/chrome/browser/chromeos/options/language_hangul_config_view.cc index a7f0b70..3a190aa 100644 --- a/chrome/browser/chromeos/options/language_hangul_config_view.cc +++ b/chrome/browser/chromeos/options/language_hangul_config_view.cc @@ -4,7 +4,6 @@ #include "chrome/browser/chromeos/options/language_hangul_config_view.h" -#include "app/combobox_model.h" #include "app/l10n_util.h" #include "base/string16.h" #include "base/utf_string_conversions.h" @@ -17,6 +16,7 @@ #include "chrome/common/pref_names.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/checkbox.h" #include "views/controls/label.h" #include "views/grid_layout.h" @@ -26,7 +26,7 @@ namespace chromeos { // The combobox model for the list of hangul keyboards. -class HangulKeyboardComboboxModel : public ComboboxModel { +class HangulKeyboardComboboxModel : public ui::ComboboxModel { public: HangulKeyboardComboboxModel() { for (size_t i = 0; i < language_prefs::kNumHangulKeyboardNameIDPairs; @@ -38,12 +38,12 @@ class HangulKeyboardComboboxModel : public ComboboxModel { } } - // Implements ComboboxModel interface. + // Implements ui::ComboboxModel interface. virtual int GetItemCount() { return static_cast<int>(layouts_.size()); } - // Implements ComboboxModel interface. + // Implements ui::ComboboxModel interface. virtual string16 GetItemAt(int index) { if (index < 0 || index > GetItemCount()) { LOG(ERROR) << "Index is out of bounds: " << index; diff --git a/chrome/browser/chromeos/options/system_page_view.cc b/chrome/browser/chromeos/options/system_page_view.cc index a314679..500a1f6 100644 --- a/chrome/browser/chromeos/options/system_page_view.cc +++ b/chrome/browser/chromeos/options/system_page_view.cc @@ -7,7 +7,6 @@ #include <string> #include <vector> -#include "app/combobox_model.h" #include "app/l10n_util.h" #include "base/stl_util-inl.h" #include "base/string16.h" @@ -25,6 +24,7 @@ #include "chrome/browser/profiles/profile.h" #include "chrome/common/pref_names.h" #include "grit/generated_resources.h" +#include "ui/base/models/combobox_model.h" #include "unicode/timezone.h" #include "views/controls/button/checkbox.h" #include "views/controls/button/native_button.h" @@ -59,7 +59,7 @@ class DateTimeSection : public SettingsPageSection, private: // The combobox model for the list of timezones. - class TimezoneComboboxModel : public ComboboxModel { + class TimezoneComboboxModel : public ui::ComboboxModel { public: TimezoneComboboxModel() { // TODO(chocobo): For now, add all the GMT timezones. diff --git a/chrome/browser/chromeos/options/wifi_config_view.h b/chrome/browser/chromeos/options/wifi_config_view.h index 6dbe70e3..ae90d32 100644 --- a/chrome/browser/chromeos/options/wifi_config_view.h +++ b/chrome/browser/chromeos/options/wifi_config_view.h @@ -8,11 +8,11 @@ #include <string> -#include "app/combobox_model.h" #include "base/gtest_prod_util.h" #include "base/string16.h" #include "chrome/browser/chromeos/cros/network_library.h" #include "chrome/browser/shell_dialogs.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/button.h" #include "views/controls/button/checkbox.h" #include "views/controls/button/image_button.h" @@ -72,7 +72,7 @@ class WifiConfigView : public views::View, bool can_login() const { return can_login_; } private: - class SecurityComboboxModel : public ComboboxModel { + class SecurityComboboxModel : public ui::ComboboxModel { public: SecurityComboboxModel() {} virtual ~SecurityComboboxModel() {} diff --git a/chrome/browser/chromeos/status/clock_menu_button.cc b/chrome/browser/chromeos/status/clock_menu_button.cc index 06a666f..44742d8 100644 --- a/chrome/browser/chromeos/status/clock_menu_button.cc +++ b/chrome/browser/chromeos/status/clock_menu_button.cc @@ -80,7 +80,7 @@ void ClockMenuButton::UpdateText() { } //////////////////////////////////////////////////////////////////////////////// -// ClockMenuButton, menus::MenuModel implementation: +// ClockMenuButton, ui::MenuModel implementation: int ClockMenuButton::GetItemCount() const { // If options dialog is unavailable, don't count a separator and configure @@ -88,11 +88,11 @@ int ClockMenuButton::GetItemCount() const { return host_->ShouldOpenButtonOptions(this) ? 3 : 1; } -menus::MenuModel::ItemType ClockMenuButton::GetTypeAt(int index) const { +ui::MenuModel::ItemType ClockMenuButton::GetTypeAt(int index) const { // There's a separator between the current date and the menu item to open // the options menu. - return index == 1 ? menus::MenuModel::TYPE_SEPARATOR: - menus::MenuModel::TYPE_COMMAND; + return index == 1 ? ui::MenuModel::TYPE_SEPARATOR: + ui::MenuModel::TYPE_COMMAND; } string16 ClockMenuButton::GetLabelAt(int index) const { diff --git a/chrome/browser/chromeos/status/clock_menu_button.h b/chrome/browser/chromeos/status/clock_menu_button.h index c1bea3c..67f5916 100644 --- a/chrome/browser/chromeos/status/clock_menu_button.h +++ b/chrome/browser/chromeos/status/clock_menu_button.h @@ -24,29 +24,29 @@ class StatusAreaHost; // This button shows the current time. class ClockMenuButton : public StatusAreaButton, public views::ViewMenuDelegate, - public menus::MenuModel, + public ui::MenuModel, public SystemLibrary::Observer { public: explicit ClockMenuButton(StatusAreaHost* host); virtual ~ClockMenuButton(); - // menus::MenuModel implementation. + // ui::MenuModel implementation. virtual bool HasIcons() const { return false; } virtual int GetItemCount() const; - virtual menus::MenuModel::ItemType GetTypeAt(int index) const; + virtual ui::MenuModel::ItemType GetTypeAt(int index) const; virtual int GetCommandIdAt(int index) const { return index; } virtual string16 GetLabelAt(int index) const; virtual bool IsItemDynamicAt(int index) const { return true; } virtual bool GetAcceleratorAt(int index, - menus::Accelerator* accelerator) const { return false; } + ui::Accelerator* accelerator) const { return false; } virtual bool IsItemCheckedAt(int index) const { return false; } virtual int GetGroupIdAt(int index) const { return 0; } virtual bool GetIconAt(int index, SkBitmap* icon) const { return false; } - virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { return NULL; } virtual bool IsEnabledAt(int index) const; - virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } + virtual ui::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } virtual void HighlightChangedTo(int index) {} virtual void ActivatedAt(int index); virtual void MenuWillShow() {} diff --git a/chrome/browser/chromeos/status/input_method_menu.cc b/chrome/browser/chromeos/status/input_method_menu.cc index c23b70e..6093a2f 100644 --- a/chrome/browser/chromeos/status/input_method_menu.cc +++ b/chrome/browser/chromeos/status/input_method_menu.cc @@ -176,7 +176,7 @@ InputMethodMenu::~InputMethodMenu() { } //////////////////////////////////////////////////////////////////////////////// -// menus::MenuModel implementation: +// ui::MenuModel implementation: int InputMethodMenu::GetCommandIdAt(int index) const { return 0; // dummy @@ -188,7 +188,7 @@ bool InputMethodMenu::IsItemDynamicAt(int index) const { } bool InputMethodMenu::GetAcceleratorAt( - int index, menus::Accelerator* accelerator) const { + int index, ui::Accelerator* accelerator) const { // Views for Chromium OS does not support accelerators yet. return false; } @@ -240,7 +240,7 @@ bool InputMethodMenu::GetIconAt(int index, SkBitmap* icon) const { return false; } -menus::ButtonMenuItemModel* InputMethodMenu::GetButtonMenuItemAt( +ui::ButtonMenuItemModel* InputMethodMenu::GetButtonMenuItemAt( int index) const { return NULL; } @@ -251,7 +251,7 @@ bool InputMethodMenu::IsEnabledAt(int index) const { return true; } -menus::MenuModel* InputMethodMenu::GetSubmenuModelAt(int index) const { +ui::MenuModel* InputMethodMenu::GetSubmenuModelAt(int index) const { // We don't use nested menus. return NULL; } @@ -273,28 +273,28 @@ int InputMethodMenu::GetItemCount() const { return model_->GetItemCount(); } -menus::MenuModel::ItemType InputMethodMenu::GetTypeAt(int index) const { +ui::MenuModel::ItemType InputMethodMenu::GetTypeAt(int index) const { DCHECK_GE(index, 0); if (IndexPointsToConfigureImeMenuItem(index)) { - return menus::MenuModel::TYPE_COMMAND; // "Customize language and input" + return ui::MenuModel::TYPE_COMMAND; // "Customize language and input" } if (IndexIsInInputMethodList(index)) { return is_out_of_box_experience_mode_ ? - menus::MenuModel::TYPE_COMMAND : menus::MenuModel::TYPE_RADIO; + ui::MenuModel::TYPE_COMMAND : ui::MenuModel::TYPE_RADIO; } if (GetPropertyIndex(index, &index)) { const ImePropertyList& property_list = CrosLibrary::Get()->GetInputMethodLibrary()->current_ime_properties(); if (property_list.at(index).is_selection_item) { - return menus::MenuModel::TYPE_RADIO; + return ui::MenuModel::TYPE_RADIO; } - return menus::MenuModel::TYPE_COMMAND; + return ui::MenuModel::TYPE_COMMAND; } - return menus::MenuModel::TYPE_SEPARATOR; + return ui::MenuModel::TYPE_SEPARATOR; } string16 InputMethodMenu::GetLabelAt(int index) const { @@ -439,7 +439,7 @@ void InputMethodMenu::UpdateUIFromInputMethod( } void InputMethodMenu::RebuildModel() { - model_.reset(new menus::SimpleMenuModel(NULL)); + model_.reset(new ui::SimpleMenuModel(NULL)); string16 dummy_label = UTF8ToUTF16(""); // Indicates if separator's needed before each section. bool need_separator = false; @@ -485,7 +485,7 @@ bool InputMethodMenu::IndexIsInInputMethodList(int index) const { return false; } - return ((model_->GetTypeAt(index) == menus::MenuModel::TYPE_RADIO) && + return ((model_->GetTypeAt(index) == ui::MenuModel::TYPE_RADIO) && (model_->GetCommandIdAt(index) == COMMAND_ID_INPUT_METHODS) && input_method_descriptors_.get() && (index < static_cast<int>(input_method_descriptors_->size()))); @@ -499,7 +499,7 @@ bool InputMethodMenu::GetPropertyIndex(int index, int* property_index) const { return false; } - if ((model_->GetTypeAt(index) == menus::MenuModel::TYPE_RADIO) && + if ((model_->GetTypeAt(index) == ui::MenuModel::TYPE_RADIO) && (model_->GetCommandIdAt(index) == COMMAND_ID_IME_PROPERTIES)) { const int tmp_property_index = model_->GetGroupIdAt(index); const ImePropertyList& property_list @@ -519,7 +519,7 @@ bool InputMethodMenu::IndexPointsToConfigureImeMenuItem(int index) const { return false; } - return ((model_->GetTypeAt(index) == menus::MenuModel::TYPE_RADIO) && + return ((model_->GetTypeAt(index) == ui::MenuModel::TYPE_RADIO) && (model_->GetCommandIdAt(index) == COMMAND_ID_CUSTOMIZE_LANGUAGE)); } diff --git a/chrome/browser/chromeos/status/input_method_menu.h b/chrome/browser/chromeos/status/input_method_menu.h index 06c3d14..32e0ec6 100644 --- a/chrome/browser/chromeos/status/input_method_menu.h +++ b/chrome/browser/chromeos/status/input_method_menu.h @@ -8,12 +8,12 @@ #include <string> -#include "app/menus/simple_menu_model.h" #include "chrome/browser/chromeos/cros/input_method_library.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" #include "chrome/common/notification_type.h" +#include "ui/base/models/simple_menu_model.h" #include "views/controls/menu/menu_2.h" #include "views/controls/menu/view_menu_delegate.h" @@ -27,7 +27,7 @@ namespace chromeos { // create a button widget (e.g. views::MenuButton, chromeos::StatusAreaButton) // which shows the dropdown menu on click. class InputMethodMenu : public views::ViewMenuDelegate, - public menus::MenuModel, + public ui::MenuModel, public InputMethodLibrary::Observer, public NotificationObserver { public: @@ -39,21 +39,21 @@ class InputMethodMenu : public views::ViewMenuDelegate, bool is_out_of_box_experience_mode); virtual ~InputMethodMenu(); - // menus::MenuModel implementation. + // ui::MenuModel implementation. virtual bool HasIcons() const; virtual int GetItemCount() const; - virtual menus::MenuModel::ItemType GetTypeAt(int index) const; + virtual ui::MenuModel::ItemType GetTypeAt(int index) const; virtual int GetCommandIdAt(int index) const; virtual string16 GetLabelAt(int index) const; virtual bool IsItemDynamicAt(int index) const; virtual bool GetAcceleratorAt(int index, - menus::Accelerator* accelerator) const; + ui::Accelerator* accelerator) const; virtual bool IsItemCheckedAt(int index) const; virtual int GetGroupIdAt(int index) const; virtual bool GetIconAt(int index, SkBitmap* icon) const; - virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; virtual bool IsEnabledAt(int index) const; - virtual menus::MenuModel* GetSubmenuModelAt(int index) const; + virtual ui::MenuModel* GetSubmenuModelAt(int index) const; virtual void HighlightChangedTo(int index); virtual void ActivatedAt(int index); virtual void MenuWillShow(); @@ -152,10 +152,10 @@ class InputMethodMenu : public views::ViewMenuDelegate, StringPrefMember previous_input_method_pref_; StringPrefMember current_input_method_pref_; - // We borrow menus::SimpleMenuModel implementation to maintain the current - // content of the pop-up menu. The menus::MenuModel is implemented using this + // We borrow ui::SimpleMenuModel implementation to maintain the current + // content of the pop-up menu. The ui::MenuModel is implemented using this // |model_|. - scoped_ptr<menus::SimpleMenuModel> model_; + scoped_ptr<ui::SimpleMenuModel> model_; // The language menu which pops up when the button in status area is clicked. views::Menu2 input_method_menu_; diff --git a/chrome/browser/chromeos/status/network_menu.cc b/chrome/browser/chromeos/status/network_menu.cc index 027de77..66ea92f 100644 --- a/chrome/browser/chromeos/status/network_menu.cc +++ b/chrome/browser/chromeos/status/network_menu.cc @@ -270,13 +270,13 @@ bool NetworkMenu::ConnectToNetworkAt(int index, } //////////////////////////////////////////////////////////////////////////////// -// NetworkMenu, menus::MenuModel implementation: +// NetworkMenu, ui::MenuModel implementation: int NetworkMenu::GetItemCount() const { return static_cast<int>(menu_items_.size()); } -menus::MenuModel::ItemType NetworkMenu::GetTypeAt(int index) const { +ui::MenuModel::ItemType NetworkMenu::GetTypeAt(int index) const { return menu_items_[index].type; } @@ -291,7 +291,7 @@ const gfx::Font* NetworkMenu::GetLabelFontAt(int index) const { } bool NetworkMenu::IsItemCheckedAt(int index) const { - // All menus::MenuModel::TYPE_CHECK menu items are checked. + // All ui::MenuModel::TYPE_CHECK menu items are checked. return true; } @@ -505,7 +505,7 @@ void NetworkMenu::InitMenuItems() { if (ethernet_connecting || ethernet_connected) flag |= FLAG_ASSOCIATED; menu_items_.push_back( - MenuItem(menus::MenuModel::TYPE_COMMAND, label, + MenuItem(ui::MenuModel::TYPE_COMMAND, label, IconForDisplay(icon, badge), std::string(), flag)); } @@ -546,7 +546,7 @@ void NetworkMenu::InitMenuItems() { && wifi_networks[i]->service_path() == active_wifi->service_path()) flag |= FLAG_ASSOCIATED; menu_items_.push_back( - MenuItem(menus::MenuModel::TYPE_COMMAND, label, + MenuItem(ui::MenuModel::TYPE_COMMAND, label, IconForDisplay(icon, badge), wifi_networks[i]->service_path(), flag)); } @@ -607,7 +607,7 @@ void NetworkMenu::InitMenuItems() { if (isActive) flag |= FLAG_ASSOCIATED; menu_items_.push_back( - MenuItem(menus::MenuModel::TYPE_COMMAND, label, + MenuItem(ui::MenuModel::TYPE_COMMAND, label, IconForDisplay(icon, badge), cell_networks[i]->service_path(), flag)); if (isActive) { @@ -622,7 +622,7 @@ void NetworkMenu::InitMenuItems() { } if (label.length()) { menu_items_.push_back( - MenuItem(menus::MenuModel::TYPE_COMMAND, + MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_DISABLED)); } @@ -634,7 +634,7 @@ void NetworkMenu::InitMenuItems() { if (menu_items_.empty()) { label = l10n_util::GetStringFUTF16(IDS_STATUSBAR_NETWORK_MENU_ITEM_INDENT, l10n_util::GetStringUTF16(IDS_STATUSBAR_NO_NETWORKS_MESSAGE)); - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_DISABLED)); } @@ -642,7 +642,7 @@ void NetworkMenu::InitMenuItems() { if (wifi_available && wifi_enabled) { menu_items_.push_back(MenuItem()); // Separator menu_items_.push_back(MenuItem( - menus::MenuModel::TYPE_COMMAND, + ui::MenuModel::TYPE_COMMAND, l10n_util::GetStringUTF16(IDS_OPTIONS_SETTINGS_OTHER_NETWORKS), IconForDisplay(*rb.GetBitmapNamed(IDR_STATUSBAR_NETWORK_BARS0_BLACK), SkBitmap()), @@ -657,7 +657,7 @@ void NetworkMenu::InitMenuItems() { // Add 'Scanning...' if (cros->wifi_scanning()) { label = l10n_util::GetStringUTF16(IDS_STATUSBAR_WIFI_SCANNING_MESSAGE); - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_DISABLED)); } @@ -665,7 +665,7 @@ void NetworkMenu::InitMenuItems() { IDS_STATUSBAR_NETWORK_DEVICE_ENABLE; label = l10n_util::GetStringFUTF16(id, l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_WIFI)); - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_TOGGLE_WIFI)); } @@ -674,7 +674,7 @@ void NetworkMenu::InitMenuItems() { IDS_STATUSBAR_NETWORK_DEVICE_ENABLE; label = l10n_util::GetStringFUTF16(id, l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_DEVICE_CELLULAR)); - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_TOGGLE_CELLULAR)); } } @@ -682,7 +682,7 @@ void NetworkMenu::InitMenuItems() { // Offline mode. // TODO(chocobo): Uncomment once we figure out how to do offline mode. // menu_items_.push_back(MenuItem(cros->offline_mode() ? - // menus::MenuModel::TYPE_CHECK : menus::MenuModel::TYPE_COMMAND, + // ui::MenuModel::TYPE_CHECK : ui::MenuModel::TYPE_COMMAND, // l10n_util::GetStringUTF16(IDS_STATUSBAR_NETWORK_OFFLINE_MODE), // SkBitmap(), std::string(), FLAG_TOGGLE_OFFLINE)); @@ -695,7 +695,7 @@ void NetworkMenu::InitMenuItems() { if (!MenuUI::IsEnabled() && connected) { std::string ip_address = cros->IPAddress(); if (!ip_address.empty()) { - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, ASCIIToUTF16(cros->IPAddress()), SkBitmap(), std::string(), FLAG_DISABLED)); } @@ -704,7 +704,7 @@ void NetworkMenu::InitMenuItems() { label = l10n_util::GetStringUTF16(IsBrowserMode() ? IDS_STATUSBAR_NETWORK_OPEN_OPTIONS_DIALOG : IDS_STATUSBAR_NETWORK_OPEN_PROXY_SETTINGS_DIALOG); - menu_items_.push_back(MenuItem(menus::MenuModel::TYPE_COMMAND, label, + menu_items_.push_back(MenuItem(ui::MenuModel::TYPE_COMMAND, label, SkBitmap(), std::string(), FLAG_OPTIONS)); } } diff --git a/chrome/browser/chromeos/status/network_menu.h b/chrome/browser/chromeos/status/network_menu.h index 4e72ad2..a4b213d 100644 --- a/chrome/browser/chromeos/status/network_menu.h +++ b/chrome/browser/chromeos/status/network_menu.h @@ -9,11 +9,11 @@ #include <string> #include <vector> -#include "app/menus/menu_model.h" #include "chrome/browser/chromeos/options/network_config_view.h" #include "gfx/native_widget_types.h" -#include "views/controls/menu/view_menu_delegate.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/simple_menu_model.h" +#include "views/controls/menu/view_menu_delegate.h" namespace gfx { class Canvas; @@ -49,7 +49,7 @@ namespace chromeos { // <icon> will show the strength of the wifi/cellular networks. // The label will be BOLD if the network is currently connected. class NetworkMenu : public views::ViewMenuDelegate, - public menus::MenuModel { + public ui::MenuModel { public: struct NetworkInfo { NetworkInfo() : @@ -87,24 +87,24 @@ class NetworkMenu : public views::ViewMenuDelegate, const std::string& ssid, int remember) const; - // menus::MenuModel implementation. + // ui::MenuModel implementation. virtual bool HasIcons() const { return true; } virtual int GetItemCount() const; - virtual menus::MenuModel::ItemType GetTypeAt(int index) const; + virtual ui::MenuModel::ItemType GetTypeAt(int index) const; virtual int GetCommandIdAt(int index) const { return index; } virtual string16 GetLabelAt(int index) const; virtual bool IsItemDynamicAt(int index) const { return true; } virtual const gfx::Font* GetLabelFontAt(int index) const; virtual bool GetAcceleratorAt(int index, - menus::Accelerator* accelerator) const { return false; } + ui::Accelerator* accelerator) const { return false; } virtual bool IsItemCheckedAt(int index) const; virtual int GetGroupIdAt(int index) const { return 0; } virtual bool GetIconAt(int index, SkBitmap* icon) const; - virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { return NULL; } virtual bool IsEnabledAt(int index) const; - virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } + virtual ui::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } virtual void HighlightChangedTo(int index) {} virtual void ActivatedAt(int index); virtual void MenuWillShow() {} @@ -164,9 +164,9 @@ class NetworkMenu : public views::ViewMenuDelegate, struct MenuItem { MenuItem() - : type(menus::MenuModel::TYPE_SEPARATOR), + : type(ui::MenuModel::TYPE_SEPARATOR), flags(0) {} - MenuItem(menus::MenuModel::ItemType type, string16 label, SkBitmap icon, + MenuItem(ui::MenuModel::ItemType type, string16 label, SkBitmap icon, const std::string& wireless_path, int flags) : type(type), label(label), @@ -174,7 +174,7 @@ class NetworkMenu : public views::ViewMenuDelegate, wireless_path(wireless_path), flags(flags) {} - menus::MenuModel::ItemType type; + ui::MenuModel::ItemType type; string16 label; SkBitmap icon; std::string wireless_path; diff --git a/chrome/browser/chromeos/status/power_menu_button.cc b/chrome/browser/chromeos/status/power_menu_button.cc index e6adcdc..1ae0d43 100644 --- a/chrome/browser/chromeos/status/power_menu_button.cc +++ b/chrome/browser/chromeos/status/power_menu_button.cc @@ -39,14 +39,14 @@ PowerMenuButton::~PowerMenuButton() { } //////////////////////////////////////////////////////////////////////////////// -// PowerMenuButton, menus::MenuModel implementation: +// PowerMenuButton, ui::MenuModel implementation: int PowerMenuButton::GetItemCount() const { return 2; } -menus::MenuModel::ItemType PowerMenuButton::GetTypeAt(int index) const { - return menus::MenuModel::TYPE_COMMAND; +ui::MenuModel::ItemType PowerMenuButton::GetTypeAt(int index) const { + return ui::MenuModel::TYPE_COMMAND; } string16 PowerMenuButton::GetLabelAt(int index) const { diff --git a/chrome/browser/chromeos/status/power_menu_button.h b/chrome/browser/chromeos/status/power_menu_button.h index d3146ac..79bd1d5 100644 --- a/chrome/browser/chromeos/status/power_menu_button.h +++ b/chrome/browser/chromeos/status/power_menu_button.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_CHROMEOS_STATUS_POWER_MENU_BUTTON_H_ #pragma once -#include "app/menus/menu_model.h" #include "chrome/browser/chromeos/cros/power_library.h" #include "chrome/browser/chromeos/status/status_area_button.h" +#include "ui/base/models/menu_model.h" #include "views/controls/menu/menu_2.h" #include "views/controls/menu/view_menu_delegate.h" @@ -24,29 +24,29 @@ namespace chromeos { // This class will handle getting the power status and populating the menu. class PowerMenuButton : public StatusAreaButton, public views::ViewMenuDelegate, - public menus::MenuModel, + public ui::MenuModel, public PowerLibrary::Observer { public: PowerMenuButton(); virtual ~PowerMenuButton(); - // menus::MenuModel implementation. + // ui::MenuModel implementation. virtual bool HasIcons() const { return false; } virtual int GetItemCount() const; - virtual menus::MenuModel::ItemType GetTypeAt(int index) const; + virtual ui::MenuModel::ItemType GetTypeAt(int index) const; virtual int GetCommandIdAt(int index) const { return index; } virtual string16 GetLabelAt(int index) const; virtual bool IsItemDynamicAt(int index) const { return true; } virtual bool GetAcceleratorAt(int index, - menus::Accelerator* accelerator) const { return false; } + ui::Accelerator* accelerator) const { return false; } virtual bool IsItemCheckedAt(int index) const { return false; } virtual int GetGroupIdAt(int index) const { return 0; } virtual bool GetIconAt(int index, SkBitmap* icon) const { return false; } - virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const { return NULL; } virtual bool IsEnabledAt(int index) const { return false; } - virtual menus::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } + virtual ui::MenuModel* GetSubmenuModelAt(int index) const { return NULL; } virtual void HighlightChangedTo(int index) {} virtual void ActivatedAt(int index) {} virtual void MenuWillShow() {} diff --git a/chrome/browser/chromeos/views/native_menu_domui.cc b/chrome/browser/chromeos/views/native_menu_domui.cc index 5ffb24f..10a2f5c 100644 --- a/chrome/browser/chromeos/views/native_menu_domui.cc +++ b/chrome/browser/chromeos/views/native_menu_domui.cc @@ -6,7 +6,6 @@ #include <string> -#include "app/menus/menu_model.h" #include "base/message_loop.h" #include "base/string_util.h" #include "chrome/browser/chromeos/dom_ui/menu_ui.h" @@ -18,6 +17,7 @@ #include "chrome/browser/ui/browser_window.h" #include "chrome/common/url_constants.h" #include "gfx/rect.h" +#include "ui/base/models/menu_model.h" #include "views/controls/menu/menu_2.h" #include "views/controls/menu/nested_dispatcher_gtk.h" @@ -34,10 +34,10 @@ using chromeos::NativeMenuDOMUI; using chromeos::DOMUIMenuWidget; // Returns true if the menu item type specified can be executed as a command. -bool MenuTypeCanExecute(menus::MenuModel::ItemType type) { - return type == menus::MenuModel::TYPE_COMMAND || - type == menus::MenuModel::TYPE_CHECK || - type == menus::MenuModel::TYPE_RADIO; +bool MenuTypeCanExecute(ui::MenuModel::ItemType type) { + return type == ui::MenuModel::TYPE_COMMAND || + type == ui::MenuModel::TYPE_CHECK || + type == ui::MenuModel::TYPE_RADIO; } gboolean Destroy(GtkWidget* widget, gpointer data) { @@ -85,7 +85,7 @@ void NativeMenuDOMUI::SetMenuURL(views::Menu2* menu2, const GURL& url) { //////////////////////////////////////////////////////////////////////////////// // NativeMenuDOMUI, public: -NativeMenuDOMUI::NativeMenuDOMUI(menus::MenuModel* menu_model, bool root) +NativeMenuDOMUI::NativeMenuDOMUI(ui::MenuModel* menu_model, bool root) : parent_(NULL), submenu_(NULL), model_(menu_model), @@ -263,7 +263,7 @@ base::MessagePumpGlibXDispatcher::DispatchStatus NativeMenuDOMUI::Dispatch( //////////////////////////////////////////////////////////////////////////////// // NativeMenuDOMUI, MenuControl implementation: -void NativeMenuDOMUI::Activate(menus::MenuModel* model, +void NativeMenuDOMUI::Activate(ui::MenuModel* model, int index, ActivationMode activation) { NativeMenuDOMUI* root = GetRoot(); @@ -285,7 +285,7 @@ void NativeMenuDOMUI::Activate(menus::MenuModel* model, void NativeMenuDOMUI::OpenSubmenu(int index, int y) { submenu_.reset(); // Returns the model for the submenu at the specified index. - menus::MenuModel* submenu = model_->GetSubmenuModelAt(index); + ui::MenuModel* submenu = model_->GetSubmenuModelAt(index); submenu_.reset(new chromeos::NativeMenuDOMUI(submenu, false)); submenu_->set_menu_url(menu_url_); // y in menu_widget_ coordinate. @@ -408,7 +408,7 @@ namespace views { // static MenuWrapper* MenuWrapper::CreateWrapper(Menu2* menu) { - menus::MenuModel* model = menu->model(); + ui::MenuModel* model = menu->model(); if (chromeos::MenuUI::IsEnabled()) { return new chromeos::NativeMenuDOMUI(model, true); } else { diff --git a/chrome/browser/chromeos/views/native_menu_domui.h b/chrome/browser/chromeos/views/native_menu_domui.h index 53ef488..7b79d80 100644 --- a/chrome/browser/chromeos/views/native_menu_domui.h +++ b/chrome/browser/chromeos/views/native_menu_domui.h @@ -15,13 +15,13 @@ #include "googleurl/src/gurl.h" #include "views/controls/menu/menu_wrapper.h" -class SkBitmap; class DictionaryValue; class Profile; +class SkBitmap; -namespace menus { +namespace ui { class MenuModel; -} // namespace menus +} // namespace ui namespace views { class NestedDispatcherGtk; @@ -41,7 +41,7 @@ class NativeMenuDOMUI : public views::MenuWrapper, public DOMUIMenuControl, public MessageLoop::Dispatcher { public: - NativeMenuDOMUI(menus::MenuModel* menu_model, bool root); + NativeMenuDOMUI(ui::MenuModel* menu_model, bool root); virtual ~NativeMenuDOMUI(); // Returns true if menu is currently shown. @@ -69,8 +69,8 @@ class NativeMenuDOMUI : public views::MenuWrapper, #endif // Overriden from DOMUIMenuControl; - virtual menus::MenuModel* GetMenuModel() { return model_; } - virtual void Activate(menus::MenuModel* model, + virtual ui::MenuModel* GetMenuModel() { return model_; } + virtual void Activate(ui::MenuModel* model, int index, ActivationMode activation_mode); virtual void CloseAll(); @@ -120,7 +120,7 @@ class NativeMenuDOMUI : public views::MenuWrapper, // Holds the current submenu. scoped_ptr<NativeMenuDOMUI> submenu_; - menus::MenuModel* model_; + ui::MenuModel* model_; // A window widget that draws the content of the menu. DOMUIMenuWidget* menu_widget_; @@ -133,7 +133,7 @@ class NativeMenuDOMUI : public views::MenuWrapper, // it from. When an item is selected menu_activated_ on the root ancestor is // set to the menu the user selected and after the nested message loop exits // Activate is invoked on this menu. - menus::MenuModel* activated_menu_; + ui::MenuModel* activated_menu_; // The index of the item the user selected. This is set on the // actual menu the user selects and not the root. diff --git a/chrome/browser/content_exceptions_table_model.cc b/chrome/browser/content_exceptions_table_model.cc index 6eecfaa..4fae85a 100644 --- a/chrome/browser/content_exceptions_table_model.cc +++ b/chrome/browser/content_exceptions_table_model.cc @@ -5,10 +5,10 @@ #include "chrome/browser/content_exceptions_table_model.h" #include "app/l10n_util.h" -#include "app/table_model_observer.h" #include "base/utf_string_conversions.h" #include "chrome/browser/content_settings/host_content_settings_map.h" #include "grit/generated_resources.h" +#include "ui/base/models/table_model_observer.h" ContentExceptionsTableModel::ContentExceptionsTableModel( HostContentSettingsMap* map, @@ -129,6 +129,7 @@ string16 ContentExceptionsTableModel::GetText(int row, int column_id) { return string16(); } -void ContentExceptionsTableModel::SetObserver(TableModelObserver* observer) { +void ContentExceptionsTableModel::SetObserver( + ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/content_exceptions_table_model.h b/chrome/browser/content_exceptions_table_model.h index a8371fe..b96f9ca 100644 --- a/chrome/browser/content_exceptions_table_model.h +++ b/chrome/browser/content_exceptions_table_model.h @@ -8,14 +8,14 @@ #include <string> -#include "app/table_model.h" #include "base/compiler_specific.h" #include "base/ref_counted.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_types.h" #include "chrome/browser/content_settings/host_content_settings_map.h" +#include "ui/base/models/table_model.h" -class ContentExceptionsTableModel : public TableModel { +class ContentExceptionsTableModel : public ui::TableModel { public: ContentExceptionsTableModel(HostContentSettingsMap* map, HostContentSettingsMap* off_the_record_map, @@ -56,7 +56,7 @@ class ContentExceptionsTableModel : public TableModel { // TableModel overrides: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: HostContentSettingsMap* map(bool is_off_the_record) { @@ -71,7 +71,7 @@ class ContentExceptionsTableModel : public TableModel { ContentSettingsType content_type_; HostContentSettingsMap::SettingsForOneType entries_; HostContentSettingsMap::SettingsForOneType off_the_record_entries_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(ContentExceptionsTableModel); }; diff --git a/chrome/browser/content_setting_combo_model.h b/chrome/browser/content_setting_combo_model.h index 3aec600..274285f 100644 --- a/chrome/browser/content_setting_combo_model.h +++ b/chrome/browser/content_setting_combo_model.h @@ -6,13 +6,12 @@ #define CHROME_BROWSER_CONTENT_SETTING_COMBO_MODEL_H_ #pragma once -#include "app/combobox_model.h" - #include "base/basictypes.h" #include "base/string16.h" #include "chrome/common/content_settings.h" +#include "ui/base/models/combobox_model.h" -class ContentSettingComboModel : public ComboboxModel { +class ContentSettingComboModel : public ui::ComboboxModel { public: explicit ContentSettingComboModel(ContentSettingsType content_type); virtual ~ContentSettingComboModel(); diff --git a/chrome/browser/cookies_tree_model.cc b/chrome/browser/cookies_tree_model.cc index 1615658..a840eb5 100644 --- a/chrome/browser/cookies_tree_model.cc +++ b/chrome/browser/cookies_tree_model.cc @@ -505,7 +505,7 @@ CookiesTreeModel::CookiesTreeModel( BrowsingDataLocalStorageHelper* session_storage_helper, BrowsingDataAppCacheHelper* appcache_helper, BrowsingDataIndexedDBHelper* indexed_db_helper) - : ALLOW_THIS_IN_INITIALIZER_LIST(TreeNodeModel<CookieTreeNode>( + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::TreeNodeModel<CookieTreeNode>( new CookieTreeRootNode(this))), cookie_monster_(cookie_monster), appcache_helper_(appcache_helper), @@ -568,7 +568,7 @@ void CookiesTreeModel::GetIcons(std::vector<SkBitmap>* icons) { // Returns the index of the icon to use for |node|. Return -1 to use the // default icon. The index is relative to the list of icons returned from // GetIcons. -int CookiesTreeModel::GetIconIndex(TreeModelNode* node) { +int CookiesTreeModel::GetIconIndex(ui::TreeModelNode* node) { CookieTreeNode* ct_node = static_cast<CookieTreeNode*>(node); switch (ct_node->GetDetailedInfo().node_type) { case CookieTreeNode::DetailedInfo::TYPE_ORIGIN: @@ -663,13 +663,13 @@ void CookiesTreeModel::UpdateSearchResults(const std::wstring& filter) { void CookiesTreeModel::AddObserver(Observer* observer) { cookies_observer_list_.AddObserver(observer); // Call super so that TreeNodeModel can notify, too. - TreeNodeModel<CookieTreeNode>::AddObserver(observer); + ui::TreeNodeModel<CookieTreeNode>::AddObserver(observer); } void CookiesTreeModel::RemoveObserver(Observer* observer) { cookies_observer_list_.RemoveObserver(observer); // Call super so that TreeNodeModel doesn't have dead pointers. - TreeNodeModel<CookieTreeNode>::RemoveObserver(observer); + ui::TreeNodeModel<CookieTreeNode>::RemoveObserver(observer); } void CookiesTreeModel::OnAppCacheModelInfoLoaded() { diff --git a/chrome/browser/cookies_tree_model.h b/chrome/browser/cookies_tree_model.h index 20b2a71..851f676 100644 --- a/chrome/browser/cookies_tree_model.h +++ b/chrome/browser/cookies_tree_model.h @@ -12,7 +12,6 @@ #include <string> #include <vector> -#include "app/tree_node_model.h" #include "base/observer_list.h" #include "base/ref_counted.h" #include "base/string16.h" @@ -22,6 +21,7 @@ #include "chrome/browser/browsing_data_indexed_db_helper.h" #include "chrome/browser/browsing_data_local_storage_helper.h" #include "net/base/cookie_monster.h" +#include "ui/base/models/tree_node_model.h" class CookiesTreeModel; class CookieTreeAppCacheNode; @@ -43,7 +43,7 @@ class CookieTreeOriginNode; // view, from which all other types are derived. Specialized from TreeNode in // that it has a notion of deleting objects stored in the profile, and being // able to have its children do the same. -class CookieTreeNode : public TreeNode<CookieTreeNode> { +class CookieTreeNode : public ui::TreeNode<CookieTreeNode> { public: // Used to pull out information for the InfoView (the details display below // the tree control.) @@ -131,7 +131,7 @@ class CookieTreeNode : public TreeNode<CookieTreeNode> { CookieTreeNode() {} explicit CookieTreeNode(const string16& title) - : TreeNode<CookieTreeNode>(title) {} + : ui::TreeNode<CookieTreeNode>(title) {} virtual ~CookieTreeNode() {} // Delete backend storage for this node, and any children nodes. (E.g. delete @@ -448,14 +448,14 @@ class CookieTreeIndexedDBsNode : public CookieTreeNode { // CookiesTreeModel ----------------------------------------------------------- -class CookiesTreeModel : public TreeNodeModel<CookieTreeNode> { +class CookiesTreeModel : public ui::TreeNodeModel<CookieTreeNode> { public: // Because non-cookie nodes are fetched in a background thread, they are not // present at the time the Model is created. The Model then notifies its // observers for every item added from databases, local storage, and // appcache. We extend the Observer interface to add notifications before and // after these batch inserts. - class Observer : public TreeModelObserver { + class Observer : public ui::TreeModelObserver { public: virtual void TreeModelBeginBatch(CookiesTreeModel* model) {} virtual void TreeModelEndBatch(CookiesTreeModel* model) {} @@ -470,7 +470,7 @@ class CookiesTreeModel : public TreeNodeModel<CookieTreeNode> { BrowsingDataIndexedDBHelper* indexed_db_helper); virtual ~CookiesTreeModel(); - // TreeModel methods: + // ui::TreeModel methods: // Returns the set of icons for the nodes in the tree. You only need override // this if you don't want to use the default folder icons. virtual void GetIcons(std::vector<SkBitmap>* icons); @@ -478,7 +478,7 @@ class CookiesTreeModel : public TreeNodeModel<CookieTreeNode> { // Returns the index of the icon to use for |node|. Return -1 to use the // default icon. The index is relative to the list of icons returned from // GetIcons. - virtual int GetIconIndex(TreeModelNode* node); + virtual int GetIconIndex(ui::TreeModelNode* node); // CookiesTreeModel methods: void DeleteAllStoredObjects(); diff --git a/chrome/browser/custom_home_pages_table_model.cc b/chrome/browser/custom_home_pages_table_model.cc index f63cf79..c85da26 100644 --- a/chrome/browser/custom_home_pages_table_model.cc +++ b/chrome/browser/custom_home_pages_table_model.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/table_model_observer.h" #include "base/i18n/rtl.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_list.h" @@ -22,6 +21,7 @@ #include "grit/generated_resources.h" #include "net/base/net_util.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/table_model_observer.h" struct CustomHomePagesTableModel::Entry { Entry() : title_handle(0), fav_icon_handle(0) {} @@ -147,7 +147,7 @@ string16 CustomHomePagesTableModel::GetTooltip(int row) { entries_[row].title, FormattedURL(row)); } -void CustomHomePagesTableModel::SetObserver(TableModelObserver* observer) { +void CustomHomePagesTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/custom_home_pages_table_model.h b/chrome/browser/custom_home_pages_table_model.h index 6699fc1..b452e8d 100644 --- a/chrome/browser/custom_home_pages_table_model.h +++ b/chrome/browser/custom_home_pages_table_model.h @@ -9,20 +9,23 @@ #include <string> #include <vector> -#include "app/table_model.h" #include "base/compiler_specific.h" #include "chrome/browser/history/history.h" #include "chrome/browser/favicon_service.h" +#include "ui/base/models/table_model.h" class GURL; class Profile; class SkBitmap; + +namespace ui { class TableModelObserver; +} // CustomHomePagesTableModel is the model for the TableView showing the list // of pages the user wants opened on startup. -class CustomHomePagesTableModel : public TableModel { +class CustomHomePagesTableModel : public ui::TableModel { public: explicit CustomHomePagesTableModel(Profile* profile); virtual ~CustomHomePagesTableModel(); @@ -48,7 +51,7 @@ class CustomHomePagesTableModel : public TableModel { virtual string16 GetText(int row, int column_id) OVERRIDE; virtual SkBitmap GetIcon(int row) OVERRIDE; virtual string16 GetTooltip(int row) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: // Each item in the model is represented as an Entry. Entry stores the URL, @@ -96,7 +99,7 @@ class CustomHomePagesTableModel : public TableModel { // Profile used to load titles and icons. Profile* profile_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; // Used in loading titles and favicons. CancelableRequestConsumer query_consumer_; diff --git a/chrome/browser/default_encoding_combo_model.h b/chrome/browser/default_encoding_combo_model.h index a4d5a50..137fe64 100644 --- a/chrome/browser/default_encoding_combo_model.h +++ b/chrome/browser/default_encoding_combo_model.h @@ -9,17 +9,17 @@ #include <string> #include <vector> -#include "app/combobox_model.h" #include "chrome/browser/character_encoding.h" +#include "ui/base/models/combobox_model.h" class Profile; -class DefaultEncodingComboboxModel : public ComboboxModel { +class DefaultEncodingComboboxModel : public ui::ComboboxModel { public: DefaultEncodingComboboxModel(); virtual ~DefaultEncodingComboboxModel(); - // Overridden from ComboboxModel. + // Overridden from ui::ComboboxModel. virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/dom_ui/options/add_startup_page_handler.h b/chrome/browser/dom_ui/options/add_startup_page_handler.h index 9ca2e2a..8c63338 100644 --- a/chrome/browser/dom_ui/options/add_startup_page_handler.h +++ b/chrome/browser/dom_ui/options/add_startup_page_handler.h @@ -6,15 +6,15 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_ADD_STARTUP_PAGE_HANDLER_H_ #pragma once -#include "app/table_model_observer.h" #include "base/basictypes.h" #include "chrome/browser/dom_ui/options/options_ui.h" +#include "ui/base/models/table_model_observer.h" class PossibleURLModel; // Chrome personal options page UI handler. class AddStartupPageHandler : public OptionsPageUIHandler, - public TableModelObserver { + public ui::TableModelObserver { public: AddStartupPageHandler(); virtual ~AddStartupPageHandler(); @@ -24,7 +24,7 @@ class AddStartupPageHandler : public OptionsPageUIHandler, virtual void GetLocalizedValues(DictionaryValue* localized_strings); virtual void RegisterMessages(); - // TableModelObserver implementation. + // ui::TableModelObserver implementation. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); diff --git a/chrome/browser/dom_ui/options/browser_options_handler.h b/chrome/browser/dom_ui/options/browser_options_handler.h index fd70ccf..3a39d7a 100644 --- a/chrome/browser/dom_ui/options/browser_options_handler.h +++ b/chrome/browser/dom_ui/options/browser_options_handler.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_DOM_UI_OPTIONS_BROWSER_OPTIONS_HANDLER_H_ #pragma once -#include "app/table_model_observer.h" #include "chrome/browser/dom_ui/options/options_ui.h" #include "chrome/browser/search_engines/template_url_model_observer.h" #include "chrome/browser/shell_integration.h" +#include "ui/base/models/table_model_observer.h" class CustomHomePagesTableModel; class OptionsManagedBannerHandler; @@ -19,7 +19,7 @@ class TemplateURLModel; class BrowserOptionsHandler : public OptionsPageUIHandler, public ShellIntegration::DefaultBrowserObserver, public TemplateURLModelObserver, - public TableModelObserver { + public ui::TableModelObserver { public: BrowserOptionsHandler(); virtual ~BrowserOptionsHandler(); @@ -37,7 +37,7 @@ class BrowserOptionsHandler : public OptionsPageUIHandler, // TemplateURLModelObserver implementation. virtual void OnTemplateURLModelChanged(); - // TableModelObserver implementation. + // ui::TableModelObserver implementation. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); diff --git a/chrome/browser/dom_ui/options/cookies_view_handler.cc b/chrome/browser/dom_ui/options/cookies_view_handler.cc index 5cfeb7a..c5f6adc 100644 --- a/chrome/browser/dom_ui/options/cookies_view_handler.cc +++ b/chrome/browser/dom_ui/options/cookies_view_handler.cc @@ -266,8 +266,8 @@ void CookiesViewHandler::RegisterMessages() { NewCallback(this, &CookiesViewHandler::LoadChildren)); } -void CookiesViewHandler::TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, +void CookiesViewHandler::TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { // Skip if there is a batch update in progress. @@ -286,8 +286,8 @@ void CookiesViewHandler::TreeNodesAdded(TreeModel* model, dom_ui_->CallJavascriptFunction(L"CookiesView.onTreeItemAdded", args); } -void CookiesViewHandler::TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, +void CookiesViewHandler::TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { // Skip if there is a batch update in progress. diff --git a/chrome/browser/dom_ui/options/cookies_view_handler.h b/chrome/browser/dom_ui/options/cookies_view_handler.h index b114d37..3ed63ea 100644 --- a/chrome/browser/dom_ui/options/cookies_view_handler.h +++ b/chrome/browser/dom_ui/options/cookies_view_handler.h @@ -20,16 +20,16 @@ class CookiesViewHandler : public OptionsPageUIHandler, virtual void GetLocalizedValues(DictionaryValue* localized_strings); virtual void RegisterMessages(); - // TreeModel::Observer implementation. - virtual void TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, + // ui::TreeModel::Observer implementation. + virtual void TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) {} + virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node) {} virtual void TreeModelBeginBatch(CookiesTreeModel* model); virtual void TreeModelEndBatch(CookiesTreeModel* model); diff --git a/chrome/browser/dom_ui/options/search_engine_manager_handler.cc b/chrome/browser/dom_ui/options/search_engine_manager_handler.cc index 1c211f6..5291c37 100644 --- a/chrome/browser/dom_ui/options/search_engine_manager_handler.cc +++ b/chrome/browser/dom_ui/options/search_engine_manager_handler.cc @@ -141,7 +141,7 @@ void SearchEngineManagerHandler::OnItemsRemoved(int start, int length) { DictionaryValue* SearchEngineManagerHandler::CreateDictionaryForHeading( int group_index) { - TableModel::Groups groups = list_controller_->table_model()->GetGroups(); + ui::TableModel::Groups groups = list_controller_->table_model()->GetGroups(); DictionaryValue* dict = new DictionaryValue(); dict->SetString("heading", groups[group_index].title); diff --git a/chrome/browser/dom_ui/options/search_engine_manager_handler.h b/chrome/browser/dom_ui/options/search_engine_manager_handler.h index f837d38f3..f7e2f7e 100644 --- a/chrome/browser/dom_ui/options/search_engine_manager_handler.h +++ b/chrome/browser/dom_ui/options/search_engine_manager_handler.h @@ -5,14 +5,14 @@ #ifndef CHROME_BROWSER_DOM_UI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ #define CHROME_BROWSER_DOM_UI_OPTIONS_SEARCH_ENGINE_MANAGER_HANDLER_H_ -#include "app/table_model_observer.h" #include "chrome/browser/dom_ui/options/options_ui.h" #include "chrome/browser/search_engines/edit_search_engine_controller.h" +#include "ui/base/models/table_model_observer.h" class KeywordEditorController; class SearchEngineManagerHandler : public OptionsPageUIHandler, - public TableModelObserver, + public ui::TableModelObserver, public EditSearchEngineControllerDelegate { public: SearchEngineManagerHandler(); @@ -23,7 +23,7 @@ class SearchEngineManagerHandler : public OptionsPageUIHandler, // OptionsUIHandler implementation. virtual void GetLocalizedValues(DictionaryValue* localized_strings); - // TableModelObserver implementation. + // ui::TableModelObserver implementation. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); diff --git a/chrome/browser/download/download_shelf.cc b/chrome/browser/download/download_shelf.cc index ff6567a..f8cc58a 100644 --- a/chrome/browser/download/download_shelf.cc +++ b/chrome/browser/download/download_shelf.cc @@ -109,7 +109,7 @@ void DownloadShelfContextMenu::ExecuteCommand(int command_id) { } bool DownloadShelfContextMenu::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, ui::Accelerator* accelerator) { return false; } @@ -118,11 +118,11 @@ bool DownloadShelfContextMenu::IsItemForCommandIdDynamic( return command_id == TOGGLE_PAUSE; } -menus::SimpleMenuModel* DownloadShelfContextMenu::GetInProgressMenuModel() { +ui::SimpleMenuModel* DownloadShelfContextMenu::GetInProgressMenuModel() { if (in_progress_download_menu_model_.get()) return in_progress_download_menu_model_.get(); - in_progress_download_menu_model_.reset(new menus::SimpleMenuModel(this)); + in_progress_download_menu_model_.reset(new ui::SimpleMenuModel(this)); in_progress_download_menu_model_->AddCheckItemWithStringId( OPEN_WHEN_COMPLETE, IDS_DOWNLOAD_MENU_OPEN_WHEN_COMPLETE); @@ -140,11 +140,11 @@ menus::SimpleMenuModel* DownloadShelfContextMenu::GetInProgressMenuModel() { return in_progress_download_menu_model_.get(); } -menus::SimpleMenuModel* DownloadShelfContextMenu::GetFinishedMenuModel() { +ui::SimpleMenuModel* DownloadShelfContextMenu::GetFinishedMenuModel() { if (finished_download_menu_model_.get()) return finished_download_menu_model_.get(); - finished_download_menu_model_.reset(new menus::SimpleMenuModel(this)); + finished_download_menu_model_.reset(new ui::SimpleMenuModel(this)); finished_download_menu_model_->AddItemWithStringId( OPEN_WHEN_COMPLETE, IDS_DOWNLOAD_MENU_OPEN); diff --git a/chrome/browser/download/download_shelf.h b/chrome/browser/download/download_shelf.h index ab565fa..56700d2 100644 --- a/chrome/browser/download/download_shelf.h +++ b/chrome/browser/download/download_shelf.h @@ -6,10 +6,10 @@ #define CHROME_BROWSER_DOWNLOAD_DOWNLOAD_SHELF_H_ #pragma once -#include "app/menus/simple_menu_model.h" #include "base/basictypes.h" #include "base/scoped_ptr.h" #include "base/string16.h" +#include "ui/base/models/simple_menu_model.h" class BaseDownloadItemModel; class Browser; @@ -44,7 +44,7 @@ class DownloadShelf { // Logic for the download shelf context menu. Platform specific subclasses are // responsible for creating and running the menu. -class DownloadShelfContextMenu : public menus::SimpleMenuModel::Delegate { +class DownloadShelfContextMenu : public ui::SimpleMenuModel::Delegate { public: virtual ~DownloadShelfContextMenu(); @@ -62,17 +62,17 @@ class DownloadShelfContextMenu : public menus::SimpleMenuModel::Delegate { protected: explicit DownloadShelfContextMenu(BaseDownloadItemModel* download_model); - menus::SimpleMenuModel* GetInProgressMenuModel(); - menus::SimpleMenuModel* GetFinishedMenuModel(); + ui::SimpleMenuModel* GetInProgressMenuModel(); + ui::SimpleMenuModel* GetFinishedMenuModel(); // Information source. DownloadItem* download_; - // menus::SimpleMenuModel::Delegate implementation: + // ui::SimpleMenuModel::Delegate implementation: virtual bool IsCommandIdEnabled(int command_id) const; virtual bool IsCommandIdChecked(int command_id) const; virtual void ExecuteCommand(int command_id); virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual bool IsItemForCommandIdDynamic(int command_id) const; virtual string16 GetLabelForCommandId(int command_id) const; @@ -82,8 +82,8 @@ class DownloadShelfContextMenu : public menus::SimpleMenuModel::Delegate { private: // We show slightly different menus if the download is in progress vs. if the // download has finished. - scoped_ptr<menus::SimpleMenuModel> in_progress_download_menu_model_; - scoped_ptr<menus::SimpleMenuModel> finished_download_menu_model_; + scoped_ptr<ui::SimpleMenuModel> in_progress_download_menu_model_; + scoped_ptr<ui::SimpleMenuModel> finished_download_menu_model_; DISALLOW_COPY_AND_ASSIGN(DownloadShelfContextMenu); }; diff --git a/chrome/browser/extensions/extension_context_menu_browsertest.cc b/chrome/browser/extensions/extension_context_menu_browsertest.cc index 90479a7..65515e9 100644 --- a/chrome/browser/extensions/extension_context_menu_browsertest.cc +++ b/chrome/browser/extensions/extension_context_menu_browsertest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/menus/menu_model.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/browser_list.h" @@ -16,9 +15,10 @@ #include "chrome/test/ui_test_utils.h" #include "net/base/mock_host_resolver.h" #include "third_party/WebKit/WebKit/chromium/public/WebContextMenuData.h" +#include "ui/base/models/menu_model.h" #include "webkit/glue/context_menu.h" -using menus::MenuModel; +using ui::MenuModel; using WebKit::WebContextMenuData; // This test class helps us sidestep platform-specific issues with popping up a @@ -92,7 +92,7 @@ class TestRenderViewContextMenu : public RenderViewContextMenu { // These two functions implement pure virtual methods of // RenderViewContextMenu. virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { // None of our commands have accelerators, so always return false. return false; } diff --git a/chrome/browser/extensions/extension_context_menu_model.cc b/chrome/browser/extensions/extension_context_menu_model.cc index 70d4189..3dd09b2 100644 --- a/chrome/browser/extensions/extension_context_menu_model.cc +++ b/chrome/browser/extensions/extension_context_menu_model.cc @@ -96,7 +96,7 @@ bool ExtensionContextMenuModel::IsCommandIdEnabled(int command_id) const { } bool ExtensionContextMenuModel::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/extensions/extension_context_menu_model.h b/chrome/browser/extensions/extension_context_menu_model.h index b1fe0af..34f8e48 100644 --- a/chrome/browser/extensions/extension_context_menu_model.h +++ b/chrome/browser/extensions/extension_context_menu_model.h @@ -8,8 +8,8 @@ #include <string> -#include "app/menus/simple_menu_model.h" #include "chrome/browser/extensions/extension_install_ui.h" +#include "ui/base/models/simple_menu_model.h" class Browser; class Extension; @@ -20,8 +20,8 @@ class Profile; // page actions). class ExtensionContextMenuModel : public base::RefCounted<ExtensionContextMenuModel>, - public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate, public ExtensionInstallUI::Delegate { public: // Delegate to handle showing an ExtensionAction popup. @@ -48,7 +48,7 @@ class ExtensionContextMenuModel virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // ExtensionInstallUI::Delegate overrides. diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model.cc b/chrome/browser/geolocation/geolocation_exceptions_table_model.cc index 9bd57fe..c642657 100644 --- a/chrome/browser/geolocation/geolocation_exceptions_table_model.cc +++ b/chrome/browser/geolocation/geolocation_exceptions_table_model.cc @@ -6,11 +6,11 @@ #include "app/l10n_util.h" #include "app/l10n_util_collator.h" -#include "app/table_model_observer.h" #include "base/utf_string_conversions.h" #include "chrome/common/content_settings_helper.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" +#include "ui/base/models/table_model_observer.h" namespace { // Return -1, 0, or 1 depending on whether |origin1| should be sorted before, @@ -180,7 +180,7 @@ string16 GeolocationExceptionsTableModel::GetText(int row, } void GeolocationExceptionsTableModel::SetObserver( - TableModelObserver* observer) { + ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/geolocation/geolocation_exceptions_table_model.h b/chrome/browser/geolocation/geolocation_exceptions_table_model.h index d1223e6..0617b46 100644 --- a/chrome/browser/geolocation/geolocation_exceptions_table_model.h +++ b/chrome/browser/geolocation/geolocation_exceptions_table_model.h @@ -40,7 +40,7 @@ class GeolocationExceptionsTableModel : public RemoveRowsTableModel { // TableModel overrides: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; private: @@ -54,7 +54,7 @@ class GeolocationExceptionsTableModel : public RemoveRowsTableModel { typedef std::vector<Entry> EntriesVector; EntriesVector entries_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(GeolocationExceptionsTableModel); }; diff --git a/chrome/browser/history/starred_url_database.h b/chrome/browser/history/starred_url_database.h index aab2ae5..aff2d64 100644 --- a/chrome/browser/history/starred_url_database.h +++ b/chrome/browser/history/starred_url_database.h @@ -8,12 +8,12 @@ #include <set> -#include "app/tree_node_model.h" #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/string16.h" #include "chrome/browser/history/history_types.h" #include "chrome/browser/history/url_database.h" +#include "ui/base/models/tree_node_model.h" class FilePath; @@ -115,7 +115,7 @@ class StarredURLDatabase : public URLDatabase { StarID CreateStarredEntry(StarredEntry* entry); // Used when checking integrity of starred table. - typedef TreeNodeWithValue<history::StarredEntry> StarredNode; + typedef ui::TreeNodeWithValue<history::StarredEntry> StarredNode; // Returns the max group id, or 0 if there is an error. UIStarID GetMaxGroupID(); diff --git a/chrome/browser/language_combobox_model.h b/chrome/browser/language_combobox_model.h index 7844311..a88b380 100644 --- a/chrome/browser/language_combobox_model.h +++ b/chrome/browser/language_combobox_model.h @@ -10,9 +10,9 @@ #include <string> #include <vector> -#include "app/combobox_model.h" #include "base/basictypes.h" #include "base/string16.h" +#include "ui/base/models/combobox_model.h" class Profile; @@ -68,7 +68,7 @@ class LanguageList { /////////////////////////////////////////////////////////////////////////////// // LanguageComboboxModel // The combobox model implementation. -class LanguageComboboxModel : public LanguageList, public ComboboxModel { +class LanguageComboboxModel : public LanguageList, public ui::ComboboxModel { public: LanguageComboboxModel(); diff --git a/chrome/browser/language_order_table_model.cc b/chrome/browser/language_order_table_model.cc index 90501d8..b1d0450 100644 --- a/chrome/browser/language_order_table_model.cc +++ b/chrome/browser/language_order_table_model.cc @@ -7,10 +7,10 @@ #include <set> #include "app/l10n_util.h" -#include "app/table_model_observer.h" #include "base/string_split.h" #include "base/utf_string_conversions.h" #include "chrome/browser/browser_process.h" +#include "ui/base/models/table_model_observer.h" LanguageOrderTableModel::LanguageOrderTableModel() : observer_(NULL) { @@ -35,7 +35,7 @@ void LanguageOrderTableModel::SetAcceptLanguagesString( observer_->OnModelChanged(); } -void LanguageOrderTableModel::SetObserver(TableModelObserver* observer) { +void LanguageOrderTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/language_order_table_model.h b/chrome/browser/language_order_table_model.h index d23f638..a3aa8a3 100644 --- a/chrome/browser/language_order_table_model.h +++ b/chrome/browser/language_order_table_model.h @@ -9,13 +9,15 @@ #include <string> #include <vector> -#include "app/table_model.h" #include "base/basictypes.h" #include "base/compiler_specific.h" +#include "ui/base/models/table_model.h" +namespace ui { class TableModelObserver; +} -class LanguageOrderTableModel : public TableModel { +class LanguageOrderTableModel : public ui::TableModel { public: LanguageOrderTableModel(); @@ -46,14 +48,14 @@ class LanguageOrderTableModel : public TableModel { // TableModel overrides: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: // Set of entries we're showing. std::vector<std::string> languages_; std::string comma_separated_language_list_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(LanguageOrderTableModel); }; diff --git a/chrome/browser/notifications/notification_exceptions_table_model.cc b/chrome/browser/notifications/notification_exceptions_table_model.cc index e70536c..55a82bb 100644 --- a/chrome/browser/notifications/notification_exceptions_table_model.cc +++ b/chrome/browser/notifications/notification_exceptions_table_model.cc @@ -5,7 +5,6 @@ #include "chrome/browser/notifications/notification_exceptions_table_model.h" #include "app/l10n_util.h" -#include "app/table_model_observer.h" #include "base/auto_reset.h" #include "chrome/common/content_settings.h" #include "chrome/common/content_settings_helper.h" @@ -14,6 +13,7 @@ #include "chrome/common/notification_type.h" #include "chrome/common/url_constants.h" #include "grit/generated_resources.h" +#include "ui/base/models/table_model_observer.h" struct NotificationExceptionsTableModel::Entry { Entry(const GURL& origin, ContentSetting setting); @@ -93,7 +93,7 @@ string16 NotificationExceptionsTableModel::GetText(int row, } void NotificationExceptionsTableModel::SetObserver( - TableModelObserver* observer) { + ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/notifications/notification_exceptions_table_model.h b/chrome/browser/notifications/notification_exceptions_table_model.h index de19963..c9e2100 100644 --- a/chrome/browser/notifications/notification_exceptions_table_model.h +++ b/chrome/browser/notifications/notification_exceptions_table_model.h @@ -28,7 +28,7 @@ class NotificationExceptionsTableModel : public RemoveRowsTableModel, // Overridden from TableModel: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; // Overridden from NotificationObserver: virtual void Observe(NotificationType type, @@ -48,7 +48,7 @@ class NotificationExceptionsTableModel : public RemoveRowsTableModel, // that we ourselves caused. bool updates_disabled_; NotificationRegistrar registrar_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(NotificationExceptionsTableModel); }; diff --git a/chrome/browser/notifications/notification_options_menu_model.cc b/chrome/browser/notifications/notification_options_menu_model.cc index fb05bda..4d4530e 100644 --- a/chrome/browser/notifications/notification_options_menu_model.cc +++ b/chrome/browser/notifications/notification_options_menu_model.cc @@ -41,7 +41,7 @@ const int kCornerLowerRight = 14; const int kCornerDefault = 20; CornerSelectionMenuModel::CornerSelectionMenuModel(Balloon* balloon) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), balloon_(balloon) { AddRadioItem(kCornerDefault, l10n_util::GetStringUTF16(IDS_NOTIFICATION_POSITION_DEFAULT), @@ -91,7 +91,7 @@ bool CornerSelectionMenuModel::IsCommandIdEnabled(int command_id) const { } bool CornerSelectionMenuModel::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, ui::Accelerator* accelerator) { // Currently no accelerators. return false; } @@ -116,7 +116,7 @@ void CornerSelectionMenuModel::ExecuteCommand(int command_id) { } NotificationOptionsMenuModel::NotificationOptionsMenuModel(Balloon* balloon) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), balloon_(balloon) { const Notification& notification = balloon->notification(); @@ -205,7 +205,7 @@ bool NotificationOptionsMenuModel::IsCommandIdEnabled(int /* command_id */) } bool NotificationOptionsMenuModel::GetAcceleratorForCommandId( - int /* command_id */, menus::Accelerator* /* accelerator */) { + int /* command_id */, ui::Accelerator* /* accelerator */) { // Currently no accelerators. return false; } diff --git a/chrome/browser/notifications/notification_options_menu_model.h b/chrome/browser/notifications/notification_options_menu_model.h index 022b7e0..033f360 100644 --- a/chrome/browser/notifications/notification_options_menu_model.h +++ b/chrome/browser/notifications/notification_options_menu_model.h @@ -6,21 +6,21 @@ #define CHROME_BROWSER_NOTIFICATIONS_NOTIFICATION_OPTIONS_MENU_MODEL_H_ #pragma once -#include "app/menus/simple_menu_model.h" #include "chrome/browser/notifications/balloon.h" +#include "ui/base/models/simple_menu_model.h" // Model for the corner-selection submenu. -class CornerSelectionMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate { +class CornerSelectionMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate { public: explicit CornerSelectionMenuModel(Balloon* balloon); virtual ~CornerSelectionMenuModel(); - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); private: @@ -31,21 +31,21 @@ class CornerSelectionMenuModel : public menus::SimpleMenuModel, }; // Model for the notification options menu itself. -class NotificationOptionsMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate { +class NotificationOptionsMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate { public: explicit NotificationOptionsMenuModel(Balloon* balloon); virtual ~NotificationOptionsMenuModel(); - // Overridden from menus::SimpleMenuModel: + // Overridden from ui::SimpleMenuModel: virtual bool IsItemForCommandIdDynamic(int command_id) const; virtual string16 GetLabelForCommandId(int command_id) const; - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); private: diff --git a/chrome/browser/plugin_exceptions_table_model.cc b/chrome/browser/plugin_exceptions_table_model.cc index a8cc464..f42289a 100644 --- a/chrome/browser/plugin_exceptions_table_model.cc +++ b/chrome/browser/plugin_exceptions_table_model.cc @@ -5,12 +5,12 @@ #include "chrome/browser/plugin_exceptions_table_model.h" #include "app/l10n_util.h" -#include "app/table_model_observer.h" #include "base/auto_reset.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" +#include "ui/base/models/table_model_observer.h" PluginExceptionsTableModel::PluginExceptionsTableModel( HostContentSettingsMap* content_settings_map, @@ -106,11 +106,11 @@ bool PluginExceptionsTableModel::HasGroups() { return true; } -void PluginExceptionsTableModel::SetObserver(TableModelObserver* observer) { +void PluginExceptionsTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } -TableModel::Groups PluginExceptionsTableModel::GetGroups() { +ui::TableModel::Groups PluginExceptionsTableModel::GetGroups() { return groups_; } diff --git a/chrome/browser/plugin_exceptions_table_model.h b/chrome/browser/plugin_exceptions_table_model.h index 009ab35..620a173 100644 --- a/chrome/browser/plugin_exceptions_table_model.h +++ b/chrome/browser/plugin_exceptions_table_model.h @@ -37,7 +37,7 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, // TableModel methods: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual bool HasGroups() OVERRIDE; virtual Groups GetGroups() OVERRIDE; virtual int GetGroupID(int row) OVERRIDE; @@ -75,7 +75,7 @@ class PluginExceptionsTableModel : public RemoveRowsTableModel, NotificationRegistrar registrar_; bool updates_disabled_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(PluginExceptionsTableModel); }; diff --git a/chrome/browser/plugin_exceptions_table_model_unittest.cc b/chrome/browser/plugin_exceptions_table_model_unittest.cc index 6e5a19c..18bd3bc 100644 --- a/chrome/browser/plugin_exceptions_table_model_unittest.cc +++ b/chrome/browser/plugin_exceptions_table_model_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/table_model_observer.h" #include "base/auto_reset.h" #include "base/command_line.h" #include "base/utf_string_conversions.h" @@ -12,6 +11,7 @@ #include "chrome/test/testing_profile.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/models/table_model_observer.h" #include "webkit/plugins/npapi/plugin_group.h" #include "webkit/plugins/npapi/webplugininfo.h" @@ -22,9 +22,9 @@ namespace plugin_test_internal { using ::testing::_; using ::testing::Invoke; -class MockTableModelObserver : public TableModelObserver { +class MockTableModelObserver : public ui::TableModelObserver { public: - explicit MockTableModelObserver(TableModel* model) + explicit MockTableModelObserver(ui::TableModel* model) : model_(model) { ON_CALL(*this, OnItemsRemoved(_, _)) .WillByDefault( @@ -45,7 +45,7 @@ class MockTableModelObserver : public TableModelObserver { EXPECT_LT(start, model_->RowCount() + 1); } - TableModel* model_; + ui::TableModel* model_; }; } // namespace plugin_test_internal @@ -111,7 +111,7 @@ class PluginExceptionsTableModelTest : public testing::Test { Entries& settings = table_model_->settings_; std::deque<int>& row_counts = table_model_->row_counts_; std::deque<std::string>& resources = table_model_->resources_; - TableModel::Groups& groups = table_model_->groups_; + ui::TableModel::Groups& groups = table_model_->groups_; EXPECT_EQ(groups.size(), row_counts.size()); EXPECT_EQ(groups.size(), resources.size()); diff --git a/chrome/browser/possible_url_model.cc b/chrome/browser/possible_url_model.cc index 31bfd2b..e5af97e 100644 --- a/chrome/browser/possible_url_model.cc +++ b/chrome/browser/possible_url_model.cc @@ -5,7 +5,6 @@ #include "chrome/browser/possible_url_model.h" #include "app/resource_bundle.h" -#include "app/table_model_observer.h" #include "app/text_elider.h" #include "base/callback.h" #include "base/i18n/rtl.h" @@ -20,6 +19,7 @@ #include "grit/app_resources.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/table_model_observer.h" using base::Time; using base::TimeDelta; @@ -180,7 +180,7 @@ int PossibleURLModel::CompareValues(int row1, int row2, int column_id) { return results_[row1].display_url.Compare( results_[row2].display_url, GetCollator()); } - return TableModel::CompareValues(row1, row2, column_id); + return ui::TableModel::CompareValues(row1, row2, column_id); } void PossibleURLModel::OnFavIconAvailable( @@ -205,6 +205,6 @@ void PossibleURLModel::OnFavIconAvailable( } } -void PossibleURLModel::SetObserver(TableModelObserver* observer) { +void PossibleURLModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/possible_url_model.h b/chrome/browser/possible_url_model.h index 8bd61c6..338a4e2 100644 --- a/chrome/browser/possible_url_model.h +++ b/chrome/browser/possible_url_model.h @@ -10,9 +10,9 @@ #include <string> #include <vector> -#include "app/table_model.h" #include "base/compiler_specific.h" #include "chrome/browser/history/history.h" +#include "ui/base/models/table_model.h" class SkBitmap; @@ -23,7 +23,7 @@ class SkBitmap; // //////////////////////////////////////////////////////////////////////////////// -class PossibleURLModel : public TableModel { +class PossibleURLModel : public ui::TableModel { public: PossibleURLModel(); virtual ~PossibleURLModel(); @@ -47,14 +47,14 @@ class PossibleURLModel : public TableModel { virtual string16 GetText(int row, int col_id) OVERRIDE; virtual SkBitmap GetIcon(int row) OVERRIDE; virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: // The current profile. Profile* profile_; // Our observer. - TableModelObserver* observer_; + ui::TableModelObserver* observer_; // Our consumer for favicon requests. CancelableRequestConsumerT<size_t, NULL> consumer_; diff --git a/chrome/browser/remove_rows_table_model.h b/chrome/browser/remove_rows_table_model.h index fbab776..cf1f479 100644 --- a/chrome/browser/remove_rows_table_model.h +++ b/chrome/browser/remove_rows_table_model.h @@ -8,11 +8,11 @@ #include <set> -#include "app/table_model.h" +#include "ui/base/models/table_model.h" // A table model that also supports removing rows. Used for example for the // content settings exception dialog for geolocation. -class RemoveRowsTableModel : public TableModel { +class RemoveRowsTableModel : public ui::TableModel { public: typedef std::set<size_t> Rows; diff --git a/chrome/browser/search_engines/keyword_editor_controller_unittest.cc b/chrome/browser/search_engines/keyword_editor_controller_unittest.cc index 4952166..e59af22 100644 --- a/chrome/browser/search_engines/keyword_editor_controller_unittest.cc +++ b/chrome/browser/search_engines/keyword_editor_controller_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/table_model_observer.h" #include "base/string16.h" #include "base/utf_string_conversions.h" #include "chrome/browser/profiles/profile.h" @@ -16,6 +15,7 @@ #include "chrome/test/testing_pref_service.h" #include "chrome/test/testing_profile.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/models/table_model_observer.h" static const string16 kA(ASCIIToUTF16("a")); static const string16 kA1(ASCIIToUTF16("a1")); @@ -25,7 +25,7 @@ static const string16 kB1(ASCIIToUTF16("b1")); // Base class for keyword editor tests. Creates a profile containing an // empty TemplateURLModel. class KeywordEditorControllerTest : public testing::Test, - public TableModelObserver { + public ui::TableModelObserver { public: // Initializes all of the state. void Init(bool simulate_load_failure); diff --git a/chrome/browser/search_engines/template_url_table_model.cc b/chrome/browser/search_engines/template_url_table_model.cc index 12189f1..453b98d 100644 --- a/chrome/browser/search_engines/template_url_table_model.cc +++ b/chrome/browser/search_engines/template_url_table_model.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/table_model_observer.h" #include "base/callback.h" #include "base/i18n/rtl.h" #include "base/stl_util-inl.h" @@ -19,6 +18,7 @@ #include "grit/app_resources.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/table_model_observer.h" // Group IDs used by TemplateURLTableModel. static const int kMainGroupID = 0; @@ -211,7 +211,7 @@ SkBitmap TemplateURLTableModel::GetIcon(int row) { return entries_[row]->GetIcon(); } -void TemplateURLTableModel::SetObserver(TableModelObserver* observer) { +void TemplateURLTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/search_engines/template_url_table_model.h b/chrome/browser/search_engines/template_url_table_model.h index 95ca739..7a0d42b 100644 --- a/chrome/browser/search_engines/template_url_table_model.h +++ b/chrome/browser/search_engines/template_url_table_model.h @@ -9,10 +9,10 @@ #include <string> #include <vector> -#include "app/table_model.h" #include "base/compiler_specific.h" #include "base/string16.h" #include "chrome/browser/search_engines/template_url_model_observer.h" +#include "ui/base/models/table_model.h" class ModelEntry; class SkBitmap; @@ -30,7 +30,7 @@ class TemplateURLModel; // the favicon. The entries in the model are sorted such that non-generated // appear first (grouped together) and are followed by generated keywords. -class TemplateURLTableModel : public TableModel, +class TemplateURLTableModel : public ui::TableModel, TemplateURLModelObserver { public: explicit TemplateURLTableModel(TemplateURLModel* template_url_model); @@ -41,11 +41,11 @@ class TemplateURLTableModel : public TableModel, // if the TemplateURLModel wasn't initially loaded and has been loaded. void Reload(); - // TableModel overrides. + // ui::TableModel overrides. virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column) OVERRIDE; virtual SkBitmap GetIcon(int row) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual bool HasGroups() OVERRIDE; virtual Groups GetGroups() OVERRIDE; virtual int GetGroupID(int row) OVERRIDE; @@ -98,7 +98,7 @@ class TemplateURLTableModel : public TableModel, // TemplateURLModelObserver notification. virtual void OnTemplateURLModelChanged(); - TableModelObserver* observer_; + ui::TableModelObserver* observer_; // The entries. std::vector<ModelEntry*> entries_; diff --git a/chrome/browser/status_icons/status_icon.cc b/chrome/browser/status_icons/status_icon.cc index baaa6cc..f018842 100644 --- a/chrome/browser/status_icons/status_icon.cc +++ b/chrome/browser/status_icons/status_icon.cc @@ -4,7 +4,7 @@ #include "chrome/browser/status_icons/status_icon.h" -#include "app/menus/menu_model.h" +#include "ui/base/models/menu_model.h" StatusIcon::StatusIcon() { @@ -29,7 +29,7 @@ void StatusIcon::DispatchClickEvent() { FOR_EACH_OBSERVER(Observer, observers_, OnClicked()); } -void StatusIcon::SetContextMenu(menus::MenuModel* menu) { +void StatusIcon::SetContextMenu(ui::MenuModel* menu) { context_menu_contents_.reset(menu); UpdatePlatformContextMenu(menu); } diff --git a/chrome/browser/status_icons/status_icon.h b/chrome/browser/status_icons/status_icon.h index 5398eb3..3b53dc5 100644 --- a/chrome/browser/status_icons/status_icon.h +++ b/chrome/browser/status_icons/status_icon.h @@ -12,7 +12,7 @@ class SkBitmap; -namespace menus { +namespace ui { class MenuModel; } @@ -32,7 +32,7 @@ class StatusIcon { // Set the context menu for this icon. The icon takes ownership of the passed // context menu. Passing NULL results in no menu at all. - void SetContextMenu(menus::MenuModel* menu); + void SetContextMenu(ui::MenuModel* menu); class Observer { public: @@ -63,12 +63,12 @@ class StatusIcon { // Invoked after a call to SetContextMenu() to let the platform-specific // subclass update the native context menu based on the new model. If NULL is // passed, subclass should destroy the native context menu. - virtual void UpdatePlatformContextMenu(menus::MenuModel* model) = 0; + virtual void UpdatePlatformContextMenu(ui::MenuModel* model) = 0; private: ObserverList<Observer> observers_; // Context menu, if any. - scoped_ptr<menus::MenuModel> context_menu_contents_; + scoped_ptr<ui::MenuModel> context_menu_contents_; DISALLOW_COPY_AND_ASSIGN(StatusIcon); }; diff --git a/chrome/browser/status_icons/status_icon_unittest.cc b/chrome/browser/status_icons/status_icon_unittest.cc index 48fbc20..a3a2596 100644 --- a/chrome/browser/status_icons/status_icon_unittest.cc +++ b/chrome/browser/status_icons/status_icon_unittest.cc @@ -18,7 +18,7 @@ class TestStatusIcon : public StatusIcon { virtual void SetImage(const SkBitmap& image) {} virtual void SetPressedImage(const SkBitmap& image) {} virtual void SetToolTip(const string16& tool_tip) {} - virtual void UpdatePlatformContextMenu(menus::MenuModel* menu) {} + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) {} }; TEST(StatusIconTest, ObserverAdd) { diff --git a/chrome/browser/status_icons/status_tray_unittest.cc b/chrome/browser/status_icons/status_tray_unittest.cc index a047689..61555f9 100644 --- a/chrome/browser/status_icons/status_tray_unittest.cc +++ b/chrome/browser/status_icons/status_tray_unittest.cc @@ -15,7 +15,7 @@ class MockStatusIcon : public StatusIcon { virtual void SetImage(const SkBitmap& image) {} virtual void SetPressedImage(const SkBitmap& image) {} virtual void SetToolTip(const string16& tool_tip) {} - virtual void UpdatePlatformContextMenu(menus::MenuModel* menu) {} + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu) {} virtual void AddObserver(StatusIcon::Observer* observer) {} virtual void RemoveObserver(StatusIcon::Observer* observer) {} }; @@ -23,7 +23,7 @@ class MockStatusIcon : public StatusIcon { class TestStatusTray : public StatusTray { public: MOCK_METHOD0(CreatePlatformStatusIcon, StatusIcon*()); - MOCK_METHOD1(UpdatePlatformContextMenu, void(menus::MenuModel*)); + MOCK_METHOD1(UpdatePlatformContextMenu, void(ui::MenuModel*)); }; TEST(StatusTrayTest, Create) { diff --git a/chrome/browser/tab_contents/render_view_context_menu.cc b/chrome/browser/tab_contents/render_view_context_menu.cc index 5426791..cf826bd 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.cc +++ b/chrome/browser/tab_contents/render_view_context_menu.cc @@ -230,7 +230,7 @@ void RenderViewContextMenu::AppendExtensionItems( if (submenu_items.empty()) { menu_model_.AddItem(menu_id, title); } else { - menus::SimpleMenuModel* submenu = new menus::SimpleMenuModel(this); + ui::SimpleMenuModel* submenu = new ui::SimpleMenuModel(this); extension_menu_models_.push_back(submenu); menu_model_.AddSubMenu(menu_id, title, submenu); RecursivelyAppendExtensionItems(submenu_items, can_cross_incognito, submenu, @@ -242,7 +242,7 @@ void RenderViewContextMenu::AppendExtensionItems( void RenderViewContextMenu::RecursivelyAppendExtensionItems( const ExtensionMenuItem::List& items, bool can_cross_incognito, - menus::SimpleMenuModel* menu_model, + ui::SimpleMenuModel* menu_model, int *index) { string16 selection_text = PrintableSelectionText(); ExtensionMenuItem::Type last_type = ExtensionMenuItem::NORMAL; @@ -273,7 +273,7 @@ void RenderViewContextMenu::RecursivelyAppendExtensionItems( if (children.size() == 0) { menu_model->AddItem(menu_id, title); } else { - menus::SimpleMenuModel* submenu = new menus::SimpleMenuModel(this); + ui::SimpleMenuModel* submenu = new ui::SimpleMenuModel(this); extension_menu_models_.push_back(submenu); menu_model->AddSubMenu(menu_id, title, submenu); RecursivelyAppendExtensionItems(children, can_cross_incognito, diff --git a/chrome/browser/tab_contents/render_view_context_menu.h b/chrome/browser/tab_contents/render_view_context_menu.h index 2f1a83e..ac10e8c 100644 --- a/chrome/browser/tab_contents/render_view_context_menu.h +++ b/chrome/browser/tab_contents/render_view_context_menu.h @@ -10,11 +10,11 @@ #include <string> #include <vector> -#include "app/menus/simple_menu_model.h" #include "base/string16.h" #include "base/scoped_vector.h" #include "chrome/common/page_transition_types.h" #include "chrome/browser/extensions/extension_menu_manager.h" +#include "ui/base/models/simple_menu_model.h" #include "webkit/glue/context_menu.h" #include "webkit/glue/window_open_disposition.h" @@ -30,7 +30,7 @@ namespace WebKit { struct WebMediaPlayerAction; } -class RenderViewContextMenu : public menus::SimpleMenuModel::Delegate { +class RenderViewContextMenu : public ui::SimpleMenuModel::Delegate { public: static const size_t kMaxExtensionItemTitleLength; static const size_t kMaxSelectionTextLength; @@ -55,7 +55,7 @@ class RenderViewContextMenu : public menus::SimpleMenuModel::Delegate { virtual void PlatformInit() = 0; virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) = 0; + ui::Accelerator* accelerator) = 0; virtual void LookUpInDictionary(); // Attempts to get an ExtensionMenuItem given the id of a context menu item. @@ -65,7 +65,7 @@ class RenderViewContextMenu : public menus::SimpleMenuModel::Delegate { TabContents* source_tab_contents_; Profile* profile_; - menus::SimpleMenuModel menu_model_; + ui::SimpleMenuModel menu_model_; // True if we are showing for an external tab contents. The default is false. bool external_; @@ -104,7 +104,7 @@ class RenderViewContextMenu : public menus::SimpleMenuModel::Delegate { void RecursivelyAppendExtensionItems( const std::vector<ExtensionMenuItem*>& items, bool can_cross_incognito, - menus::SimpleMenuModel* menu_model, + ui::SimpleMenuModel* menu_model, int *index); // This will set the icon on the most recently-added item in the menu_model_. void SetExtensionIcon(const std::string& extension_id); @@ -137,9 +137,9 @@ class RenderViewContextMenu : public menus::SimpleMenuModel::Delegate { // a text selection. GURL selection_navigation_url_; - menus::SimpleMenuModel spellcheck_submenu_model_; - menus::SimpleMenuModel bidi_submenu_model_; - ScopedVector<menus::SimpleMenuModel> extension_menu_models_; + ui::SimpleMenuModel spellcheck_submenu_model_; + ui::SimpleMenuModel bidi_submenu_model_; + ScopedVector<ui::SimpleMenuModel> extension_menu_models_; DISALLOW_COPY_AND_ASSIGN(RenderViewContextMenu); }; diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc index 4c2a6d3..dc7b783 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_gtk.cc +++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.cc @@ -36,7 +36,7 @@ void RenderViewContextMenuGtk::PlatformInit() { bool RenderViewContextMenuGtk::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/tab_contents/render_view_context_menu_gtk.h b/chrome/browser/tab_contents/render_view_context_menu_gtk.h index f9da630..90eea5e 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_gtk.h +++ b/chrome/browser/tab_contents/render_view_context_menu_gtk.h @@ -35,7 +35,7 @@ class RenderViewContextMenuGtk : public RenderViewContextMenu, // TODO(port): implement. virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); private: scoped_ptr<MenuGtk> menu_gtk_; diff --git a/chrome/browser/tab_contents/render_view_context_menu_mac.h b/chrome/browser/tab_contents/render_view_context_menu_mac.h index 72f402c..58a8eaf 100644 --- a/chrome/browser/tab_contents/render_view_context_menu_mac.h +++ b/chrome/browser/tab_contents/render_view_context_menu_mac.h @@ -29,7 +29,7 @@ class RenderViewContextMenuMac : public RenderViewContextMenu { virtual void PlatformInit(); virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/translate/languages_menu_model.cc b/chrome/browser/translate/languages_menu_model.cc index e6934b5..5f631d1 100644 --- a/chrome/browser/translate/languages_menu_model.cc +++ b/chrome/browser/translate/languages_menu_model.cc @@ -10,7 +10,7 @@ LanguagesMenuModel::LanguagesMenuModel( TranslateInfoBarDelegate* translate_delegate, LanguageType language_type) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), translate_infobar_delegate_(translate_delegate), language_type_(language_type) { for (int i = 0; i < translate_delegate->GetLanguageCount(); ++i) @@ -35,7 +35,7 @@ bool LanguagesMenuModel::IsCommandIdEnabled(int command_id) const { bool LanguagesMenuModel::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/translate/languages_menu_model.h b/chrome/browser/translate/languages_menu_model.h index 8f91076..74a16a0 100644 --- a/chrome/browser/translate/languages_menu_model.h +++ b/chrome/browser/translate/languages_menu_model.h @@ -6,14 +6,14 @@ #define CHROME_BROWSER_TRANSLATE_LANGUAGES_MENU_MODEL_H_ #pragma once -#include "app/menus/simple_menu_model.h" +#include "ui/base/models/simple_menu_model.h" class TranslateInfoBarDelegate; // A menu model that builds the contents of the language menus in the translate // infobar. This menu has only one level (no submenus). -class LanguagesMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate { +class LanguagesMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate { public: enum LanguageType { ORIGINAL, @@ -23,11 +23,11 @@ class LanguagesMenuModel : public menus::SimpleMenuModel, LanguageType language_type); virtual ~LanguagesMenuModel(); - // menus::SimpleMenuModel::Delegate implementation: + // ui::SimpleMenuModel::Delegate implementation: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); private: diff --git a/chrome/browser/translate/options_menu_model.cc b/chrome/browser/translate/options_menu_model.cc index 4a074ce..d56f001 100644 --- a/chrome/browser/translate/options_menu_model.cc +++ b/chrome/browser/translate/options_menu_model.cc @@ -27,7 +27,7 @@ const char kAboutGoogleTranslateUrl[] = OptionsMenuModel::OptionsMenuModel( TranslateInfoBarDelegate* translate_delegate) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), translate_infobar_delegate_(translate_delegate) { string16 original_language = translate_delegate->GetLanguageDisplayableNameAt( translate_delegate->original_language_index()); @@ -94,7 +94,7 @@ bool OptionsMenuModel::IsCommandIdEnabled(int command_id) const { } bool OptionsMenuModel::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { + int command_id, ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/translate/options_menu_model.h b/chrome/browser/translate/options_menu_model.h index 68f9297..83f0f4e 100644 --- a/chrome/browser/translate/options_menu_model.h +++ b/chrome/browser/translate/options_menu_model.h @@ -6,23 +6,23 @@ #define CHROME_BROWSER_TRANSLATE_OPTIONS_MENU_MODEL_H_ #pragma once -#include "app/menus/simple_menu_model.h" +#include "ui/base/models/simple_menu_model.h" class TranslateInfoBarDelegate; // A menu model that builds the contents of the options menu in the translate // infobar. This menu has only one level (no submenus). -class OptionsMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate { +class OptionsMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate { public: explicit OptionsMenuModel(TranslateInfoBarDelegate* translate_delegate); virtual ~OptionsMenuModel(); - // menus::SimpleMenuModel::Delegate implementation: + // ui::SimpleMenuModel::Delegate implementation: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); private: diff --git a/chrome/browser/translate/translate_manager_unittest.cc b/chrome/browser/translate/translate_manager_unittest.cc index f821b5c..f3d1d0c 100644 --- a/chrome/browser/translate/translate_manager_unittest.cc +++ b/chrome/browser/translate/translate_manager_unittest.cc @@ -268,7 +268,7 @@ class TestRenderViewContextMenu : public RenderViewContextMenu { virtual void PlatformInit() { } virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { return false; } + ui::Accelerator* accelerator) { return false; } private: TestRenderViewContextMenu(TabContents* tab_contents, diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.h b/chrome/browser/ui/cocoa/accelerators_cocoa.h index 9b0a555..c4c5521 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.h +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.h @@ -8,7 +8,7 @@ #include <map> -#include "app/menus/accelerator_cocoa.h" +#include "ui/base/models/accelerator_cocoa.h" template <typename T> struct DefaultSingletonTraits; @@ -26,10 +26,10 @@ template <typename T> struct DefaultSingletonTraits; // class AcceleratorsCocoa { public: - typedef std::map<int, menus::AcceleratorCocoa> AcceleratorCocoaMap; + typedef std::map<int, ui::AcceleratorCocoa> AcceleratorCocoaMap; // Returns NULL if there is no accelerator for the command. - const menus::AcceleratorCocoa* GetAcceleratorForCommand(int command_id); + const ui::AcceleratorCocoa* GetAcceleratorForCommand(int command_id); // Returns the singleton instance. static AcceleratorsCocoa* GetInstance(); diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa.mm b/chrome/browser/ui/cocoa/accelerators_cocoa.mm index 6f28a0f..f62bd50 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa.mm +++ b/chrome/browser/ui/cocoa/accelerators_cocoa.mm @@ -44,7 +44,7 @@ const struct AcceleratorMapping { AcceleratorsCocoa::AcceleratorsCocoa() { for (size_t i = 0; i < arraysize(kAcceleratorMap); ++i) { const AcceleratorMapping& entry = kAcceleratorMap[i]; - menus::AcceleratorCocoa accelerator(entry.key, entry.modifiers); + ui::AcceleratorCocoa accelerator(entry.key, entry.modifiers); accelerators_.insert(std::make_pair(entry.command_id, accelerator)); } } @@ -54,7 +54,7 @@ AcceleratorsCocoa* AcceleratorsCocoa::GetInstance() { return Singleton<AcceleratorsCocoa>::get(); } -const menus::AcceleratorCocoa* AcceleratorsCocoa::GetAcceleratorForCommand( +const ui::AcceleratorCocoa* AcceleratorsCocoa::GetAcceleratorForCommand( int command_id) { AcceleratorCocoaMap::iterator it = accelerators_.find(command_id); if (it == accelerators_.end()) diff --git a/chrome/browser/ui/cocoa/accelerators_cocoa_unittest.mm b/chrome/browser/ui/cocoa/accelerators_cocoa_unittest.mm index ef1436d..2a39ffe 100644 --- a/chrome/browser/ui/cocoa/accelerators_cocoa_unittest.mm +++ b/chrome/browser/ui/cocoa/accelerators_cocoa_unittest.mm @@ -4,16 +4,16 @@ #import <Cocoa/Cocoa.h> -#include "app/menus/accelerator_cocoa.h" #include "base/singleton.h" #include "chrome/app/chrome_command_ids.h" #import "chrome/browser/ui/cocoa/accelerators_cocoa.h" #include "testing/gtest/include/gtest/gtest.h" #include "testing/gtest_mac.h" +#include "ui/base/models/accelerator_cocoa.h" TEST(AcceleratorsCocoaTest, GetAccelerator) { AcceleratorsCocoa* keymap = AcceleratorsCocoa::GetInstance(); - const menus::AcceleratorCocoa* accelerator = + const ui::AcceleratorCocoa* accelerator = keymap->GetAcceleratorForCommand(IDC_COPY); ASSERT_TRUE(accelerator); EXPECT_NSEQ(@"c", accelerator->characters()); @@ -22,7 +22,7 @@ TEST(AcceleratorsCocoaTest, GetAccelerator) { TEST(AcceleratorsCocoaTest, GetNullAccelerator) { AcceleratorsCocoa* keymap = AcceleratorsCocoa::GetInstance(); - const menus::AcceleratorCocoa* accelerator = + const ui::AcceleratorCocoa* accelerator = keymap->GetAcceleratorForCommand(314159265); EXPECT_FALSE(accelerator); } diff --git a/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm b/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm index c85ceab..1adf875 100644 --- a/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm +++ b/chrome/browser/ui/cocoa/content_exceptions_window_controller.mm @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" -#include "app/table_model_observer.h" #include "base/command_line.h" #import "base/mac/mac_util.h" #import "base/scoped_nsobject.h" @@ -17,6 +16,7 @@ #include "chrome/common/notification_service.h" #include "grit/generated_resources.h" #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" +#include "ui/base/models/table_model_observer.h" @interface ContentExceptionsWindowController (Private) - (id)initWithType:(ContentSettingsType)settingsType diff --git a/chrome/browser/ui/cocoa/cookie_tree_node.h b/chrome/browser/ui/cocoa/cookie_tree_node.h index ec1b2d2..400244c 100644 --- a/chrome/browser/ui/cocoa/cookie_tree_node.h +++ b/chrome/browser/ui/cocoa/cookie_tree_node.h @@ -24,7 +24,7 @@ // Common getters.. - (NSString*)title; - (CocoaCookieDetailsType)nodeType; -- (TreeModelNode*)treeNode; +- (ui::TreeModelNode*)treeNode; // |-mutableChildren| exists so that the CookiesTreeModelObserverBridge can // operate on the children. Note that this lazily creates children. diff --git a/chrome/browser/ui/cocoa/cookie_tree_node.mm b/chrome/browser/ui/cocoa/cookie_tree_node.mm index fa4da84..eeddadd 100644 --- a/chrome/browser/ui/cocoa/cookie_tree_node.mm +++ b/chrome/browser/ui/cocoa/cookie_tree_node.mm @@ -33,7 +33,7 @@ return [details_.get() type]; } -- (TreeModelNode*)treeNode { +- (ui::TreeModelNode*)treeNode { return treeNode_; } diff --git a/chrome/browser/ui/cocoa/cookies_window_controller.h b/chrome/browser/ui/cocoa/cookies_window_controller.h index 658bfa7..85d8b3e 100644 --- a/chrome/browser/ui/cocoa/cookies_window_controller.h +++ b/chrome/browser/ui/cocoa/cookies_window_controller.h @@ -14,13 +14,16 @@ @class CookiesWindowController; @class CookieDetailsViewController; class Profile; -class TreeModel; -class TreeModelNode; namespace { class CookiesWindowControllerTest; } +namespace ui { +class TreeModel; +class TreeModelNode; +} + // Thin bridge to the window controller that performs model update actions // directly on the treeController_. class CookiesTreeModelObserverBridge : public CookiesTreeModel::Observer { @@ -28,15 +31,15 @@ class CookiesTreeModelObserverBridge : public CookiesTreeModel::Observer { explicit CookiesTreeModelObserverBridge(CookiesWindowController* controller); // Begin TreeModelObserver implementation. - virtual void TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node); + virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node); // End TreeModelObserver implementation. virtual void TreeModelBeginBatch(CookiesTreeModel* model); @@ -51,12 +54,12 @@ class CookiesTreeModelObserverBridge : public CookiesTreeModel::Observer { // Creates a CocoaCookieTreeNode from a platform-independent one. // Return value is autoreleased. This creates child nodes recusively. - CocoaCookieTreeNode* CocoaNodeFromTreeNode(TreeModelNode* node); + CocoaCookieTreeNode* CocoaNodeFromTreeNode(ui::TreeModelNode* node); // Finds the Cocoa model node based on a platform-independent one. This is // done by comparing the treeNode pointers. |start| is the node to start // searching at. If |start| is nil, the root is used. - CocoaCookieTreeNode* FindCocoaNode(TreeModelNode* node, + CocoaCookieTreeNode* FindCocoaNode(ui::TreeModelNode* node, CocoaCookieTreeNode* start); // Returns whether or not the Cocoa tree model is built. diff --git a/chrome/browser/ui/cocoa/cookies_window_controller.mm b/chrome/browser/ui/cocoa/cookies_window_controller.mm index 5e5f74f..33cb858 100644 --- a/chrome/browser/ui/cocoa/cookies_window_controller.mm +++ b/chrome/browser/ui/cocoa/cookies_window_controller.mm @@ -31,8 +31,8 @@ CookiesTreeModelObserverBridge::CookiesTreeModelObserverBridge( } // Notification that nodes were added to the specified parent. -void CookiesTreeModelObserverBridge::TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, +void CookiesTreeModelObserverBridge::TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { // We're in for a major rebuild. Ignore this request. @@ -53,8 +53,8 @@ void CookiesTreeModelObserverBridge::TreeNodesAdded(TreeModel* model, } // Notification that nodes were removed from the specified parent. -void CookiesTreeModelObserverBridge::TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, +void CookiesTreeModelObserverBridge::TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { // We're in for a major rebuild. Ignore this request. @@ -71,8 +71,8 @@ void CookiesTreeModelObserverBridge::TreeNodesRemoved(TreeModel* model, } // Notification that the contents of a node has changed. -void CookiesTreeModelObserverBridge::TreeNodeChanged(TreeModel* model, - TreeModelNode* node) { +void CookiesTreeModelObserverBridge::TreeNodeChanged(ui::TreeModel* model, + ui::TreeModelNode* node) { // If we don't have a Cocoa model, only let the root node change. if (batch_update_ || (!HasCocoaModel() && model->GetRoot() != node)) return; @@ -107,7 +107,7 @@ void CookiesTreeModelObserverBridge::InvalidateCocoaModel() { } CocoaCookieTreeNode* CookiesTreeModelObserverBridge::CocoaNodeFromTreeNode( - TreeModelNode* node) { + ui::TreeModelNode* node) { CookieTreeNode* cookie_node = static_cast<CookieTreeNode*>(node); return [[[CocoaCookieTreeNode alloc] initWithNode:cookie_node] autorelease]; } @@ -116,7 +116,7 @@ CocoaCookieTreeNode* CookiesTreeModelObserverBridge::CocoaNodeFromTreeNode( // commonly used to find origin/folder nodes, which are at the first level off // the root (hence breadth-first search). CocoaCookieTreeNode* CookiesTreeModelObserverBridge::FindCocoaNode( - TreeModelNode* target, CocoaCookieTreeNode* start) { + ui::TreeModelNode* target, CocoaCookieTreeNode* start) { if (!start) { start = [window_controller_ cocoaTreeModel]; } diff --git a/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm b/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm index 5272cd2..0cd8d1d8 100644 --- a/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/cookies_window_controller_unittest.mm @@ -5,7 +5,6 @@ #import <Cocoa/Cocoa.h> #include "app/l10n_util_mac.h" -#include "app/tree_model.h" #import "base/scoped_nsobject.h" #include "base/scoped_ptr.h" #include "base/utf_string_conversions.h" @@ -28,23 +27,24 @@ #import "testing/gtest_mac.h" #include "testing/platform_test.h" #import "third_party/ocmock/OCMock/OCMock.h" +#include "ui/base/models/tree_model.h" // Used to test FindCocoaNode. This only sets the title and node, without // initializing any other members. @interface FakeCocoaCookieTreeNode : CocoaCookieTreeNode { - TreeModelNode* testNode_; + ui::TreeModelNode* testNode_; } -- (id)initWithTreeNode:(TreeModelNode*)node; +- (id)initWithTreeNode:(ui::TreeModelNode*)node; @end @implementation FakeCocoaCookieTreeNode -- (id)initWithTreeNode:(TreeModelNode*)node { +- (id)initWithTreeNode:(ui::TreeModelNode*)node { if ((self = [super init])) { testNode_ = node; children_.reset([[NSMutableArray alloc] init]); } return self; } -- (TreeModelNode*)treeNode { +- (ui::TreeModelNode*)treeNode { return testNode_; } @end @@ -73,11 +73,11 @@ class CookiesWindowControllerTest : public CocoaTest { CocoaTest::TearDown(); } - CocoaCookieTreeNode* CocoaNodeFromTreeNode(TreeModelNode* node) { + CocoaCookieTreeNode* CocoaNodeFromTreeNode(ui::TreeModelNode* node) { return [controller_ modelObserver]->CocoaNodeFromTreeNode(node); } - CocoaCookieTreeNode* FindCocoaNode(TreeModelNode* node, + CocoaCookieTreeNode* FindCocoaNode(ui::TreeModelNode* node, CocoaCookieTreeNode* start) { return [controller_ modelObserver]->FindCocoaNode(node, start); } @@ -98,16 +98,20 @@ TEST_F(CookiesWindowControllerTest, Construction) { } TEST_F(CookiesWindowControllerTest, FindCocoaNodeRoot) { - scoped_ptr< TreeNodeWithValue<int> > search(new TreeNodeWithValue<int>(42)); + scoped_ptr< ui::TreeNodeWithValue<int> > search( + new TreeNodeWithValue<int>(42)); scoped_nsobject<FakeCocoaCookieTreeNode> node( [[FakeCocoaCookieTreeNode alloc] initWithTreeNode:search.get()]); EXPECT_EQ(node.get(), FindCocoaNode(search.get(), node.get())); } TEST_F(CookiesWindowControllerTest, FindCocoaNodeImmediateChild) { - scoped_ptr< TreeNodeWithValue<int> > parent(new TreeNodeWithValue<int>(100)); - scoped_ptr< TreeNodeWithValue<int> > child1(new TreeNodeWithValue<int>(10)); - scoped_ptr< TreeNodeWithValue<int> > child2(new TreeNodeWithValue<int>(20)); + scoped_ptr< ui::TreeNodeWithValue<int> > parent( + new TreeNodeWithValue<int>(100)); + scoped_ptr< ui::TreeNodeWithValue<int> > child1( + new TreeNodeWithValue<int>(10)); + scoped_ptr< ui::TreeNodeWithValue<int> > child2( + new TreeNodeWithValue<int>(20)); scoped_nsobject<FakeCocoaCookieTreeNode> cocoaParent( [[FakeCocoaCookieTreeNode alloc] initWithTreeNode:parent.get()]); scoped_nsobject<FakeCocoaCookieTreeNode> cocoaChild1( @@ -121,9 +125,12 @@ TEST_F(CookiesWindowControllerTest, FindCocoaNodeImmediateChild) { } TEST_F(CookiesWindowControllerTest, FindCocoaNodeRecursive) { - scoped_ptr< TreeNodeWithValue<int> > parent(new TreeNodeWithValue<int>(100)); - scoped_ptr< TreeNodeWithValue<int> > child1(new TreeNodeWithValue<int>(10)); - scoped_ptr< TreeNodeWithValue<int> > child2(new TreeNodeWithValue<int>(20)); + scoped_ptr< ui::TreeNodeWithValue<int> > parent( + new TreeNodeWithValue<int>(100)); + scoped_ptr< ui::TreeNodeWithValue<int> > child1( + new TreeNodeWithValue<int>(10)); + scoped_ptr< ui::TreeNodeWithValue<int> > child2( + new TreeNodeWithValue<int>(20)); scoped_nsobject<FakeCocoaCookieTreeNode> cocoaParent( [[FakeCocoaCookieTreeNode alloc] initWithTreeNode:parent.get()]); scoped_nsobject<FakeCocoaCookieTreeNode> cocoaChild1( @@ -142,7 +149,8 @@ TEST_F(CookiesWindowControllerTest, CocoaNodeFromTreeNodeCookie) { CookiesTreeModel model(cm, database_helper_, local_storage_helper_, nil, nil); // Root --> foo.com --> Cookies --> A. Create node for 'A'. - TreeModelNode* node = model.GetRoot()->GetChild(0)->GetChild(0)->GetChild(0); + ui::TreeModelNode* node = + model.GetRoot()->GetChild(0)->GetChild(0)->GetChild(0); CocoaCookieTreeNode* cookie = CocoaNodeFromTreeNode(node); CocoaCookieDetails* details = [cookie details]; diff --git a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.h b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.h index 6acc829..252f557 100644 --- a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.h +++ b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.h @@ -4,7 +4,6 @@ #import <Cocoa/Cocoa.h> -#include "app/table_model_observer.h" #import "base/mac/cocoa_protocols.h" #include "base/scoped_ptr.h" #include "base/string16.h" @@ -12,6 +11,7 @@ #include "chrome/browser/search_engines/keyword_editor_controller.h" #include "chrome/browser/search_engines/template_url_model_observer.h" #include "chrome/browser/ui/cocoa/table_row_nsimage_cache.h" +#include "ui/base/models/table_model_observer.h" class EditSearchEngineControllerDelegate; @class KeywordEditorCocoaController; @@ -21,7 +21,7 @@ class Profile; // Very thin bridge that simply pushes notifications from C++ to ObjC. class KeywordEditorModelObserver : public TemplateURLModelObserver, public EditSearchEngineControllerDelegate, - public TableModelObserver, + public ui::TableModelObserver, public TableRowNSImageCache::Table { public: explicit KeywordEditorModelObserver(KeywordEditorCocoaController* controller); @@ -40,7 +40,7 @@ class KeywordEditorModelObserver : public TemplateURLModelObserver, const string16& keyword, const std::string& url); - // TableModelObserver overrides. Invalidate icon cache. + // ui::TableModelObserver overrides. Invalidate icon cache. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); diff --git a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm index 2ae0fa6..64ce03c 100644 --- a/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm +++ b/chrome/browser/ui/cocoa/keyword_editor_cocoa_controller.mm @@ -293,7 +293,7 @@ static base::LazyInstance<ProfileControllerMap> g_profile_controller_map( row:(NSInteger)row { if ([self tableView:tv isGroupRow:row]) { DCHECK(!tableColumn); - TableModel::Groups groups = controller_->table_model()->GetGroups(); + ui::TableModel::Groups groups = controller_->table_model()->GetGroups(); if (row == 0) { return base::SysUTF16ToNSString(groups[0].title); } else { diff --git a/chrome/browser/ui/cocoa/menu_controller.h b/chrome/browser/ui/cocoa/menu_controller.h index c198c70..4be9b0d 100644 --- a/chrome/browser/ui/cocoa/menu_controller.h +++ b/chrome/browser/ui/cocoa/menu_controller.h @@ -10,7 +10,7 @@ #include "base/scoped_nsobject.h" -namespace menus { +namespace ui { class MenuModel; } @@ -22,12 +22,12 @@ class MenuModel; // as it only maintains weak references. @interface MenuController : NSObject { @protected - menus::MenuModel* model_; // weak + ui::MenuModel* model_; // weak scoped_nsobject<NSMenu> menu_; BOOL useWithPopUpButtonCell_; // If YES, 0th item is blank } -@property (nonatomic, assign) menus::MenuModel* model; +@property (nonatomic, assign) ui::MenuModel* model; // Note that changing this will have no effect if you use // |-initWithModel:useWithPopUpButtonCell:| or after the first call to |-menu|. @property (nonatomic) BOOL useWithPopUpButtonCell; @@ -42,7 +42,7 @@ class MenuModel; // the menu will be displayed by a NSPopUpButtonCell, it needs to be of a // slightly different form (0th item is empty). Note this attribute of the menu // cannot be changed after it has been created. -- (id)initWithModel:(menus::MenuModel*)model +- (id)initWithModel:(ui::MenuModel*)model useWithPopUpButtonCell:(BOOL)useWithCell; // Access to the constructed menu if the complex initializer was used. If the @@ -60,7 +60,7 @@ class MenuModel; @interface MenuController (Protected) - (void)addItemToMenu:(NSMenu*)menu atIndex:(NSInteger)index - fromModel:(menus::MenuModel*)model + fromModel:(ui::MenuModel*)model modelIndex:(int)modelIndex; @end diff --git a/chrome/browser/ui/cocoa/menu_controller.mm b/chrome/browser/ui/cocoa/menu_controller.mm index a6d314d..9a1d5a8 100644 --- a/chrome/browser/ui/cocoa/menu_controller.mm +++ b/chrome/browser/ui/cocoa/menu_controller.mm @@ -5,15 +5,15 @@ #import "chrome/browser/ui/cocoa/menu_controller.h" #include "app/l10n_util_mac.h" -#include "app/menus/accelerator_cocoa.h" -#include "app/menus/simple_menu_model.h" #include "base/logging.h" #include "base/sys_string_conversions.h" #include "skia/ext/skia_utils_mac.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/accelerator_cocoa.h" +#include "ui/base/models/simple_menu_model.h" @interface MenuController (Private) -- (NSMenu*)menuFromModel:(menus::MenuModel*)model; +- (NSMenu*)menuFromModel:(ui::MenuModel*)model; - (void)addSeparatorToMenu:(NSMenu*)menu atIndex:(int)index; @end @@ -28,7 +28,7 @@ return self; } -- (id)initWithModel:(menus::MenuModel*)model +- (id)initWithModel:(ui::MenuModel*)model useWithPopUpButtonCell:(BOOL)useWithCell { if ((self = [super init])) { model_ = model; @@ -45,7 +45,7 @@ // Creates a NSMenu from the given model. If the model has submenus, this can // be invoked recursively. -- (NSMenu*)menuFromModel:(menus::MenuModel*)model { +- (NSMenu*)menuFromModel:(ui::MenuModel*)model { NSMenu* menu = [[[NSMenu alloc] initWithTitle:@""] autorelease]; // The indices may not always start at zero (the windows system menu is one @@ -56,7 +56,7 @@ const int count = model->GetItemCount(); for (int index = firstItemIndex; index < firstItemIndex + count; index++) { int modelIndex = index - firstItemIndex; - if (model->GetTypeAt(modelIndex) == menus::MenuModel::TYPE_SEPARATOR) { + if (model->GetTypeAt(modelIndex) == ui::MenuModel::TYPE_SEPARATOR) { [self addSeparatorToMenu:menu atIndex:index]; } else { [self addItemToMenu:menu atIndex:index fromModel:model @@ -80,7 +80,7 @@ // associated with the entry in the model indentifed by |modelIndex|. - (void)addItemToMenu:(NSMenu*)menu atIndex:(NSInteger)index - fromModel:(menus::MenuModel*)model + fromModel:(ui::MenuModel*)model modelIndex:(int)modelIndex { NSString* label = l10n_util::FixUpWindowsStyleLabel(model->GetLabelAt(modelIndex)); @@ -98,14 +98,14 @@ } } - menus::MenuModel::ItemType type = model->GetTypeAt(modelIndex); - if (type == menus::MenuModel::TYPE_SUBMENU) { + ui::MenuModel::ItemType type = model->GetTypeAt(modelIndex); + if (type == ui::MenuModel::TYPE_SUBMENU) { // Recursively build a submenu from the sub-model at this index. [item setTarget:nil]; [item setAction:nil]; - menus::MenuModel* submenuModel = model->GetSubmenuModelAt(modelIndex); + ui::MenuModel* submenuModel = model->GetSubmenuModelAt(modelIndex); NSMenu* submenu = - [self menuFromModel:(menus::SimpleMenuModel*)submenuModel]; + [self menuFromModel:(ui::SimpleMenuModel*)submenuModel]; [item setSubmenu:submenu]; } else { // The MenuModel works on indexes so we can't just set the command id as the @@ -117,7 +117,7 @@ [item setTarget:self]; NSValue* modelObject = [NSValue valueWithPointer:model]; [item setRepresentedObject:modelObject]; // Retains |modelObject|. - menus::AcceleratorCocoa accelerator; + ui::AcceleratorCocoa accelerator; if (model->GetAcceleratorAt(modelIndex, &accelerator)) { [item setKeyEquivalent:accelerator.characters()]; [item setKeyEquivalentModifierMask:accelerator.modifiers()]; @@ -135,8 +135,8 @@ return NO; NSInteger modelIndex = [item tag]; - menus::MenuModel* model = - static_cast<menus::MenuModel*>( + ui::MenuModel* model = + static_cast<ui::MenuModel*>( [[(id)item representedObject] pointerValue]); DCHECK(model); if (model) { @@ -164,8 +164,8 @@ // item chosen. - (void)itemSelected:(id)sender { NSInteger modelIndex = [sender tag]; - menus::MenuModel* model = - static_cast<menus::MenuModel*>( + ui::MenuModel* model = + static_cast<ui::MenuModel*>( [[sender representedObject] pointerValue]); DCHECK(model); if (model) diff --git a/chrome/browser/ui/cocoa/menu_controller_unittest.mm b/chrome/browser/ui/cocoa/menu_controller_unittest.mm index 8e00c53..f3d40bb 100644 --- a/chrome/browser/ui/cocoa/menu_controller_unittest.mm +++ b/chrome/browser/ui/cocoa/menu_controller_unittest.mm @@ -4,7 +4,6 @@ #import <Cocoa/Cocoa.h> -#include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "base/sys_string_conversions.h" #include "base/utf_string_conversions.h" @@ -13,13 +12,14 @@ #include "grit/app_resources.h" #include "grit/generated_resources.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/simple_menu_model.h" class MenuControllerTest : public CocoaTest { }; // A menu delegate that counts the number of times certain things are called // to make sure things are hooked up properly. -class Delegate : public menus::SimpleMenuModel::Delegate { +class Delegate : public ui::SimpleMenuModel::Delegate { public: Delegate() : execute_count_(0), enable_count_(0) { } @@ -30,7 +30,7 @@ class Delegate : public menus::SimpleMenuModel::Delegate { } virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { return false; } + ui::Accelerator* accelerator) { return false; } virtual void ExecuteCommand(int command_id) { ++execute_count_; } int execute_count_; @@ -62,7 +62,7 @@ class DynamicDelegate : public Delegate { TEST_F(MenuControllerTest, EmptyMenu) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); EXPECT_EQ([[menu menu] numberOfItems], 0); @@ -70,7 +70,7 @@ TEST_F(MenuControllerTest, EmptyMenu) { TEST_F(MenuControllerTest, BasicCreation) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); model.AddItem(2, ASCIIToUTF16("two")); model.AddItem(3, ASCIIToUTF16("three")); @@ -95,9 +95,9 @@ TEST_F(MenuControllerTest, BasicCreation) { TEST_F(MenuControllerTest, Submenus) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); - menus::SimpleMenuModel submodel(&delegate); + ui::SimpleMenuModel submodel(&delegate); submodel.AddItem(2, ASCIIToUTF16("sub-one")); submodel.AddItem(3, ASCIIToUTF16("sub-two")); submodel.AddItem(4, ASCIIToUTF16("sub-three")); @@ -132,9 +132,9 @@ TEST_F(MenuControllerTest, Submenus) { TEST_F(MenuControllerTest, EmptySubmenu) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); - menus::SimpleMenuModel submodel(&delegate); + ui::SimpleMenuModel submodel(&delegate); model.AddSubMenuWithStringId(2, IDS_ZOOM_MENU, &submodel); scoped_nsobject<MenuController> menu( @@ -144,7 +144,7 @@ TEST_F(MenuControllerTest, EmptySubmenu) { TEST_F(MenuControllerTest, PopUpButton) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); model.AddItem(2, ASCIIToUTF16("two")); model.AddItem(3, ASCIIToUTF16("three")); @@ -164,7 +164,7 @@ TEST_F(MenuControllerTest, PopUpButton) { TEST_F(MenuControllerTest, Execute) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); @@ -188,10 +188,10 @@ void Validate(MenuController* controller, NSMenu* menu) { TEST_F(MenuControllerTest, Validate) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); model.AddItem(2, ASCIIToUTF16("two")); - menus::SimpleMenuModel submodel(&delegate); + ui::SimpleMenuModel submodel(&delegate); submodel.AddItem(2, ASCIIToUTF16("sub-one")); model.AddSubMenuWithStringId(3, IDS_ZOOM_MENU, &submodel); @@ -204,7 +204,7 @@ TEST_F(MenuControllerTest, Validate) { TEST_F(MenuControllerTest, DefaultInitializer) { Delegate delegate; - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("one")); model.AddItem(2, ASCIIToUTF16("two")); model.AddItem(3, ASCIIToUTF16("three")); @@ -230,7 +230,7 @@ TEST_F(MenuControllerTest, Dynamic) { // no icon. string16 initial = ASCIIToUTF16("initial"); delegate.SetDynamicLabel(initial); - menus::SimpleMenuModel model(&delegate); + ui::SimpleMenuModel model(&delegate); model.AddItem(1, ASCIIToUTF16("foo")); scoped_nsobject<MenuController> menu( [[MenuController alloc] initWithModel:&model useWithPopUpButtonCell:NO]); diff --git a/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm b/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm index 7b4c1f8..213e449 100644 --- a/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm +++ b/chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.mm @@ -5,13 +5,13 @@ #import "chrome/browser/ui/cocoa/simple_content_exceptions_window_controller.h" #include "app/l10n_util_mac.h" -#include "app/table_model_observer.h" #include "base/logging.h" #import "base/mac/mac_util.h" #import "base/scoped_nsobject.h" #include "base/sys_string_conversions.h" #include "grit/generated_resources.h" #include "third_party/GTM/AppKit/GTMUILocalizerAndLayoutTweaker.h" +#include "ui/base/models/table_model_observer.h" @interface SimpleContentExceptionsWindowController (Private) - (id)initWithTableModel:(RemoveRowsTableModel*)model; diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h index c414ec90..7c2c84e 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.h @@ -28,7 +28,7 @@ class StatusIconMac : public StatusIcon { protected: // Overridden from StatusIcon. - virtual void UpdatePlatformContextMenu(menus::MenuModel* menu); + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu); private: // Getter for item_ that allows lazy initialization. diff --git a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm index 3f3d5a1..9ac39bf 100644 --- a/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm +++ b/chrome/browser/ui/cocoa/status_icons/status_icon_mac.mm @@ -76,7 +76,7 @@ void StatusIconMac::SetToolTip(const string16& tool_tip) { [item() setToolTip:base::SysUTF16ToNSString(tool_tip)]; } -void StatusIconMac::UpdatePlatformContextMenu(menus::MenuModel* menu) { +void StatusIconMac::UpdatePlatformContextMenu(ui::MenuModel* menu) { // TODO(atwilson): Add support for context menus for Mac when actually needed // (not yet used by anything) - http://crbug.com/37375. } diff --git a/chrome/browser/ui/cocoa/tab_controller.mm b/chrome/browser/ui/cocoa/tab_controller.mm index f05bb21..fb8c6b1 100644 --- a/chrome/browser/ui/cocoa/tab_controller.mm +++ b/chrome/browser/ui/cocoa/tab_controller.mm @@ -30,13 +30,13 @@ namespace TabControllerInternal { // A C++ delegate that handles enabling/disabling menu items and handling when // a menu command is chosen. Also fixes up the menu item label for "pin/unpin // tab". -class MenuDelegate : public menus::SimpleMenuModel::Delegate { +class MenuDelegate : public ui::SimpleMenuModel::Delegate { public: explicit MenuDelegate(id<TabControllerTarget> target, TabController* owner) : target_(target), owner_(owner) {} - // Overridden from menus::SimpleMenuModel::Delegate + // Overridden from ui::SimpleMenuModel::Delegate virtual bool IsCommandIdChecked(int command_id) const { return false; } virtual bool IsCommandIdEnabled(int command_id) const { TabStripModel::ContextMenuCommand command = @@ -45,7 +45,7 @@ class MenuDelegate : public menus::SimpleMenuModel::Delegate { } virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { return false; } + ui::Accelerator* accelerator) { return false; } virtual void ExecuteCommand(int command_id) { TabStripModel::ContextMenuCommand command = static_cast<TabStripModel::ContextMenuCommand>(command_id); diff --git a/chrome/browser/ui/cocoa/table_model_array_controller.h b/chrome/browser/ui/cocoa/table_model_array_controller.h index 63cf4c8..850bf6d 100644 --- a/chrome/browser/ui/cocoa/table_model_array_controller.h +++ b/chrome/browser/ui/cocoa/table_model_array_controller.h @@ -8,10 +8,10 @@ #import <Cocoa/Cocoa.h> -#include "app/table_model_observer.h" #import "base/mac/cocoa_protocols.h" #include "base/scoped_nsobject.h" #include "base/scoped_ptr.h" +#include "ui/base/models/table_model_observer.h" class RemoveRowsObserverBridge; class RemoveRowsTableModel; diff --git a/chrome/browser/ui/cocoa/table_model_array_controller.mm b/chrome/browser/ui/cocoa/table_model_array_controller.mm index dcc2e6a..8678fa8 100644 --- a/chrome/browser/ui/cocoa/table_model_array_controller.mm +++ b/chrome/browser/ui/cocoa/table_model_array_controller.mm @@ -4,10 +4,10 @@ #import "chrome/browser/ui/cocoa/table_model_array_controller.h" -#include "app/table_model.h" #include "base/logging.h" #include "base/sys_string_conversions.h" #include "chrome/browser/remove_rows_table_model.h" +#include "ui/base/models/table_model.h" @interface TableModelArrayController () @@ -24,13 +24,13 @@ @end // Observer for a RemoveRowsTableModel. -class RemoveRowsObserverBridge : public TableModelObserver { +class RemoveRowsObserverBridge : public ui::TableModelObserver { public: RemoveRowsObserverBridge(TableModelArrayController* controller) : controller_(controller) {} virtual ~RemoveRowsObserverBridge() {} - // TableModelObserver methods + // ui::TableModelObserver methods virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); @@ -78,9 +78,9 @@ static NSString* const kGroupID = @"_group_id"; NSMakeRange(0, [[self arrangedObjects] count])]; [self removeObjectsAtArrangedObjectIndexes:indexes]; if (model_->HasGroups()) { - const TableModel::Groups& groups = model_->GetGroups(); + const ui::TableModel::Groups& groups = model_->GetGroups(); DCHECK(groupTitle_.get()); - for (TableModel::Groups::const_iterator it = groups.begin(); + for (ui::TableModel::Groups::const_iterator it = groups.begin(); it != groups.end(); ++it) { NSDictionary* group = [NSDictionary dictionaryWithObjectsAndKeys: base::SysUTF16ToNSString(it->title), groupTitle_.get(), @@ -93,7 +93,7 @@ static NSString* const kGroupID = @"_group_id"; } - (NSUInteger)offsetForGroupID:(int)groupID startingOffset:(NSUInteger)offset { - const TableModel::Groups& groups = model_->GetGroups(); + const ui::TableModel::Groups& groups = model_->GetGroups(); DCHECK_GT(offset, 0u); for (NSUInteger i = offset - 1; i < groups.size(); ++i) { if (groups[i].id == groupID) diff --git a/chrome/browser/ui/cocoa/toolbar_controller.mm b/chrome/browser/ui/cocoa/toolbar_controller.mm index 3147738..92afce8 100644 --- a/chrome/browser/ui/cocoa/toolbar_controller.mm +++ b/chrome/browser/ui/cocoa/toolbar_controller.mm @@ -9,8 +9,6 @@ #include "app/l10n_util.h" #include "app/l10n_util_mac.h" #include "app/mac/nsimage_cache.h" -#include "app/menus/accelerator_cocoa.h" -#include "app/menus/menu_model.h" #include "app/resource_bundle.h" #include "base/mac/mac_util.h" #include "base/singleton.h" @@ -57,6 +55,8 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/accelerator_cocoa.h" +#include "ui/base/models/menu_model.h" namespace { @@ -101,16 +101,16 @@ const CGFloat kWrenchMenuLeftPadding = 3.0; namespace ToolbarControllerInternal { // A C++ delegate that handles the accelerators in the wrench menu. -class WrenchAcceleratorDelegate : public menus::AcceleratorProvider { +class WrenchAcceleratorDelegate : public ui::AcceleratorProvider { public: virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator_generic) { + ui::Accelerator* accelerator_generic) { // Downcast so that when the copy constructor is invoked below, the key // string gets copied, too. - menus::AcceleratorCocoa* out_accelerator = - static_cast<menus::AcceleratorCocoa*>(accelerator_generic); + ui::AcceleratorCocoa* out_accelerator = + static_cast<ui::AcceleratorCocoa*>(accelerator_generic); AcceleratorsCocoa* keymap = AcceleratorsCocoa::GetInstance(); - const menus::AcceleratorCocoa* accelerator = + const ui::AcceleratorCocoa* accelerator = keymap->GetAcceleratorForCommand(command_id); if (accelerator) { *out_accelerator = *accelerator; diff --git a/chrome/browser/ui/cocoa/wrench_menu_controller.mm b/chrome/browser/ui/cocoa/wrench_menu_controller.mm index c57528b4..fdedecd 100644 --- a/chrome/browser/ui/cocoa/wrench_menu_controller.mm +++ b/chrome/browser/ui/cocoa/wrench_menu_controller.mm @@ -5,7 +5,6 @@ #import "chrome/browser/ui/cocoa/wrench_menu_controller.h" #include "app/l10n_util.h" -#include "app/menus/menu_model.h" #include "base/sys_string_conversions.h" #include "chrome/app/chrome_command_ids.h" #include "chrome/browser/background_page_tracker.h" @@ -21,6 +20,7 @@ #include "chrome/common/notification_type.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/models/menu_model.h" @interface WrenchMenuController (Private) - (void)adjustPositioning; @@ -67,11 +67,11 @@ class ZoomLevelObserver : public NotificationObserver { - (void)addItemToMenu:(NSMenu*)menu atIndex:(NSInteger)index - fromModel:(menus::MenuModel*)model + fromModel:(ui::MenuModel*)model modelIndex:(int)modelIndex { // Non-button item types should be built as normal items. - menus::MenuModel::ItemType type = model->GetTypeAt(modelIndex); - if (type != menus::MenuModel::TYPE_BUTTON_ITEM) { + ui::MenuModel::ItemType type = model->GetTypeAt(modelIndex); + if (type != ui::MenuModel::TYPE_BUTTON_ITEM) { [super addItemToMenu:menu atIndex:index fromModel:model diff --git a/chrome/browser/ui/gtk/accelerators_gtk.cc b/chrome/browser/ui/gtk/accelerators_gtk.cc index bac41bd2..a53eeab 100644 --- a/chrome/browser/ui/gtk/accelerators_gtk.cc +++ b/chrome/browser/ui/gtk/accelerators_gtk.cc @@ -177,10 +177,10 @@ const struct AcceleratorMapping { AcceleratorsGtk::AcceleratorsGtk() { for (size_t i = 0; i < arraysize(kAcceleratorMap); ++i) { int command_id = kAcceleratorMap[i].command_id; - menus::AcceleratorGtk accelerator(kAcceleratorMap[i].keyval, + ui::AcceleratorGtk accelerator(kAcceleratorMap[i].keyval, kAcceleratorMap[i].modifier_type); all_accelerators_.push_back( - std::pair<int, menus::AcceleratorGtk>(command_id, accelerator)); + std::pair<int, ui::AcceleratorGtk>(command_id, accelerator)); if (primary_accelerators_.find(command_id) == primary_accelerators_.end()) { @@ -196,9 +196,9 @@ AcceleratorsGtk* AcceleratorsGtk::GetInstance() { return Singleton<AcceleratorsGtk>::get(); } -const menus::AcceleratorGtk* AcceleratorsGtk::GetPrimaryAcceleratorForCommand( +const ui::AcceleratorGtk* AcceleratorsGtk::GetPrimaryAcceleratorForCommand( int command_id) { - base::hash_map<int, menus::AcceleratorGtk>::const_iterator iter = + base::hash_map<int, ui::AcceleratorGtk>::const_iterator iter = primary_accelerators_.find(command_id); if (iter == primary_accelerators_.end()) diff --git a/chrome/browser/ui/gtk/accelerators_gtk.h b/chrome/browser/ui/gtk/accelerators_gtk.h index c1e953f..bf5a0ff 100644 --- a/chrome/browser/ui/gtk/accelerators_gtk.h +++ b/chrome/browser/ui/gtk/accelerators_gtk.h @@ -6,14 +6,14 @@ #define CHROME_BROWSER_UI_GTK_ACCELERATORS_GTK_H_ #pragma once -#include "app/menus/accelerator_gtk.h" #include "base/hash_tables.h" +#include "ui/base/models/accelerator_gtk.h" template <typename T> struct DefaultSingletonTraits; class AcceleratorsGtk { public: - typedef std::vector<std::pair<int, menus::AcceleratorGtk> > + typedef std::vector<std::pair<int, ui::AcceleratorGtk> > AcceleratorGtkList; typedef AcceleratorGtkList::const_iterator const_iterator; @@ -29,7 +29,7 @@ class AcceleratorsGtk { } // Returns NULL if there is no accelerator for the command. - const menus::AcceleratorGtk* GetPrimaryAcceleratorForCommand(int command_id); + const ui::AcceleratorGtk* GetPrimaryAcceleratorForCommand(int command_id); private: friend struct DefaultSingletonTraits<AcceleratorsGtk>; @@ -37,7 +37,7 @@ class AcceleratorsGtk { AcceleratorsGtk(); ~AcceleratorsGtk(); - base::hash_map<int, menus::AcceleratorGtk> primary_accelerators_; + base::hash_map<int, ui::AcceleratorGtk> primary_accelerators_; AcceleratorGtkList all_accelerators_; }; diff --git a/chrome/browser/ui/gtk/bookmark_editor_gtk.cc b/chrome/browser/ui/gtk/bookmark_editor_gtk.cc index 12686e6..1ade2ff 100644 --- a/chrome/browser/ui/gtk/bookmark_editor_gtk.cc +++ b/chrome/browser/ui/gtk/bookmark_editor_gtk.cc @@ -7,7 +7,6 @@ #include <gtk/gtk.h> #include "app/l10n_util.h" -#include "app/menus/simple_menu_model.h" #include "base/basictypes.h" #include "base/logging.h" #include "base/string_util.h" @@ -27,6 +26,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/locale_settings.h" +#include "ui/base/models/simple_menu_model.h" #if defined(TOOLKIT_VIEWS) #include "views/controls/menu/menu_2.h" @@ -46,12 +46,12 @@ static const int kTreeHeight = 150; } // namespace class BookmarkEditorGtk::ContextMenuController - : public menus::SimpleMenuModel::Delegate { + : public ui::SimpleMenuModel::Delegate { public: explicit ContextMenuController(BookmarkEditorGtk* editor) : editor_(editor), running_menu_for_root_(false) { - menu_model_.reset(new menus::SimpleMenuModel(this)); + menu_model_.reset(new ui::SimpleMenuModel(this)); menu_model_->AddItemWithStringId(COMMAND_EDIT, IDS_EDIT); menu_model_->AddItemWithStringId( COMMAND_NEW_FOLDER, @@ -90,7 +90,7 @@ class BookmarkEditorGtk::ContextMenuController COMMAND_NEW_FOLDER }; - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdEnabled(int command_id) const { return !(command_id == COMMAND_EDIT && running_menu_for_root_) && (editor_ != NULL); @@ -101,7 +101,7 @@ class BookmarkEditorGtk::ContextMenuController } virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } @@ -165,7 +165,7 @@ class BookmarkEditorGtk::ContextMenuController } // The model and view for the right click context menu. - scoped_ptr<menus::SimpleMenuModel> menu_model_; + scoped_ptr<ui::SimpleMenuModel> menu_model_; #if defined(TOOLKIT_VIEWS) scoped_ptr<views::Menu2> menu_; #else diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc index d3c0934..c8abc9b 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.cc @@ -75,7 +75,7 @@ gint WidthForIconCount(gint icon_count) { } // namespace -using menus::SimpleMenuModel; +using ui::SimpleMenuModel; class BrowserActionButton : public NotificationObserver, public ImageLoadingTracker::Observer, @@ -660,7 +660,7 @@ bool BrowserActionsToolbarGtk::IsCommandIdEnabled(int command_id) const { bool BrowserActionsToolbarGtk::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } diff --git a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h index 5df98a1..88b1de8 100644 --- a/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h +++ b/chrome/browser/ui/gtk/browser_actions_toolbar_gtk.h @@ -11,7 +11,6 @@ #include "app/gtk_signal.h" #include "app/gtk_signal_registrar.h" -#include "app/menus/simple_menu_model.h" #include "base/linked_ptr.h" #include "base/task.h" #include "chrome/browser/extensions/extension_toolbar_model.h" @@ -23,6 +22,7 @@ #include "chrome/common/notification_registrar.h" #include "ui/base/animation/animation_delegate.h" #include "ui/base/animation/slide_animation.h" +#include "ui/base/models/simple_menu_model.h" class Browser; class BrowserActionButton; @@ -36,7 +36,7 @@ typedef struct _GtkWidget GtkWidget; class BrowserActionsToolbarGtk : public ExtensionToolbarModel::Observer, public ui::AnimationDelegate, public MenuGtk::Delegate, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public NotificationObserver { public: explicit BrowserActionsToolbarGtk(Browser* browser); @@ -121,7 +121,7 @@ class BrowserActionsToolbarGtk : public ExtensionToolbarModel::Observer, virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // MenuGtk::Delegate implementation. @@ -186,7 +186,7 @@ class BrowserActionsToolbarGtk : public ExtensionToolbarModel::Observer, // mode. In Chrome theme mode, the overflow button has a separator built in. GtkWidget* separator_; scoped_ptr<MenuGtk> overflow_menu_; - scoped_ptr<menus::SimpleMenuModel> overflow_menu_model_; + scoped_ptr<ui::SimpleMenuModel> overflow_menu_model_; GtkWidget* overflow_area_; // A widget for adding extra padding to the left of the overflow button. GtkWidget* overflow_alignment_; diff --git a/chrome/browser/ui/gtk/browser_titlebar.cc b/chrome/browser/ui/gtk/browser_titlebar.cc index 77447f3..8412a17 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.cc +++ b/chrome/browser/ui/gtk/browser_titlebar.cc @@ -141,9 +141,9 @@ GdkColor PickLuminosityContrastingColor(const GdkColor* base, // A menu model that builds the contents of the menu shown for popups (when the // user clicks on the favicon) and all of its submenus. -class PopupPageMenuModel : public menus::SimpleMenuModel { +class PopupPageMenuModel : public ui::SimpleMenuModel { public: - explicit PopupPageMenuModel(menus::SimpleMenuModel::Delegate* delegate, + explicit PopupPageMenuModel(ui::SimpleMenuModel::Delegate* delegate, Browser* browser); virtual ~PopupPageMenuModel() { } @@ -161,9 +161,9 @@ class PopupPageMenuModel : public menus::SimpleMenuModel { }; PopupPageMenuModel::PopupPageMenuModel( - menus::SimpleMenuModel::Delegate* delegate, + ui::SimpleMenuModel::Delegate* delegate, Browser* browser) - : menus::SimpleMenuModel(delegate), browser_(browser) { + : ui::SimpleMenuModel(delegate), browser_(browser) { Build(); } @@ -847,8 +847,8 @@ void BrowserTitlebar::ExecuteCommand(int command_id) { } bool BrowserTitlebar::GetAcceleratorForCommandId( - int command_id, menus::Accelerator* accelerator) { - const menus::AcceleratorGtk* accelerator_gtk = + int command_id, ui::Accelerator* accelerator) { + const ui::AcceleratorGtk* accelerator_gtk = AcceleratorsGtk::GetInstance()->GetPrimaryAcceleratorForCommand( command_id); if (accelerator_gtk) @@ -936,7 +936,7 @@ void BrowserTitlebar::Throbber::InitFrames() { } BrowserTitlebar::ContextMenuModel::ContextMenuModel( - menus::SimpleMenuModel::Delegate* delegate) + ui::SimpleMenuModel::Delegate* delegate) : SimpleMenuModel(delegate) { AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); diff --git a/chrome/browser/ui/gtk/browser_titlebar.h b/chrome/browser/ui/gtk/browser_titlebar.h index 65dd78d..944057e 100644 --- a/chrome/browser/ui/gtk/browser_titlebar.h +++ b/chrome/browser/ui/gtk/browser_titlebar.h @@ -14,11 +14,11 @@ #include <gtk/gtk.h> #include "app/active_window_watcher_x.h" -#include "app/menus/simple_menu_model.h" #include "app/gtk_signal.h" #include "base/scoped_ptr.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/models/simple_menu_model.h" class BrowserWindowGtk; class CustomDrawButton; @@ -29,7 +29,7 @@ class TabContents; class BrowserTitlebar : public NotificationObserver, public ActiveWindowWatcherX::Observer, - public menus::SimpleMenuModel::Delegate { + public ui::SimpleMenuModel::Delegate { public: // A default button order string for when we aren't asking gconf for the // metacity configuration. @@ -87,9 +87,9 @@ class BrowserTitlebar : public NotificationObserver, int current_waiting_frame_; }; - class ContextMenuModel : public menus::SimpleMenuModel { + class ContextMenuModel : public ui::SimpleMenuModel { public: - explicit ContextMenuModel(menus::SimpleMenuModel::Delegate* delegate); + explicit ContextMenuModel(ui::SimpleMenuModel::Delegate* delegate); }; // Build the titlebar, the space above the tab @@ -150,7 +150,7 @@ class BrowserTitlebar : public NotificationObserver, virtual bool IsCommandIdChecked(int command_id) const; virtual void ExecuteCommand(int command_id); virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); // Overridden from NotificationObserver: virtual void Observe(NotificationType type, diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc index ea8a1b5..820a6a8 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.cc +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.cc @@ -10,7 +10,6 @@ #include "app/gtk_dnd_util.h" #include "app/l10n_util.h" -#include "app/menus/accelerator_gtk.h" #include "base/base_paths.h" #include "base/command_line.h" #include "base/i18n/rtl.h" @@ -53,6 +52,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/accelerator_gtk.h" namespace { @@ -332,12 +332,12 @@ bool BrowserToolbarGtk::AlwaysShowIconForCmd(int command_id) const { command_id == IDC_VIEW_BACKGROUND_PAGES; } -// menus::AcceleratorProvider +// ui::AcceleratorProvider bool BrowserToolbarGtk::GetAcceleratorForCommandId( int id, - menus::Accelerator* accelerator) { - const menus::AcceleratorGtk* accelerator_gtk = + ui::Accelerator* accelerator) { + const ui::AcceleratorGtk* accelerator_gtk = AcceleratorsGtk::GetInstance()->GetPrimaryAcceleratorForCommand(id); if (accelerator_gtk) *accelerator = *accelerator_gtk; diff --git a/chrome/browser/ui/gtk/browser_toolbar_gtk.h b/chrome/browser/ui/gtk/browser_toolbar_gtk.h index f090119..9611586 100644 --- a/chrome/browser/ui/gtk/browser_toolbar_gtk.h +++ b/chrome/browser/ui/gtk/browser_toolbar_gtk.h @@ -12,8 +12,6 @@ #include "app/active_window_watcher_x.h" #include "app/gtk_signal.h" #include "app/gtk_signal_registrar.h" -#include "app/menus/accelerator.h" -#include "app/menus/simple_menu_model.h" #include "base/scoped_ptr.h" #include "chrome/browser/command_updater.h" #include "chrome/browser/gtk/custom_button.h" @@ -23,6 +21,8 @@ #include "chrome/browser/ui/toolbar/wrench_menu_model.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/models/accelerator.h" +#include "ui/base/models/simple_menu_model.h" class BackForwardButtonGtk; class Browser; @@ -40,7 +40,7 @@ class ToolbarModel; // View class that displays the GTK version of the toolbar and routes gtk // events back to the Browser. class BrowserToolbarGtk : public CommandUpdater::CommandObserver, - public menus::AcceleratorProvider, + public ui::AcceleratorProvider, public MenuGtk::Delegate, public NotificationObserver { public: @@ -93,9 +93,9 @@ class BrowserToolbarGtk : public CommandUpdater::CommandObserver, virtual GtkIconSet* GetIconSetForId(int idr); virtual bool AlwaysShowIconForCmd(int command_id) const; - // Overridden from menus::AcceleratorProvider: + // Overridden from ui::AcceleratorProvider: virtual bool GetAcceleratorForCommandId(int id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); // NotificationObserver implementation. virtual void Observe(NotificationType type, diff --git a/chrome/browser/ui/gtk/gtk_tree.cc b/chrome/browser/ui/gtk/gtk_tree.cc index e0673cc..90d943c 100644 --- a/chrome/browser/ui/gtk/gtk_tree.cc +++ b/chrome/browser/ui/gtk/gtk_tree.cc @@ -4,12 +4,12 @@ #include "chrome/browser/gtk/gtk_tree.h" -#include "app/table_model.h" #include "base/logging.h" #include "base/utf_string_conversions.h" #include "chrome/browser/gtk/gtk_theme_provider.h" #include "gfx/gtk_util.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/table_model.h" namespace gtk_tree { @@ -81,13 +81,13 @@ void GetSelectedIndices(GtkTreeSelection* selection, std::set<int>* out) { // TableAdapter TableAdapter::TableAdapter(Delegate* delegate, GtkListStore* list_store, - TableModel* table_model) + ui::TableModel* table_model) : delegate_(delegate), list_store_(list_store), table_model_(table_model) { if (table_model) table_model->SetObserver(this); } -void TableAdapter::SetModel(TableModel* table_model) { +void TableAdapter::SetModel(ui::TableModel* table_model) { table_model_ = table_model; table_model_->SetObserver(this); } @@ -125,8 +125,8 @@ void TableAdapter::MapListStoreIndicesToModelRows( return; } - const TableModel::Groups& groups = table_model_->GetGroups(); - TableModel::Groups::const_iterator group_it = groups.begin(); + const ui::TableModel::Groups& groups = table_model_->GetGroups(); + ui::TableModel::Groups::const_iterator group_it = groups.begin(); for (std::set<int>::const_iterator list_store_it = list_store_indices.begin(); list_store_it != list_store_indices.end(); ++list_store_it) { @@ -162,8 +162,8 @@ int TableAdapter::GetListStoreIndexForModelRow(int model_row) const { if (!table_model_->HasGroups()) return model_row; int group = table_model_->GetGroupID(model_row); - const TableModel::Groups& groups = table_model_->GetGroups(); - for (TableModel::Groups::const_iterator it = groups.begin(); + const ui::TableModel::Groups& groups = table_model_->GetGroups(); + for (ui::TableModel::Groups::const_iterator it = groups.begin(); it != groups.end(); ++it) { if (it->id == group) { return model_row + OffsetForGroupIndex(it - groups.begin()); @@ -202,8 +202,8 @@ void TableAdapter::OnModelChanged() { delegate_->OnModelChanged(); if (table_model_->HasGroups()) { - const TableModel::Groups& groups = table_model_->GetGroups(); - for (TableModel::Groups::const_iterator it = groups.begin(); + const ui::TableModel::Groups& groups = table_model_->GetGroups(); + for (ui::TableModel::Groups::const_iterator it = groups.begin(); it != groups.end(); ++it) { GtkTreeIter iter; if (it != groups.begin()) { @@ -341,7 +341,7 @@ gboolean TableAdapter::OnSelectionFilter(GtkTreeSelection* selection, //////////////////////////////////////////////////////////////////////////////// // TreeAdapter -TreeAdapter::TreeAdapter(Delegate* delegate, TreeModel* tree_model) +TreeAdapter::TreeAdapter(Delegate* delegate, ui::TreeModel* tree_model) : delegate_(delegate), tree_model_(tree_model) { tree_store_ = gtk_tree_store_new(COL_COUNT, @@ -369,15 +369,15 @@ void TreeAdapter::Init() { } -TreeModelNode* TreeAdapter::GetNode(GtkTreeIter* iter) { - TreeModelNode* node; +ui::TreeModelNode* TreeAdapter::GetNode(GtkTreeIter* iter) { + ui::TreeModelNode* node; gtk_tree_model_get(GTK_TREE_MODEL(tree_store_), iter, COL_NODE_PTR, &node, -1); return node; } -void TreeAdapter::FillRow(GtkTreeIter* iter, TreeModelNode* node) { +void TreeAdapter::FillRow(GtkTreeIter* iter, ui::TreeModelNode* node) { GdkPixbuf* pixbuf = NULL; int icon_index = tree_model_->GetIconIndex(node); if (icon_index >= 0 && icon_index < static_cast<int>(pixbufs_.size())) @@ -391,21 +391,22 @@ void TreeAdapter::FillRow(GtkTreeIter* iter, TreeModelNode* node) { -1); } -void TreeAdapter::Fill(GtkTreeIter* parent_iter, TreeModelNode* parent_node) { +void TreeAdapter::Fill(GtkTreeIter* parent_iter, + ui::TreeModelNode* parent_node) { if (parent_iter) FillRow(parent_iter, parent_node); GtkTreeIter iter; int child_count = tree_model_->GetChildCount(parent_node); for (int i = 0; i < child_count; ++i) { - TreeModelNode* node = tree_model_->GetChild(parent_node, i); + ui::TreeModelNode* node = tree_model_->GetChild(parent_node, i); gtk_tree_store_append(tree_store_, &iter, parent_iter); Fill(&iter, node); } } -GtkTreePath* TreeAdapter::GetTreePath(TreeModelNode* node) { +GtkTreePath* TreeAdapter::GetTreePath(ui::TreeModelNode* node) { GtkTreePath* path = gtk_tree_path_new(); - TreeModelNode* parent = node; + ui::TreeModelNode* parent = node; while (parent) { parent = tree_model_->GetParent(parent); if (parent) { @@ -417,7 +418,7 @@ GtkTreePath* TreeAdapter::GetTreePath(TreeModelNode* node) { return path; } -bool TreeAdapter::GetTreeIter(TreeModelNode* node, GtkTreeIter* iter) { +bool TreeAdapter::GetTreeIter(ui::TreeModelNode* node, GtkTreeIter* iter) { GtkTreePath* path = GetTreePath(node); bool rv = false; // Check the path ourselves since gtk_tree_model_get_iter prints a warning if @@ -429,8 +430,8 @@ bool TreeAdapter::GetTreeIter(TreeModelNode* node, GtkTreeIter* iter) { return rv; } -void TreeAdapter::TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, +void TreeAdapter::TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { delegate_->OnAnyModelUpdateStart(); @@ -446,8 +447,8 @@ void TreeAdapter::TreeNodesAdded(TreeModel* model, delegate_->OnAnyModelUpdate(); } -void TreeAdapter::TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, +void TreeAdapter::TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { delegate_->OnAnyModelUpdateStart(); @@ -462,7 +463,8 @@ void TreeAdapter::TreeNodesRemoved(TreeModel* model, delegate_->OnAnyModelUpdate(); } -void TreeAdapter::TreeNodeChanged(TreeModel* model, TreeModelNode* node) { +void TreeAdapter::TreeNodeChanged(ui::TreeModel* model, + ui::TreeModelNode* node) { delegate_->OnAnyModelUpdateStart(); GtkTreeIter iter; if (GetTreeIter(node, &iter)) diff --git a/chrome/browser/ui/gtk/gtk_tree.h b/chrome/browser/ui/gtk/gtk_tree.h index a37e5d1..d527a45 100644 --- a/chrome/browser/ui/gtk/gtk_tree.h +++ b/chrome/browser/ui/gtk/gtk_tree.h @@ -10,12 +10,14 @@ #include <set> #include <vector> -#include "app/table_model_observer.h" -#include "app/tree_model.h" #include "base/basictypes.h" #include "chrome/browser/remove_rows_table_model.h" +#include "ui/base/models/table_model_observer.h" +#include "ui/base/models/tree_model.h" +namespace ui { class TableModel; +} namespace gtk_tree { @@ -42,8 +44,8 @@ bool RemoveRecursively(GtkTreeStore* tree_store, GtkTreeIter* iter); // Writes all the indexes of selected rows into |out|. void GetSelectedIndices(GtkTreeSelection* selection, std::set<int>* out); -// A helper class for populating a GtkListStore from a TableModel. -class TableAdapter : public TableModelObserver { +// A helper class for populating a GtkListStore from a ui::TableModel. +class TableAdapter : public ui::TableModelObserver { public: enum ColumnID { @@ -61,16 +63,17 @@ class TableAdapter : public TableModelObserver { // Should fill in the column and row. virtual void SetColumnValues(int row, GtkTreeIter* iter) = 0; - // Called after any change to the TableModel but before the corresponding - // change to the GtkListStore. + // Called after any change to the ui::TableModel but before the + // corresponding change to the GtkListStore. virtual void OnAnyModelUpdateStart() {} - // Called after any change to the TableModel. + // Called after any change to the ui::TableModel. virtual void OnAnyModelUpdate() {} - // When the TableModel has been completely changed, called by OnModelChanged - // after clearing the list store. Can be overriden by the delegate if it - // needs to do extra initialization before the list store is populated. + // When the ui::TableModel has been completely changed, called by + // OnModelChanged after clearing the list store. Can be overridden by the + // delegate if it needs to do extra initialization before the list store is + // populated. virtual void OnModelChanged() {} protected: @@ -80,14 +83,14 @@ class TableAdapter : public TableModelObserver { // |table_model| may be NULL. TableAdapter(Delegate* delegate, GtkListStore* list_store, - TableModel* table_model); + ui::TableModel* table_model); virtual ~TableAdapter() {} - // Replace the TableModel with a different one. If the list store currenty - // has items this would cause weirdness, so this should generally only be - // called during the Delegate's OnModelChanged call, or if the adapter was - // created with a NULL |table_model|. - void SetModel(TableModel* table_model); + // Replace the ui::TableModel with a different one. If the list store + // currently has items this would cause weirdness, so this should generally + // only be called during the Delegate's OnModelChanged call, or if the adapter + // was created with a NULL |table_model|. + void SetModel(ui::TableModel* table_model); // Add all model rows corresponding to the given list store indices to |rows|. void MapListStoreIndicesToModelRows(const std::set<int>& list_store_indices, @@ -107,7 +110,7 @@ class TableAdapter : public TableModelObserver { gboolean path_currently_selected, gpointer user_data); - // TableModelObserver implementation. + // ui::TableModelObserver implementation. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); @@ -121,19 +124,19 @@ class TableAdapter : public TableModelObserver { // Return the index into the list store for the given model row. int GetListStoreIndexForModelRow(int model_row) const; - // Add the values from |row| of the TableModel. + // Add the values from |row| of the ui::TableModel. void AddNodeToList(int row); Delegate* delegate_; GtkListStore* list_store_; - TableModel* table_model_; + ui::TableModel* table_model_; DISALLOW_COPY_AND_ASSIGN(TableAdapter); }; // A helper class for populating a GtkTreeStore from a TreeModel. // TODO(mattm): support SetRootShown(true) -class TreeAdapter : public TreeModelObserver { +class TreeAdapter : public ui::TreeModelObserver { public: // Column ids for |tree_store_|. enum { @@ -156,7 +159,7 @@ class TreeAdapter : public TreeModelObserver { virtual ~Delegate() {} }; - TreeAdapter(Delegate* delegate, TreeModel* tree_model); + TreeAdapter(Delegate* delegate, ui::TreeModel* tree_model); virtual ~TreeAdapter(); // Populate the tree store from the |tree_model_|. @@ -166,37 +169,37 @@ class TreeAdapter : public TreeModelObserver { GtkTreeStore* tree_store() { return tree_store_; } // Get the TreeModelNode corresponding to iter in the tree store. - TreeModelNode* GetNode(GtkTreeIter* iter); + ui::TreeModelNode* GetNode(GtkTreeIter* iter); // Begin TreeModelObserver implementation. - virtual void TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node); + virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node); // End TreeModelObserver implementation. private: // Fill the tree store values for a given node. - void FillRow(GtkTreeIter* iter, TreeModelNode* node); + void FillRow(GtkTreeIter* iter, ui::TreeModelNode* node); // Fill the tree store for a row and all its descendants. - void Fill(GtkTreeIter* parent_iter, TreeModelNode* parent_node); + void Fill(GtkTreeIter* parent_iter, ui::TreeModelNode* parent_node); // Get the GtkTreePath in the tree store for the given node. // The returned path should be freed with gtk_tree_path_free. - GtkTreePath* GetTreePath(TreeModelNode* node); + GtkTreePath* GetTreePath(ui::TreeModelNode* node); // Get the GtkTreeIter in the tree store for the given node. - bool GetTreeIter(TreeModelNode* node, GtkTreeIter* iter); + bool GetTreeIter(ui::TreeModelNode* node, GtkTreeIter* iter); Delegate* delegate_; GtkTreeStore* tree_store_; - TreeModel* tree_model_; + ui::TreeModel* tree_model_; std::vector<GdkPixbuf*> pixbufs_; DISALLOW_COPY_AND_ASSIGN(TreeAdapter); diff --git a/chrome/browser/ui/gtk/keyword_editor_view.cc b/chrome/browser/ui/gtk/keyword_editor_view.cc index c9cd9e7..5463c57 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.cc +++ b/chrome/browser/ui/gtk/keyword_editor_view.cc @@ -298,7 +298,7 @@ void KeywordEditorView::OnModelChanged() { model_second_group_index_ = table_model_->last_search_engine_index(); gtk_list_store_clear(list_store_); - TableModel::Groups groups(table_model_->GetGroups()); + ui::TableModel::Groups groups(table_model_->GetGroups()); if (groups.size() != 2) { NOTREACHED(); return; diff --git a/chrome/browser/ui/gtk/keyword_editor_view.h b/chrome/browser/ui/gtk/keyword_editor_view.h index 0b138a0..9a08c67 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view.h +++ b/chrome/browser/ui/gtk/keyword_editor_view.h @@ -8,20 +8,20 @@ #include <gtk/gtk.h> -#include "app/table_model_observer.h" #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/scoped_ptr.h" #include "base/string16.h" #include "chrome/browser/search_engines/edit_search_engine_controller.h" #include "chrome/browser/search_engines/template_url_model_observer.h" +#include "ui/base/models/table_model_observer.h" class AccessibleWidgetHelper; class KeywordEditorController; class Profile; class TemplateURLTableModel; -class KeywordEditorView : public TableModelObserver, +class KeywordEditorView : public ui::TableModelObserver, public TemplateURLModelObserver, public EditSearchEngineControllerDelegate { public: @@ -77,7 +77,7 @@ class KeywordEditorView : public TableModelObserver, // Add the values from |row| of |table_model_|. void AddNodeToList(int row); - // TableModelObserver implementation. + // ui::TableModelObserver implementation. virtual void OnModelChanged(); virtual void OnItemsChanged(int start, int length); virtual void OnItemsAdded(int start, int length); diff --git a/chrome/browser/ui/gtk/keyword_editor_view_unittest.cc b/chrome/browser/ui/gtk/keyword_editor_view_unittest.cc index 345f50a1..5f4043a 100644 --- a/chrome/browser/ui/gtk/keyword_editor_view_unittest.cc +++ b/chrome/browser/ui/gtk/keyword_editor_view_unittest.cc @@ -55,7 +55,7 @@ class KeywordEditorViewTest : public testing::Test { // Ex: EXPECT_STREQ("!,_,A (Default),_,@,_,B", // GetDisplayedEngines(editor).c_str()); std::string GetDisplayedEngines(const KeywordEditorView& editor) { - TableModel::Groups groups(editor.table_model_->GetGroups()); + ui::TableModel::Groups groups(editor.table_model_->GetGroups()); std::vector<std::string> parts; GtkTreeModel* tree_model = GTK_TREE_MODEL(editor.list_store_); GtkTreeIter iter; diff --git a/chrome/browser/ui/gtk/menu_gtk.cc b/chrome/browser/ui/gtk/menu_gtk.cc index 4836ba6..08f836e 100644 --- a/chrome/browser/ui/gtk/menu_gtk.cc +++ b/chrome/browser/ui/gtk/menu_gtk.cc @@ -6,9 +6,6 @@ #include <map> -#include "app/menus/accelerator_gtk.h" -#include "app/menus/button_menu_item_model.h" -#include "app/menus/menu_model.h" #include "base/i18n/rtl.h" #include "base/logging.h" #include "base/message_loop.h" @@ -20,6 +17,9 @@ #include "chrome/browser/gtk/gtk_util.h" #include "gfx/gtk_util.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/accelerator_gtk.h" +#include "ui/base/models/button_menu_item_model.h" +#include "ui/base/models/menu_model.h" #include "webkit/glue/window_open_disposition.h" bool MenuGtk::block_activation_ = false; @@ -47,13 +47,13 @@ bool GetMenuItemID(GtkWidget* menu_item, int* menu_id) { return false; } -menus::MenuModel* ModelForMenuItem(GtkMenuItem* menu_item) { - return reinterpret_cast<menus::MenuModel*>( +ui::MenuModel* ModelForMenuItem(GtkMenuItem* menu_item) { + return reinterpret_cast<ui::MenuModel*>( g_object_get_data(G_OBJECT(menu_item), "model")); } void SetupButtonShowHandler(GtkWidget* button, - menus::ButtonMenuItemModel* model, + ui::ButtonMenuItemModel* model, int index) { g_object_set_data(G_OBJECT(button), "button-model", model); @@ -275,7 +275,7 @@ GtkWidget* MenuGtk::Delegate::GetImageForCommandId(int command_id) const { } MenuGtk::MenuGtk(MenuGtk::Delegate* delegate, - menus::MenuModel* model) + ui::MenuModel* model) : delegate_(delegate), model_(model), dummy_accel_group_(gtk_accel_group_new()), @@ -343,7 +343,7 @@ GtkWidget* MenuGtk::AppendMenuItem(int command_id, GtkWidget* menu_item) { } GtkWidget* MenuGtk::AppendMenuItemToMenu(int index, - menus::MenuModel* model, + ui::MenuModel* model, GtkWidget* menu_item, GtkWidget* menu, bool connect_to_activate) { @@ -443,7 +443,7 @@ void MenuGtk::BuildMenuFromModel() { BuildSubmenuFromModel(model_, menu_); } -void MenuGtk::BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu) { +void MenuGtk::BuildSubmenuFromModel(ui::MenuModel* model, GtkWidget* menu) { std::map<int, GtkWidget*> radio_groups; GtkWidget* menu_item = NULL; for (int i = 0; i < model->GetItemCount(); ++i) { @@ -454,15 +454,15 @@ void MenuGtk::BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu) { bool connect_to_activate = true; switch (model->GetTypeAt(i)) { - case menus::MenuModel::TYPE_SEPARATOR: + case ui::MenuModel::TYPE_SEPARATOR: menu_item = gtk_separator_menu_item_new(); break; - case menus::MenuModel::TYPE_CHECK: + case ui::MenuModel::TYPE_CHECK: menu_item = gtk_check_menu_item_new_with_mnemonic(label.c_str()); break; - case menus::MenuModel::TYPE_RADIO: { + case ui::MenuModel::TYPE_RADIO: { std::map<int, GtkWidget*>::iterator iter = radio_groups.find(model->GetGroupIdAt(i)); @@ -476,15 +476,15 @@ void MenuGtk::BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu) { } break; } - case menus::MenuModel::TYPE_BUTTON_ITEM: { - menus::ButtonMenuItemModel* button_menu_item_model = + case ui::MenuModel::TYPE_BUTTON_ITEM: { + ui::ButtonMenuItemModel* button_menu_item_model = model->GetButtonMenuItemAt(i); menu_item = BuildButtomMenuItem(button_menu_item_model, menu); connect_to_activate = false; break; } - case menus::MenuModel::TYPE_SUBMENU: - case menus::MenuModel::TYPE_COMMAND: { + case ui::MenuModel::TYPE_SUBMENU: + case ui::MenuModel::TYPE_COMMAND: { int command_id = model->GetCommandIdAt(i); if (model->GetIconAt(i, &icon)) menu_item = BuildMenuItemWithImage(label, icon); @@ -500,13 +500,13 @@ void MenuGtk::BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu) { NOTREACHED(); } - if (model->GetTypeAt(i) == menus::MenuModel::TYPE_SUBMENU) { + if (model->GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) { GtkWidget* submenu = gtk_menu_new(); BuildSubmenuFromModel(model->GetSubmenuModelAt(i), submenu); gtk_menu_item_set_submenu(GTK_MENU_ITEM(menu_item), submenu); } - menus::AcceleratorGtk accelerator; + ui::AcceleratorGtk accelerator; if (model->GetAcceleratorAt(i, &accelerator)) { gtk_widget_add_accelerator(menu_item, "activate", @@ -523,7 +523,7 @@ void MenuGtk::BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu) { } } -GtkWidget* MenuGtk::BuildButtomMenuItem(menus::ButtonMenuItemModel* model, +GtkWidget* MenuGtk::BuildButtomMenuItem(ui::ButtonMenuItemModel* model, GtkWidget* menu) { GtkWidget* menu_item = gtk_custom_menu_item_new( gfx::RemoveWindowsStyleAccelerators(UTF16ToUTF8(model->label())).c_str()); @@ -540,11 +540,11 @@ GtkWidget* MenuGtk::BuildButtomMenuItem(menus::ButtonMenuItemModel* model, GtkWidget* button = NULL; switch (model->GetTypeAt(i)) { - case menus::ButtonMenuItemModel::TYPE_SPACE: { + case ui::ButtonMenuItemModel::TYPE_SPACE: { gtk_custom_menu_item_add_space(GTK_CUSTOM_MENU_ITEM(menu_item)); break; } - case menus::ButtonMenuItemModel::TYPE_BUTTON: { + case ui::ButtonMenuItemModel::TYPE_BUTTON: { button = gtk_custom_menu_item_add_button( GTK_CUSTOM_MENU_ITEM(menu_item), model->GetCommandIdAt(i)); @@ -562,7 +562,7 @@ GtkWidget* MenuGtk::BuildButtomMenuItem(menus::ButtonMenuItemModel* model, SetupButtonShowHandler(button, model, i); break; } - case menus::ButtonMenuItemModel::TYPE_BUTTON_LABEL: { + case ui::ButtonMenuItemModel::TYPE_BUTTON_LABEL: { button = gtk_custom_menu_item_add_button_label( GTK_CUSTOM_MENU_ITEM(menu_item), model->GetCommandIdAt(i)); @@ -610,7 +610,7 @@ void MenuGtk::OnMenuItemActivated(GtkWidget* menuitem) { if (!GetMenuItemID(menuitem, &id)) return; - menus::MenuModel* model = ModelForMenuItem(GTK_MENU_ITEM(menuitem)); + ui::MenuModel* model = ModelForMenuItem(GTK_MENU_ITEM(menuitem)); // The menu item can still be activated by hotkeys even if it is disabled. if (model->IsEnabledAt(id)) @@ -618,8 +618,8 @@ void MenuGtk::OnMenuItemActivated(GtkWidget* menuitem) { } void MenuGtk::OnMenuButtonPressed(GtkWidget* menu_item, int command_id) { - menus::ButtonMenuItemModel* model = - reinterpret_cast<menus::ButtonMenuItemModel*>( + ui::ButtonMenuItemModel* model = + reinterpret_cast<ui::ButtonMenuItemModel*>( g_object_get_data(G_OBJECT(menu_item), "button-model")); if (model && model->IsCommandIdEnabled(command_id)) { if (delegate_) @@ -632,8 +632,8 @@ void MenuGtk::OnMenuButtonPressed(GtkWidget* menu_item, int command_id) { gboolean MenuGtk::OnMenuTryButtonPressed(GtkWidget* menu_item, int command_id) { gboolean pressed = FALSE; - menus::ButtonMenuItemModel* model = - reinterpret_cast<menus::ButtonMenuItemModel*>( + ui::ButtonMenuItemModel* model = + reinterpret_cast<ui::ButtonMenuItemModel*>( g_object_get_data(G_OBJECT(menu_item), "button-model")); if (model && model->IsCommandIdEnabled(command_id) && @@ -710,7 +710,7 @@ void MenuGtk::PointMenuPositionFunc(GtkMenu* menu, *y = CalculateMenuYPosition(&screen_rect, &menu_req, NULL, *y); } -void MenuGtk::ExecuteCommand(menus::MenuModel* model, int id) { +void MenuGtk::ExecuteCommand(ui::MenuModel* model, int id) { if (delegate_) delegate_->CommandWillBeExecuted(); @@ -738,8 +738,8 @@ void MenuGtk::OnMenuHidden(GtkWidget* widget) { // static void MenuGtk::SetButtonItemInfo(GtkWidget* button, gpointer userdata) { - menus::ButtonMenuItemModel* model = - reinterpret_cast<menus::ButtonMenuItemModel*>( + ui::ButtonMenuItemModel* model = + reinterpret_cast<ui::ButtonMenuItemModel*>( g_object_get_data(G_OBJECT(button), "button-model")); int index = GPOINTER_TO_INT(g_object_get_data( G_OBJECT(button), "button-model-id")); @@ -766,7 +766,7 @@ void MenuGtk::SetMenuItemInfo(GtkWidget* widget, gpointer userdata) { if (!GetMenuItemID(widget, &id)) return; - menus::MenuModel* model = ModelForMenuItem(GTK_MENU_ITEM(widget)); + ui::MenuModel* model = ModelForMenuItem(GTK_MENU_ITEM(widget)); if (!model) { // If we're not providing the sub menu, then there's no model. For // example, the IME submenu doesn't have a model. diff --git a/chrome/browser/ui/gtk/menu_gtk.h b/chrome/browser/ui/gtk/menu_gtk.h index 1802caa..abe78a6 100644 --- a/chrome/browser/ui/gtk/menu_gtk.h +++ b/chrome/browser/ui/gtk/menu_gtk.h @@ -17,7 +17,7 @@ class SkBitmap; -namespace menus { +namespace ui { class ButtonMenuItemModel; class MenuModel; } @@ -54,7 +54,7 @@ class MenuGtk { static GtkWidget* GetDefaultImageForCommandId(int command_id); }; - MenuGtk(MenuGtk::Delegate* delegate, menus::MenuModel* model); + MenuGtk(MenuGtk::Delegate* delegate, ui::MenuModel* model); ~MenuGtk(); // Initialize GTK signal handlers. @@ -70,7 +70,7 @@ class MenuGtk { GtkWidget* AppendSeparator(); GtkWidget* AppendMenuItem(int command_id, GtkWidget* menu_item); GtkWidget* AppendMenuItemToMenu(int index, - menus::MenuModel* model, + ui::MenuModel* model, GtkWidget* menu_item, GtkWidget* menu, bool connect_to_activate); @@ -139,12 +139,12 @@ class MenuGtk { // A function that creates a GtkMenu from |model_|. void BuildMenuFromModel(); // Implementation of the above; called recursively. - void BuildSubmenuFromModel(menus::MenuModel* model, GtkWidget* menu); + void BuildSubmenuFromModel(ui::MenuModel* model, GtkWidget* menu); // Builds a menu item with buttons in it from the data in the model. - GtkWidget* BuildButtomMenuItem(menus::ButtonMenuItemModel* model, + GtkWidget* BuildButtomMenuItem(ui::ButtonMenuItemModel* model, GtkWidget* menu); - void ExecuteCommand(menus::MenuModel* model, int id); + void ExecuteCommand(ui::MenuModel* model, int id); // Callback for when a menu item is clicked. CHROMEGTK_CALLBACK_0(MenuGtk, void, OnMenuItemActivated); @@ -174,7 +174,7 @@ class MenuGtk { // If non-NULL, the MenuModel that we use to populate and control the GTK // menu (overriding the delegate as a controller). - menus::MenuModel* model_; + ui::MenuModel* model_; // For some menu items, we want to show the accelerator, but not actually // explicitly handle it. To this end we connect those menu items' accelerators diff --git a/chrome/browser/ui/gtk/options/languages_page_gtk.cc b/chrome/browser/ui/gtk/options/languages_page_gtk.cc index 659b49a..1da7e37 100644 --- a/chrome/browser/ui/gtk/options/languages_page_gtk.cc +++ b/chrome/browser/ui/gtk/options/languages_page_gtk.cc @@ -27,7 +27,7 @@ namespace { const int kWrapWidth = 475; -GtkWidget* NewComboboxFromModel(ComboboxModel* model) { +GtkWidget* NewComboboxFromModel(ui::ComboboxModel* model) { GtkWidget* combobox = gtk_combo_box_new_text(); int count = model->GetItemCount(); for (int i = 0; i < count; ++i) diff --git a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc index 2891b46..5c6211d 100644 --- a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc +++ b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.cc @@ -47,7 +47,7 @@ void StatusIconGtk::OnClick(GtkWidget* widget) { DispatchClickEvent(); } -void StatusIconGtk::UpdatePlatformContextMenu(menus::MenuModel* model) { +void StatusIconGtk::UpdatePlatformContextMenu(ui::MenuModel* model) { if (!model) menu_.reset(); else diff --git a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h index cc9a3cd..686fb6e 100644 --- a/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h +++ b/chrome/browser/ui/gtk/status_icons/status_icon_gtk.h @@ -29,7 +29,7 @@ class StatusIconGtk : public StatusIcon { protected: // Overridden from StatusIcon. - virtual void UpdatePlatformContextMenu(menus::MenuModel* menu); + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu); private: // Callback invoked when user right-clicks on the status icon. diff --git a/chrome/browser/ui/gtk/status_icons/status_tray_gtk_unittest.cc b/chrome/browser/ui/gtk/status_icons/status_tray_gtk_unittest.cc index afc12ae..3b2b373 100644 --- a/chrome/browser/ui/gtk/status_icons/status_tray_gtk_unittest.cc +++ b/chrome/browser/ui/gtk/status_icons/status_tray_gtk_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -12,6 +11,7 @@ #include "grit/theme_resources.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/models/simple_menu_model.h" namespace { @@ -34,7 +34,7 @@ TEST(StatusTrayGtkTest, CreateIcon) { icon->SetImage(*bitmap); icon->SetPressedImage(*bitmap); icon->SetToolTip(ASCIIToUTF16("tool tip")); - menus::SimpleMenuModel* menu = new menus::SimpleMenuModel(NULL); + ui::SimpleMenuModel* menu = new ui::SimpleMenuModel(NULL); menu->AddItem(0, ASCIIToUTF16("foo")); icon->SetContextMenu(menu); } diff --git a/chrome/browser/ui/gtk/tabs/tab_gtk.cc b/chrome/browser/ui/gtk/tabs/tab_gtk.cc index ae6de10..764b136 100644 --- a/chrome/browser/ui/gtk/tabs/tab_gtk.cc +++ b/chrome/browser/ui/gtk/tabs/tab_gtk.cc @@ -7,7 +7,6 @@ #include <gdk/gdkkeysyms.h> #include "app/gtk_dnd_util.h" -#include "app/menus/accelerator_gtk.h" #include "base/singleton.h" #include "base/utf_string_conversions.h" #include "chrome/app/chrome_command_ids.h" @@ -17,6 +16,7 @@ #include "gfx/path.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/accelerator_gtk.h" namespace { @@ -31,7 +31,7 @@ int GetTitleWidth(gfx::Font* font, string16 title) { } // namespace -class TabGtk::ContextMenuController : public menus::SimpleMenuModel::Delegate, +class TabGtk::ContextMenuController : public ui::SimpleMenuModel::Delegate, public MenuGtk::Delegate { public: explicit ContextMenuController(TabGtk* tab) @@ -52,7 +52,7 @@ class TabGtk::ContextMenuController : public menus::SimpleMenuModel::Delegate, } private: - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const { return false; } @@ -63,12 +63,12 @@ class TabGtk::ContextMenuController : public menus::SimpleMenuModel::Delegate, } virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { int browser_command; if (!TabStripModel::ContextMenuCommandToBrowserCommand(command_id, &browser_command)) return false; - const menus::AcceleratorGtk* accelerator_gtk = + const ui::AcceleratorGtk* accelerator_gtk = AcceleratorsGtk::GetInstance()->GetPrimaryAcceleratorForCommand( browser_command); if (accelerator_gtk) diff --git a/chrome/browser/ui/gtk/task_manager_gtk.cc b/chrome/browser/ui/gtk/task_manager_gtk.cc index b032e20..45459c7 100644 --- a/chrome/browser/ui/gtk/task_manager_gtk.cc +++ b/chrome/browser/ui/gtk/task_manager_gtk.cc @@ -12,7 +12,6 @@ #include <vector> #include "app/l10n_util.h" -#include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "base/auto_reset.h" #include "base/command_line.h" @@ -32,6 +31,7 @@ #include "grit/app_resources.h" #include "grit/chromium_strings.h" #include "third_party/skia/include/core/SkBitmap.h" +#include "ui/base/models/simple_menu_model.h" #if defined(TOOLKIT_VIEWS) #include "views/controls/menu/menu_2.h" @@ -214,11 +214,11 @@ void TreeViewColumnSetWidth(GtkTreeViewColumn* column, gint width) { } // namespace class TaskManagerGtk::ContextMenuController - : public menus::SimpleMenuModel::Delegate { + : public ui::SimpleMenuModel::Delegate { public: explicit ContextMenuController(TaskManagerGtk* task_manager) : task_manager_(task_manager) { - menu_model_.reset(new menus::SimpleMenuModel(this)); + menu_model_.reset(new ui::SimpleMenuModel(this)); for (int i = kTaskManagerPage; i < kTaskManagerColumnCount; i++) { menu_model_->AddCheckItemWithStringId( i, TaskManagerColumnIDToResourceID(i)); @@ -252,7 +252,7 @@ class TaskManagerGtk::ContextMenuController } private: - // menus::SimpleMenuModel::Delegate implementation: + // ui::SimpleMenuModel::Delegate implementation: virtual bool IsCommandIdEnabled(int command_id) const { if (!task_manager_) return false; @@ -270,7 +270,7 @@ class TaskManagerGtk::ContextMenuController virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } @@ -284,7 +284,7 @@ class TaskManagerGtk::ContextMenuController } // The model and view for the right click context menu. - scoped_ptr<menus::SimpleMenuModel> menu_model_; + scoped_ptr<ui::SimpleMenuModel> menu_model_; #if defined(TOOLKIT_VIEWS) scoped_ptr<views::Menu2> menu_; #else diff --git a/chrome/browser/ui/tabs/tab_menu_model.cc b/chrome/browser/ui/tabs/tab_menu_model.cc index 0004fa6..907969d 100644 --- a/chrome/browser/ui/tabs/tab_menu_model.cc +++ b/chrome/browser/ui/tabs/tab_menu_model.cc @@ -9,9 +9,9 @@ #include "chrome/common/chrome_switches.h" #include "grit/generated_resources.h" -TabMenuModel::TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, +TabMenuModel::TabMenuModel(ui::SimpleMenuModel::Delegate* delegate, bool is_pinned) - : menus::SimpleMenuModel(delegate) { + : ui::SimpleMenuModel(delegate) { Build(is_pinned); } diff --git a/chrome/browser/ui/tabs/tab_menu_model.h b/chrome/browser/ui/tabs/tab_menu_model.h index aeff953..61a8e34 100644 --- a/chrome/browser/ui/tabs/tab_menu_model.h +++ b/chrome/browser/ui/tabs/tab_menu_model.h @@ -6,15 +6,15 @@ #define CHROME_BROWSER_UI_TABS_TAB_MENU_MODEL_H_ #pragma once -#include "app/menus/simple_menu_model.h" +#include "ui/base/models/simple_menu_model.h" // A menu model that builds the contents of the tab context menu. This menu has // only one level (no submenus). TabMenuModel caches local state from the // tab (such as the pinned state). To make sure the menu reflects the real state // of the tab a new TabMenuModel should be created each time the menu is shown. -class TabMenuModel : public menus::SimpleMenuModel { +class TabMenuModel : public ui::SimpleMenuModel { public: - TabMenuModel(menus::SimpleMenuModel::Delegate* delegate, bool is_pinned); + TabMenuModel(ui::SimpleMenuModel::Delegate* delegate, bool is_pinned); virtual ~TabMenuModel() {} // Returns true if vertical tabs are enabled. diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.cc b/chrome/browser/ui/toolbar/back_forward_menu_model.cc index 9874ef9..5ef55c165 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.cc +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.cc @@ -59,7 +59,7 @@ int BackForwardMenuModel::GetItemCount() const { return items; } -menus::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const { +ui::MenuModel::ItemType BackForwardMenuModel::GetTypeAt(int index) const { return IsSeparator(index) ? TYPE_SEPARATOR : TYPE_COMMAND; } @@ -98,7 +98,7 @@ bool BackForwardMenuModel::IsItemDynamicAt(int index) const { bool BackForwardMenuModel::GetAcceleratorAt( int index, - menus::Accelerator* accelerator) const { + ui::Accelerator* accelerator) const { return false; } @@ -125,7 +125,7 @@ bool BackForwardMenuModel::GetIconAt(int index, SkBitmap* icon) const { return true; } -menus::ButtonMenuItemModel* BackForwardMenuModel::GetButtonMenuItemAt( +ui::ButtonMenuItemModel* BackForwardMenuModel::GetButtonMenuItemAt( int index) const { return NULL; } @@ -134,7 +134,7 @@ bool BackForwardMenuModel::IsEnabledAt(int index) const { return index < GetItemCount() && !IsSeparator(index); } -menus::MenuModel* BackForwardMenuModel::GetSubmenuModelAt(int index) const { +ui::MenuModel* BackForwardMenuModel::GetSubmenuModelAt(int index) const { return NULL; } diff --git a/chrome/browser/ui/toolbar/back_forward_menu_model.h b/chrome/browser/ui/toolbar/back_forward_menu_model.h index 1d669a0..d256f0c 100644 --- a/chrome/browser/ui/toolbar/back_forward_menu_model.h +++ b/chrome/browser/ui/toolbar/back_forward_menu_model.h @@ -8,10 +8,10 @@ #include <string> -#include "app/menus/menu_model.h" #include "base/basictypes.h" #include "base/gtest_prod_util.h" #include "base/string16.h" +#include "ui/base/models/menu_model.h" #include "webkit/glue/window_open_disposition.h" class Browser; @@ -26,7 +26,7 @@ class NavigationEntry; // Interface for the showing of the dropdown menu for the Back/Forward buttons. // Actual implementations are platform-specific. /////////////////////////////////////////////////////////////////////////////// -class BackForwardMenuModel : public menus::MenuModel { +class BackForwardMenuModel : public ui::MenuModel { public: // These are IDs used to identify individual UI elements within the // browser window using View::GetViewByID. @@ -50,11 +50,11 @@ class BackForwardMenuModel : public menus::MenuModel { virtual string16 GetLabelAt(int index) const; virtual bool IsItemDynamicAt(int index) const; virtual bool GetAcceleratorAt(int index, - menus::Accelerator* accelerator) const; + ui::Accelerator* accelerator) const; virtual bool IsItemCheckedAt(int index) const; virtual int GetGroupIdAt(int index) const; virtual bool GetIconAt(int index, SkBitmap* icon) const; - virtual menus::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; + virtual ui::ButtonMenuItemModel* GetButtonMenuItemAt(int index) const; virtual bool IsEnabledAt(int index) const; virtual MenuModel* GetSubmenuModelAt(int index) const; virtual void HighlightChangedTo(int index); diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.cc b/chrome/browser/ui/toolbar/wrench_menu_model.cc index 7a9a9ba..b3d9c5f 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model.cc @@ -8,7 +8,6 @@ #include <cmath> #include "app/l10n_util.h" -#include "app/menus/button_menu_item_model.h" #include "app/resource_bundle.h" #include "base/command_line.h" #include "base/i18n/number_formatting.h" @@ -36,6 +35,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/button_menu_item_model.h" #if defined(OS_LINUX) #include <gtk/gtk.h> @@ -59,7 +59,7 @@ // EncodingMenuModel EncodingMenuModel::EncodingMenuModel(Browser* browser) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), browser_(browser) { Build(); } @@ -116,7 +116,7 @@ bool EncodingMenuModel::IsCommandIdEnabled(int command_id) const { bool EncodingMenuModel::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return false; } @@ -127,7 +127,7 @@ void EncodingMenuModel::ExecuteCommand(int command_id) { //////////////////////////////////////////////////////////////////////////////// // ZoomMenuModel -ZoomMenuModel::ZoomMenuModel(menus::SimpleMenuModel::Delegate* delegate) +ZoomMenuModel::ZoomMenuModel(ui::SimpleMenuModel::Delegate* delegate) : SimpleMenuModel(delegate) { Build(); } @@ -144,7 +144,7 @@ void ZoomMenuModel::Build() { //////////////////////////////////////////////////////////////////////////////// // ToolsMenuModel -ToolsMenuModel::ToolsMenuModel(menus::SimpleMenuModel::Delegate* delegate, +ToolsMenuModel::ToolsMenuModel(ui::SimpleMenuModel::Delegate* delegate, Browser* browser) : SimpleMenuModel(delegate) { Build(browser); @@ -189,9 +189,9 @@ void ToolsMenuModel::Build(Browser* browser) { //////////////////////////////////////////////////////////////////////////////// // WrenchMenuModel -WrenchMenuModel::WrenchMenuModel(menus::AcceleratorProvider* provider, +WrenchMenuModel::WrenchMenuModel(ui::AcceleratorProvider* provider, Browser* browser) - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), provider_(provider), browser_(browser), tabstrip_model_(browser_->tabstrip_model()) { @@ -321,7 +321,7 @@ bool WrenchMenuModel::IsCommandIdVisible(int command_id) const { bool WrenchMenuModel::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return provider_->GetAcceleratorForCommandId(command_id, accelerator); } @@ -363,7 +363,7 @@ void WrenchMenuModel::Observe(NotificationType type, // For testing. WrenchMenuModel::WrenchMenuModel() - : ALLOW_THIS_IN_INITIALIZER_LIST(menus::SimpleMenuModel(this)), + : ALLOW_THIS_IN_INITIALIZER_LIST(ui::SimpleMenuModel(this)), provider_(NULL), browser_(NULL), tabstrip_model_(NULL) { @@ -380,7 +380,7 @@ void WrenchMenuModel::Build() { // WARNING: Mac does not use the ButtonMenuItemModel, but instead defines the // layout for this menu item in Toolbar.xib. It does, however, use the // command_id value from AddButtonItem() to identify this special item. - edit_menu_item_model_.reset(new menus::ButtonMenuItemModel(IDS_EDIT, this)); + edit_menu_item_model_.reset(new ui::ButtonMenuItemModel(IDS_EDIT, this)); edit_menu_item_model_->AddGroupItemWithStringId(IDC_CUT, IDS_CUT); edit_menu_item_model_->AddGroupItemWithStringId(IDC_COPY, IDS_COPY); edit_menu_item_model_->AddGroupItemWithStringId(IDC_PASTE, IDS_PASTE); @@ -394,7 +394,7 @@ void WrenchMenuModel::Build() { #if defined(OS_MACOSX) || (defined(OS_LINUX) && !defined(TOOLKIT_VIEWS)) // WARNING: See above comment. zoom_menu_item_model_.reset( - new menus::ButtonMenuItemModel(IDS_ZOOM_MENU, this)); + new ui::ButtonMenuItemModel(IDS_ZOOM_MENU, this)); zoom_menu_item_model_->AddGroupItemWithStringId( IDC_ZOOM_MINUS, IDS_ZOOM_MINUS2); zoom_menu_item_model_->AddButtonLabel(IDC_ZOOM_PERCENT_DISPLAY, diff --git a/chrome/browser/ui/toolbar/wrench_menu_model.h b/chrome/browser/ui/toolbar/wrench_menu_model.h index 5ebf7ee..8886de2 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model.h +++ b/chrome/browser/ui/toolbar/wrench_menu_model.h @@ -6,13 +6,13 @@ #define CHROME_BROWSER_UI_TOOLBAR_WRENCH_MENU_MODEL_H_ #pragma once -#include "app/menus/accelerator.h" -#include "app/menus/button_menu_item_model.h" -#include "app/menus/simple_menu_model.h" #include "base/scoped_ptr.h" #include "chrome/browser/tabs/tab_strip_model_observer.h" #include "chrome/common/notification_observer.h" #include "chrome/common/notification_registrar.h" +#include "ui/base/models/accelerator.h" +#include "ui/base/models/button_menu_item_model.h" +#include "ui/base/models/simple_menu_model.h" class Browser; class TabStripModel; @@ -22,17 +22,17 @@ class MockWrenchMenuModel; } // namespace // A menu model that builds the contents of an encoding menu. -class EncodingMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate { +class EncodingMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate { public: explicit EncodingMenuModel(Browser* browser); virtual ~EncodingMenuModel(); - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); private: @@ -44,9 +44,9 @@ class EncodingMenuModel : public menus::SimpleMenuModel, }; // A menu model that builds the contents of the zoom menu. -class ZoomMenuModel : public menus::SimpleMenuModel { +class ZoomMenuModel : public ui::SimpleMenuModel { public: - explicit ZoomMenuModel(menus::SimpleMenuModel::Delegate* delegate); + explicit ZoomMenuModel(ui::SimpleMenuModel::Delegate* delegate); virtual ~ZoomMenuModel(); private: @@ -55,9 +55,9 @@ class ZoomMenuModel : public menus::SimpleMenuModel { DISALLOW_COPY_AND_ASSIGN(ZoomMenuModel); }; -class ToolsMenuModel : public menus::SimpleMenuModel { +class ToolsMenuModel : public ui::SimpleMenuModel { public: - ToolsMenuModel(menus::SimpleMenuModel::Delegate* delegate, Browser* browser); + ToolsMenuModel(ui::SimpleMenuModel::Delegate* delegate, Browser* browser); virtual ~ToolsMenuModel(); private: @@ -69,13 +69,13 @@ class ToolsMenuModel : public menus::SimpleMenuModel { }; // A menu model that builds the contents of the wrench menu. -class WrenchMenuModel : public menus::SimpleMenuModel, - public menus::SimpleMenuModel::Delegate, - public menus::ButtonMenuItemModel::Delegate, +class WrenchMenuModel : public ui::SimpleMenuModel, + public ui::SimpleMenuModel::Delegate, + public ui::ButtonMenuItemModel::Delegate, public TabStripModelObserver, public NotificationObserver { public: - WrenchMenuModel(menus::AcceleratorProvider* provider, Browser* browser); + WrenchMenuModel(ui::AcceleratorProvider* provider, Browser* browser); virtual ~WrenchMenuModel(); // Overridden for ButtonMenuItemModel::Delegate: @@ -91,7 +91,7 @@ class WrenchMenuModel : public menus::SimpleMenuModel, virtual bool IsCommandIdVisible(int command_id) const; virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); // Overridden from TabStripModelObserver: virtual void TabSelectedAt(TabContentsWrapper* old_contents, @@ -130,8 +130,8 @@ class WrenchMenuModel : public menus::SimpleMenuModel, string16 GetSyncMenuLabel() const; // Models for the special menu items with buttons. - scoped_ptr<menus::ButtonMenuItemModel> edit_menu_item_model_; - scoped_ptr<menus::ButtonMenuItemModel> zoom_menu_item_model_; + scoped_ptr<ui::ButtonMenuItemModel> edit_menu_item_model_; + scoped_ptr<ui::ButtonMenuItemModel> zoom_menu_item_model_; // Label of the zoom label in the zoom menu item. string16 zoom_label_; @@ -139,7 +139,7 @@ class WrenchMenuModel : public menus::SimpleMenuModel, // Tools menu. scoped_ptr<ToolsMenuModel> tools_menu_model_; - menus::AcceleratorProvider* provider_; // weak + ui::AcceleratorProvider* provider_; // weak Browser* browser_; // weak TabStripModel* tabstrip_model_; // weak diff --git a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc index 02a41a6..9e88848 100644 --- a/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc +++ b/chrome/browser/ui/toolbar/wrench_menu_model_unittest.cc @@ -13,12 +13,12 @@ #include "testing/gtest/include/gtest/gtest.h" class WrenchMenuModelTest : public BrowserWithTestWindowTest, - public menus::AcceleratorProvider { + public ui::AcceleratorProvider { public: // Don't handle accelerators. virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { return false; } + ui::Accelerator* accelerator) { return false; } }; // Copies parts of MenuModelTest::Delegate and combines them with the @@ -26,7 +26,7 @@ class WrenchMenuModelTest : public BrowserWithTestWindowTest, // not derived from SimpleMenuModel. class TestWrenchMenuModel : public WrenchMenuModel { public: - TestWrenchMenuModel(menus::AcceleratorProvider* provider, + TestWrenchMenuModel(ui::AcceleratorProvider* provider, Browser* browser) : WrenchMenuModel(provider, browser), execute_count_(0), @@ -34,7 +34,7 @@ class TestWrenchMenuModel : public WrenchMenuModel { enable_count_(0) { } - // Testing overrides to menus::SimpleMenuModel::Delegate: + // Testing overrides to ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const { bool val = WrenchMenuModel::IsCommandIdChecked(command_id); if (val) @@ -80,13 +80,13 @@ TEST_F(WrenchMenuModelTest, Basics) { // the delegate as well. Use the first submenu as the tools one. int toolsModelIndex = -1; for (int i = 0; i < itemCount; ++i) { - if (model.GetTypeAt(i) == menus::MenuModel::TYPE_SUBMENU) { + if (model.GetTypeAt(i) == ui::MenuModel::TYPE_SUBMENU) { toolsModelIndex = i; break; } } EXPECT_GT(toolsModelIndex, -1); - menus::MenuModel* toolsModel = model.GetSubmenuModelAt(toolsModelIndex); + ui::MenuModel* toolsModel = model.GetSubmenuModelAt(toolsModelIndex); EXPECT_TRUE(toolsModel); EXPECT_GT(toolsModel->GetItemCount(), 2); toolsModel->ActivatedAt(2); diff --git a/chrome/browser/ui/views/autofill_profiles_view_win.cc b/chrome/browser/ui/views/autofill_profiles_view_win.cc index 3b1670da..f013d83 100644 --- a/chrome/browser/ui/views/autofill_profiles_view_win.cc +++ b/chrome/browser/ui/views/autofill_profiles_view_win.cc @@ -1278,10 +1278,11 @@ string16 AutoFillProfilesView::ContentListTableModel::GetText( } } -TableModel::Groups AutoFillProfilesView::ContentListTableModel::GetGroups() { - TableModel::Groups groups; +ui::TableModel::Groups + AutoFillProfilesView::ContentListTableModel::GetGroups() { + ui::TableModel::Groups groups; - TableModel::Group profile_group; + ui::TableModel::Group profile_group; profile_group.title = l10n_util::GetStringUTF16(IDS_AUTOFILL_ADDRESSES_GROUP_NAME); profile_group.id = kAddressGroup; @@ -1303,7 +1304,7 @@ int AutoFillProfilesView::ContentListTableModel::GetGroupID(int row) { } void AutoFillProfilesView::ContentListTableModel::SetObserver( - TableModelObserver* observer) { + ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/ui/views/autofill_profiles_view_win.h b/chrome/browser/ui/views/autofill_profiles_view_win.h index b758b5a..45eabaf 100644 --- a/chrome/browser/ui/views/autofill_profiles_view_win.h +++ b/chrome/browser/ui/views/autofill_profiles_view_win.h @@ -10,8 +10,6 @@ #include <map> #include <vector> -#include "app/combobox_model.h" -#include "app/table_model.h" #include "base/compiler_specific.h" #include "base/string16.h" #include "chrome/browser/autofill/autofill_dialog.h" @@ -19,6 +17,8 @@ #include "chrome/browser/autofill/personal_data_manager.h" #include "chrome/browser/prefs/pref_member.h" #include "chrome/common/notification_observer.h" +#include "ui/base/models/combobox_model.h" +#include "ui/base/models/table_model.h" #include "views/controls/combobox/combobox.h" #include "views/controls/link.h" #include "views/controls/table/table_view_observer.h" @@ -358,7 +358,7 @@ class AutoFillProfilesView : public views::View, DISALLOW_COPY_AND_ASSIGN(EditableSetViewContents); }; - class StringVectorComboboxModel : public ComboboxModel { + class StringVectorComboboxModel : public ui::ComboboxModel { public: StringVectorComboboxModel() {} virtual ~StringVectorComboboxModel() {} @@ -367,7 +367,7 @@ class AutoFillProfilesView : public views::View, // |source|. void set_cb_strings(std::vector<std::wstring> *source); - // Overridden from ComboboxModel: + // Overridden from ui::ComboboxModel: virtual int GetItemCount(); virtual string16 GetItemAt(int index); @@ -381,7 +381,7 @@ class AutoFillProfilesView : public views::View, }; // Model for scrolling credit cards and addresses. - class ContentListTableModel : public TableModel { + class ContentListTableModel : public ui::TableModel { public: ContentListTableModel(std::vector<EditableSetInfo>* profiles, std::vector<EditableSetInfo>* credit_cards); @@ -398,18 +398,18 @@ class AutoFillProfilesView : public views::View, void RemoveItem(int index); void UpdateItem(int index); - // TableModel members: + // ui::TableModel members: virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column_id) OVERRIDE; virtual bool HasGroups() OVERRIDE { return true; } - virtual TableModel::Groups GetGroups() OVERRIDE; + virtual ui::TableModel::Groups GetGroups() OVERRIDE; virtual int GetGroupID(int row) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; private: std::vector<EditableSetInfo>* profiles_; std::vector<EditableSetInfo>* credit_cards_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(ContentListTableModel); }; diff --git a/chrome/browser/ui/views/bookmark_editor_view.cc b/chrome/browser/ui/views/bookmark_editor_view.cc index 8ae0c5d..d0c3e69 100644 --- a/chrome/browser/ui/views/bookmark_editor_view.cc +++ b/chrome/browser/ui/views/bookmark_editor_view.cc @@ -174,7 +174,7 @@ void BookmarkEditorView::OnTreeViewSelectionChanged( } bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, - TreeModelNode* node) { + ui::TreeModelNode* node) { // Only allow editting of children of the bookmark bar node and other node. EditorNode* bb_node = tree_model_->AsNode(node); return (bb_node->GetParent() && bb_node->GetParent()->GetParent()); @@ -208,7 +208,7 @@ bool BookmarkEditorView::IsCommandIdEnabled(int command_id) const { bool BookmarkEditorView::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return GetWidget()->GetAccelerator(command_id, accelerator); } @@ -249,7 +249,7 @@ void BookmarkEditorView::ShowContextMenu(View* source, (tree_model_->GetParent(tree_view_->GetSelectedNode()) == tree_model_->GetRoot()); if (!context_menu_contents_.get()) { - context_menu_contents_.reset(new menus::SimpleMenuModel(this)); + context_menu_contents_.reset(new ui::SimpleMenuModel(this)); context_menu_contents_->AddItemWithStringId(IDS_EDIT, IDS_EDIT); context_menu_contents_->AddItemWithStringId( IDS_BOOMARK_EDITOR_NEW_FOLDER_MENU_ITEM, diff --git a/chrome/browser/ui/views/bookmark_editor_view.h b/chrome/browser/ui/views/bookmark_editor_view.h index f6da363..d090c48 100644 --- a/chrome/browser/ui/views/bookmark_editor_view.h +++ b/chrome/browser/ui/views/bookmark_editor_view.h @@ -6,8 +6,6 @@ #define CHROME_BROWSER_UI_VIEWS_BOOKMARK_EDITOR_VIEW_H_ #pragma once -#include "app/menus/simple_menu_model.h" -#include "app/tree_node_model.h" #include "base/string16.h" #include "chrome/browser/bookmarks/bookmark_editor.h" #include "chrome/browser/bookmarks/bookmark_model_observer.h" @@ -16,6 +14,8 @@ #include "views/controls/tree/tree_view.h" #include "views/window/dialog_delegate.h" #include "testing/gtest/include/gtest/gtest_prod.h" +#include "ui/base/models/simple_menu_model.h" +#include "ui/base/models/tree_node_model.h" namespace views { class Label; @@ -46,20 +46,20 @@ class BookmarkEditorView : public BookmarkEditor, public views::DialogDelegate, public views::Textfield::Controller, public views::ContextMenuController, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public BookmarkModelObserver { public: // Type of node in the tree. Public purely for testing. - typedef TreeNodeWithValue<int64> EditorNode; + typedef ui::TreeNodeWithValue<int64> EditorNode; // Model for the TreeView. Trivial subclass that doesn't allow titles with // empty strings. Public purely for testing. - class EditorTreeModel : public TreeNodeModel<EditorNode> { + class EditorTreeModel : public ui::TreeNodeModel<EditorNode> { public: explicit EditorTreeModel(EditorNode* root) - : TreeNodeModel<EditorNode>(root) {} + : ui::TreeNodeModel<EditorNode>(root) {} - virtual void SetTitle(TreeModelNode* node, + virtual void SetTitle(ui::TreeModelNode* node, const string16& title) { if (!title.empty()) TreeNodeModel::SetTitle(node, title); @@ -94,7 +94,7 @@ class BookmarkEditorView : public BookmarkEditor, // TreeViewObserver methods. virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); - virtual bool CanEdit(views::TreeView* tree_view, TreeModelNode* node); + virtual bool CanEdit(views::TreeView* tree_view, ui::TreeModelNode* node); // Textfield::Controller methods. virtual void ContentsChanged(views::Textfield* sender, @@ -107,11 +107,11 @@ class BookmarkEditorView : public BookmarkEditor, // NativeButton. virtual void ButtonPressed(views::Button* sender, const views::Event& event); - // menus::SimpleMenuModel::Delegate. + // ui::SimpleMenuModel::Delegate. virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual void ExecuteCommand(int command_id); // Creates a Window and adds the BookmarkEditorView to it. When the window is @@ -247,7 +247,7 @@ class BookmarkEditorView : public BookmarkEditor, const EditDetails details_; // The context menu. - scoped_ptr<menus::SimpleMenuModel> context_menu_contents_; + scoped_ptr<ui::SimpleMenuModel> context_menu_contents_; scoped_ptr<views::Menu2> context_menu_; // Mode used to create nodes from. diff --git a/chrome/browser/ui/views/clear_browsing_data.h b/chrome/browser/ui/views/clear_browsing_data.h index 8b1359e..b7e2ce9 100644 --- a/chrome/browser/ui/views/clear_browsing_data.h +++ b/chrome/browser/ui/views/clear_browsing_data.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_H_ #pragma once -#include "app/combobox_model.h" #include "chrome/browser/browsing_data_remover.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/button.h" #include "views/controls/combobox/combobox.h" #include "views/controls/label.h" @@ -35,7 +35,7 @@ class MessageLoop; class ClearBrowsingDataView : public views::View, public views::DialogDelegate, public views::ButtonListener, - public ComboboxModel, + public ui::ComboboxModel, public views::Combobox::Listener, public BrowsingDataRemover::Observer, public views::LinkController { @@ -69,7 +69,7 @@ class ClearBrowsingDataView : public views::View, virtual bool GetSizeExtraViewHeightToButtons() { return true; } virtual views::View* GetInitiallyFocusedView(); - // Overridden from ComboboxModel: + // Overridden from ui::ComboboxModel: virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/clear_browsing_data_view.h b/chrome/browser/ui/views/clear_browsing_data_view.h index 4145b7b..695382a4 100644 --- a/chrome/browser/ui/views/clear_browsing_data_view.h +++ b/chrome/browser/ui/views/clear_browsing_data_view.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_CLEAR_BROWSING_DATA_VIEW_H_ #pragma once -#include "app/combobox_model.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/ui/views/clear_data_view.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/button.h" #include "views/controls/combobox/combobox.h" #include "views/controls/label.h" @@ -38,7 +38,7 @@ class MessageLoop; //////////////////////////////////////////////////////////////////////////////// class ClearBrowsingDataView2 : public views::View, public views::ButtonListener, - public ComboboxModel, + public ui::ComboboxModel, public views::Combobox::Listener, public BrowsingDataRemover::Observer, public views::LinkController { @@ -50,7 +50,7 @@ class ClearBrowsingDataView2 : public views::View, // Initialize the controls on the dialog. void Init(); - // Overridden from ComboboxModel: + // Overridden from ui::ComboboxModel: virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/clear_data_view.h b/chrome/browser/ui/views/clear_data_view.h index d7a354e..4d2f027 100644 --- a/chrome/browser/ui/views/clear_data_view.h +++ b/chrome/browser/ui/views/clear_data_view.h @@ -6,12 +6,10 @@ #define CHROME_BROWSER_UI_VIEWS_CLEAR_DATA_VIEW_H_ #pragma once -#include "app/combobox_model.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/ui/views/clear_browsing_data_view.h" #include "chrome/browser/ui/views/clear_server_data.h" #include "views/controls/button/button.h" -#include "views/controls/combobox/combobox.h" #include "views/controls/label.h" #include "views/controls/link.h" #include "views/controls/tabbed_pane/tabbed_pane.h" diff --git a/chrome/browser/ui/views/clear_server_data.h b/chrome/browser/ui/views/clear_server_data.h index ed3dad4..925bc54 100644 --- a/chrome/browser/ui/views/clear_server_data.h +++ b/chrome/browser/ui/views/clear_server_data.h @@ -6,7 +6,6 @@ #define CHROME_BROWSER_UI_VIEWS_CLEAR_SERVER_DATA_H_ #pragma once -#include "app/combobox_model.h" #include "chrome/browser/browsing_data_remover.h" #include "chrome/browser/ui/views/clear_data_view.h" #include "chrome/browser/ui/views/confirm_message_box_dialog.h" diff --git a/chrome/browser/ui/views/collected_cookies_win.cc b/chrome/browser/ui/views/collected_cookies_win.cc index 889b653..b939cf5 100644 --- a/chrome/browser/ui/views/collected_cookies_win.cc +++ b/chrome/browser/ui/views/collected_cookies_win.cc @@ -339,7 +339,7 @@ void CollectedCookiesWin::OnTreeViewSelectionChanged( void CollectedCookiesWin::EnableControls() { bool enable_allowed_buttons = false; - TreeModelNode* node = allowed_cookies_tree_->GetSelectedNode(); + ui::TreeModelNode* node = allowed_cookies_tree_->GetSelectedNode(); if (node) { CookieTreeNode* cookie_node = static_cast<CookieTreeNode*>(node); if (cookie_node->GetDetailedInfo().node_type == diff --git a/chrome/browser/ui/views/cookie_info_view.h b/chrome/browser/ui/views/cookie_info_view.h index 071201c..1b8d650 100644 --- a/chrome/browser/ui/views/cookie_info_view.h +++ b/chrome/browser/ui/views/cookie_info_view.h @@ -9,9 +9,9 @@ #include <string> #include <vector> -#include "app/combobox_model.h" #include "base/string16.h" #include "net/base/cookie_monster.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/combobox/combobox.h" #include "views/view.h" @@ -40,7 +40,7 @@ class CookieInfoViewDelegate { // Responsible for displaying a tabular grid of Cookie information. class CookieInfoView : public views::View, public views::Combobox::Listener, - public ComboboxModel { + public ui::ComboboxModel { public: explicit CookieInfoView(bool editable_expiration_date); virtual ~CookieInfoView(); @@ -72,7 +72,7 @@ class CookieInfoView : public views::View, int prev_index, int new_index); - // ComboboxModel overrides for expires_value_combobox_. + // ui::ComboboxModel overrides for expires_value_combobox_. virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.cc b/chrome/browser/ui/views/frame/browser_frame_gtk.cc index 215e50c..f1eb9de 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.cc +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.cc @@ -121,7 +121,7 @@ void BrowserFrameGtk::SetInitialFocus() { } bool BrowserFrameGtk::GetAccelerator(int cmd_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/ui/views/frame/browser_frame_gtk.h b/chrome/browser/ui/views/frame/browser_frame_gtk.h index d7d0ca3..30539f5 100644 --- a/chrome/browser/ui/views/frame/browser_frame_gtk.h +++ b/chrome/browser/ui/views/frame/browser_frame_gtk.h @@ -51,7 +51,7 @@ class BrowserFrameGtk : public BrowserFrame, // Overridden from views::WidgetGtk: virtual views::RootView* CreateRootView(); - virtual bool GetAccelerator(int cmd_id, menus::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); // Overriden from views::WindowGtk: virtual gboolean OnWindowStateEvent(GtkWidget* widget, diff --git a/chrome/browser/ui/views/frame/browser_frame_win.cc b/chrome/browser/ui/views/frame/browser_frame_win.cc index 9fe26b6..ef58aba 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.cc +++ b/chrome/browser/ui/views/frame/browser_frame_win.cc @@ -153,7 +153,7 @@ gfx::Insets BrowserFrameWin::GetClientAreaInsets() const { } bool BrowserFrameWin::GetAccelerator(int cmd_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/ui/views/frame/browser_frame_win.h b/chrome/browser/ui/views/frame/browser_frame_win.h index 69d14a3..d39aa7f 100644 --- a/chrome/browser/ui/views/frame/browser_frame_win.h +++ b/chrome/browser/ui/views/frame/browser_frame_win.h @@ -50,7 +50,7 @@ class BrowserFrameWin : public BrowserFrame, public views::WindowWin { protected: // Overridden from views::WindowWin: virtual gfx::Insets GetClientAreaInsets() const; - virtual bool GetAccelerator(int cmd_id, menus::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnEnterSizeMove(); virtual void OnExitSizeMove(); diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 4ba5d41..d0aebca 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -615,7 +615,7 @@ bool BrowserView::AcceleratorPressed(const views::Accelerator& accelerator) { return browser_->ExecuteCommandIfEnabled(command_id); } -bool BrowserView::GetAccelerator(int cmd_id, menus::Accelerator* accelerator) { +bool BrowserView::GetAccelerator(int cmd_id, ui::Accelerator* accelerator) { // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators // anywhere so we need to check for them explicitly here. switch (cmd_id) { @@ -1517,7 +1517,7 @@ void BrowserView::TabStripEmpty() { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView, menus::SimpleMenuModel::Delegate implementation: +// BrowserView, ui::SimpleMenuModel::Delegate implementation: bool BrowserView::IsCommandIdChecked(int command_id) const { // TODO(beng): encoding menu. @@ -1530,7 +1530,7 @@ bool BrowserView::IsCommandIdEnabled(int command_id) const { } bool BrowserView::GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { // Let's let the ToolbarView own the canonical implementation of this method. return toolbar_->GetAcceleratorForCommandId(command_id, accelerator); } diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 1825d64a..1ee648f 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -10,7 +10,6 @@ #include <string> #include <vector> -#include "app/menus/simple_menu_model.h" #include "base/scoped_ptr.h" #include "base/timer.h" #include "build/build_config.h" @@ -26,6 +25,7 @@ #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" #include "chrome/common/notification_registrar.h" #include "gfx/native_widget_types.h" +#include "ui/base/models/simple_menu_model.h" #include "views/controls/single_split_view.h" #include "views/window/client_view.h" #include "views/window/window_delegate.h" @@ -81,7 +81,7 @@ class BrowserView : public BrowserBubbleHost, public BrowserWindowTesting, public NotificationObserver, public TabStripModelObserver, - public menus::SimpleMenuModel::Delegate, + public ui::SimpleMenuModel::Delegate, public views::WindowDelegate, public views::ClientView, public InfoBarContainer::Delegate, @@ -178,7 +178,7 @@ class BrowserView : public BrowserBubbleHost, // command id. This can be used to provide menu item shortcut hints etc. // Returns true if an accelerator was found for the specified |cmd_id|, false // otherwise. - bool GetAccelerator(int cmd_id, menus::Accelerator* accelerator); + bool GetAccelerator(int cmd_id, ui::Accelerator* accelerator); // Shows the next app-modal dialog box, if there is one to be shown, or moves // an existing showing one to the front. Returns true if one was shown or @@ -360,11 +360,11 @@ class BrowserView : public BrowserBubbleHost, int index); virtual void TabStripEmpty(); - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const; virtual bool IsCommandIdEnabled(int command_id) const; virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); virtual bool IsItemForCommandIdDynamic(int command_id) const; virtual string16 GetLabelForCommandId(int command_id) const; virtual void ExecuteCommand(int command_id); diff --git a/chrome/browser/ui/views/hung_renderer_view.cc b/chrome/browser/ui/views/hung_renderer_view.cc index 95184af..f6f60f5 100644 --- a/chrome/browser/ui/views/hung_renderer_view.cc +++ b/chrome/browser/ui/views/hung_renderer_view.cc @@ -50,14 +50,14 @@ class HungPagesTableModel : public views::GroupTableModel { virtual int RowCount(); virtual string16 GetText(int row, int column_id); virtual SkBitmap GetIcon(int row); - virtual void SetObserver(TableModelObserver* observer); + virtual void SetObserver(ui::TableModelObserver* observer); virtual void GetGroupRangeForItem(int item, views::GroupRange* range); private: typedef std::vector<TabContents*> TabContentsVector; TabContentsVector tab_contentses_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; DISALLOW_COPY_AND_ASSIGN(HungPagesTableModel); }; @@ -106,7 +106,7 @@ SkBitmap HungPagesTableModel::GetIcon(int row) { return tab_contentses_.at(row)->GetFavIcon(); } -void HungPagesTableModel::SetObserver(TableModelObserver* observer) { +void HungPagesTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } diff --git a/chrome/browser/ui/views/importer_view.h b/chrome/browser/ui/views/importer_view.h index 0d06485..c120dbc 100644 --- a/chrome/browser/ui/views/importer_view.h +++ b/chrome/browser/ui/views/importer_view.h @@ -6,9 +6,9 @@ #define CHROME_BROWSER_UI_VIEWS_IMPORTER_VIEW_H_ #pragma once -#include "app/combobox_model.h" #include "base/string16.h" #include "chrome/browser/importer/importer.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/native_button.h" #include "views/controls/combobox/combobox.h" #include "views/view.h" @@ -29,7 +29,7 @@ class Profile; class ImporterView : public views::View, public views::DialogDelegate, public views::ButtonListener, - public ComboboxModel, + public ui::ComboboxModel, public views::Combobox::Listener, public ImporterList::Observer, public ImportObserver { @@ -56,7 +56,7 @@ class ImporterView : public views::View, // views::ButtonListener implementation. virtual void ButtonPressed(views::Button* sender, const views::Event& event); - // ComboboxModel implementation. + // ui::ComboboxModel implementation. virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/keyword_editor_view.cc b/chrome/browser/ui/views/keyword_editor_view.cc index 9e3ec7c..9911e5d 100644 --- a/chrome/browser/ui/views/keyword_editor_view.cc +++ b/chrome/browser/ui/views/keyword_editor_view.cc @@ -153,14 +153,14 @@ views::View* KeywordEditorView::GetContentsView() { } void KeywordEditorView::Init() { - std::vector<TableColumn> columns; + std::vector<ui::TableColumn> columns; columns.push_back( - TableColumn(IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN, - TableColumn::LEFT, -1, .75)); + ui::TableColumn(IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN, + ui::TableColumn::LEFT, -1, .75)); columns.back().sortable = true; columns.push_back( - TableColumn(IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN, - TableColumn::LEFT, -1, .25)); + ui::TableColumn(IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN, + ui::TableColumn::LEFT, -1, .25)); columns.back().sortable = true; table_view_ = new views::TableView(controller_->table_model(), columns, views::ICON_AND_TEXT, false, true, true); diff --git a/chrome/browser/ui/views/options/cookies_view.cc b/chrome/browser/ui/views/options/cookies_view.cc index 64d79f5..465593c 100644 --- a/chrome/browser/ui/views/options/cookies_view.cc +++ b/chrome/browser/ui/views/options/cookies_view.cc @@ -55,7 +55,7 @@ CookiesTreeView::CookiesTreeView(CookiesTreeModel* cookies_model) { } void CookiesTreeView::RemoveSelectedItems() { - TreeModelNode* selected_node = GetSelectedNode(); + ui::TreeModelNode* selected_node = GetSelectedNode(); if (selected_node) { static_cast<CookiesTreeModel*>(model())->DeleteCookieNode( static_cast<CookieTreeNode*>(GetSelectedNode())); @@ -108,8 +108,8 @@ CookiesView::~CookiesView() { /////////////////////////////////////////////////////////////////////////////// // CookiesView, TreeModelObserver overrides: -void CookiesView::TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, +void CookiesView::TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) { UpdateRemoveButtonsState(); diff --git a/chrome/browser/ui/views/options/cookies_view.h b/chrome/browser/ui/views/options/cookies_view.h index fbc8821..0b05fc1 100644 --- a/chrome/browser/ui/views/options/cookies_view.h +++ b/chrome/browser/ui/views/options/cookies_view.h @@ -18,14 +18,6 @@ #include "views/window/dialog_delegate.h" #include "views/window/window.h" -namespace views { - -class Label; -class NativeButton; - -} // namespace views - - class AppCacheInfoView; class CookieInfoView; class CookiesTreeView; @@ -34,9 +26,16 @@ class IndexedDBInfoView; class LocalStorageInfoView; class Profile; class Timer; + +namespace ui { class TreeModel; class TreeModelNode; +} // namespace ui +namespace views { +class Label; +class NativeButton; +} // namespace views class CookiesView : public CookiesTreeModel::Observer, public views::View, @@ -54,15 +53,15 @@ class CookiesView : public CookiesTreeModel::Observer, void UpdateSearchResults(); // Begin TreeModelObserver implementation. - virtual void TreeNodesAdded(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesAdded(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count); - virtual void TreeNodesRemoved(TreeModel* model, - TreeModelNode* parent, + virtual void TreeNodesRemoved(ui::TreeModel* model, + ui::TreeModelNode* parent, int start, int count) {} - virtual void TreeNodeChanged(TreeModel* model, TreeModelNode* node) {} + virtual void TreeNodeChanged(ui::TreeModel* model, ui::TreeModelNode* node) {} // End TreeModelObserver implementation. // views::ButtonListener implementation. diff --git a/chrome/browser/ui/views/options/exceptions_page_view.cc b/chrome/browser/ui/views/options/exceptions_page_view.cc index fd94c06..7d2c71f 100644 --- a/chrome/browser/ui/views/options/exceptions_page_view.cc +++ b/chrome/browser/ui/views/options/exceptions_page_view.cc @@ -182,9 +182,9 @@ void ExceptionsPageView::SetupTable() { // Creates the different columns for the table. // The float resize values are the result of much tinkering. - std::vector<TableColumn> columns; - columns.push_back(TableColumn(IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, - TableColumn::LEFT, -1, 0.55f)); + std::vector<ui::TableColumn> columns; + columns.push_back(ui::TableColumn(IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, + ui::TableColumn::LEFT, -1, 0.55f)); columns.back().sortable = true; table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, true, true, true); diff --git a/chrome/browser/ui/views/options/exceptions_view.cc b/chrome/browser/ui/views/options/exceptions_view.cc index 73f1b7b..219205c 100644 --- a/chrome/browser/ui/views/options/exceptions_view.cc +++ b/chrome/browser/ui/views/options/exceptions_view.cc @@ -164,12 +164,14 @@ void ExceptionsView::Init() { using views::GridLayout; - std::vector<TableColumn> columns; + std::vector<ui::TableColumn> columns; columns.push_back( - TableColumn(IDS_EXCEPTIONS_PATTERN_HEADER, TableColumn::LEFT, -1, .75)); + ui::TableColumn(IDS_EXCEPTIONS_PATTERN_HEADER, ui::TableColumn::LEFT, -1, + .75)); columns.back().sortable = true; columns.push_back( - TableColumn(IDS_EXCEPTIONS_ACTION_HEADER, TableColumn::LEFT, -1, .25)); + ui::TableColumn(IDS_EXCEPTIONS_ACTION_HEADER, ui::TableColumn::LEFT, -1, + .25)); columns.back().sortable = true; table_ = new ContentExceptionsTableView(&model_, columns); views::TableView::SortDescriptors sort; diff --git a/chrome/browser/ui/views/options/fonts_page_view.h b/chrome/browser/ui/views/options/fonts_page_view.h index 83e4b8a..02db748 100644 --- a/chrome/browser/ui/views/options/fonts_page_view.h +++ b/chrome/browser/ui/views/options/fonts_page_view.h @@ -15,6 +15,9 @@ #include "views/controls/button/button.h" #include "views/view.h" +class DefaultEncodingComboboxModel; +class FontDisplayView; + namespace views { class GroupboxView; class Label; @@ -22,10 +25,6 @@ class NativeButton; class TableView; } -class DefaultEncodingComboboxModel; -class FontDisplayView; -class TableModel; - /////////////////////////////////////////////////////////////////////////////// // FontsPageView diff --git a/chrome/browser/ui/views/options/general_page_view.cc b/chrome/browser/ui/views/options/general_page_view.cc index 2f4c56d..d32b19b 100644 --- a/chrome/browser/ui/views/options/general_page_view.cc +++ b/chrome/browser/ui/views/options/general_page_view.cc @@ -7,7 +7,6 @@ #include <string> #include <vector> -#include "app/combobox_model.h" #include "app/l10n_util.h" #include "base/callback.h" #include "base/message_loop.h" @@ -36,6 +35,7 @@ #include "chrome/installer/util/browser_distribution.h" #include "grit/chromium_strings.h" #include "grit/generated_resources.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/button/radio_button.h" #include "views/controls/label.h" #include "views/controls/table/table_view.h" @@ -76,7 +76,7 @@ class OptionsGroupContents : public views::View { /////////////////////////////////////////////////////////////////////////////// // SearchEngineListModel -class SearchEngineListModel : public ComboboxModel, +class SearchEngineListModel : public ui::ComboboxModel, public TemplateURLModelObserver { public: explicit SearchEngineListModel(Profile* profile); @@ -86,7 +86,7 @@ class SearchEngineListModel : public ComboboxModel, // so that when the TemplateURLModel changes the combobox can be updated. void SetCombobox(views::Combobox* combobox); - // ComboboxModel overrides: + // ui::ComboboxModel overrides: virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/options/general_page_view.h b/chrome/browser/ui/views/options/general_page_view.h index 3093d53..43ab638 100644 --- a/chrome/browser/ui/views/options/general_page_view.h +++ b/chrome/browser/ui/views/options/general_page_view.h @@ -17,6 +17,10 @@ #include "views/controls/table/table_view_observer.h" #include "views/view.h" +class CustomHomePagesTableModel; +class OptionsGroupView; +class SearchEngineListModel; + namespace views { class Checkbox; class GroupboxView; @@ -26,10 +30,6 @@ class RadioButton; class TableView; class Textfield; } -class CustomHomePagesTableModel; -class OptionsGroupView; -class SearchEngineListModel; -class TableModel; /////////////////////////////////////////////////////////////////////////////// // GeneralPageView diff --git a/chrome/browser/ui/views/options/languages_page_view.h b/chrome/browser/ui/views/options/languages_page_view.h index 57feff5..1babef7 100644 --- a/chrome/browser/ui/views/options/languages_page_view.h +++ b/chrome/browser/ui/views/options/languages_page_view.h @@ -13,6 +13,10 @@ #include "views/controls/table/table_view_observer.h" #include "views/view.h" +class AddLanguageView; +class LanguageComboboxModel; +class LanguageOrderTableModel; + namespace views { class Checkbox; class Label; @@ -20,11 +24,6 @@ class NativeButton; class TableView; } -class AddLanguageView; -class LanguageComboboxModel; -class LanguageOrderTableModel; -class TableModel; - /////////////////////////////////////////////////////////////////////////////// // LanguagesPageView diff --git a/chrome/browser/ui/views/options/passwords_page_view.cc b/chrome/browser/ui/views/options/passwords_page_view.cc index 8b4ea5b..19cab6d 100644 --- a/chrome/browser/ui/views/options/passwords_page_view.cc +++ b/chrome/browser/ui/views/options/passwords_page_view.cc @@ -99,7 +99,7 @@ int PasswordsTableModel::CompareValues(int row1, int row2, return TableModel::CompareValues(row1, row2, column_id); } -void PasswordsTableModel::SetObserver(TableModelObserver* observer) { +void PasswordsTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } @@ -333,12 +333,12 @@ void PasswordsPageView::SetupTable() { // Creates the different columns for the table. // The float resize values are the result of much tinkering. - std::vector<TableColumn> columns; - columns.push_back(TableColumn(IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, - TableColumn::LEFT, -1, 0.55f)); + std::vector<ui::TableColumn> columns; + columns.push_back(ui::TableColumn(IDS_PASSWORDS_PAGE_VIEW_SITE_COLUMN, + ui::TableColumn::LEFT, -1, 0.55f)); columns.back().sortable = true; - columns.push_back(TableColumn( - IDS_PASSWORDS_PAGE_VIEW_USERNAME_COLUMN, TableColumn::LEFT, + columns.push_back(ui::TableColumn( + IDS_PASSWORDS_PAGE_VIEW_USERNAME_COLUMN, ui::TableColumn::LEFT, -1, 0.37f)); columns.back().sortable = true; table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, diff --git a/chrome/browser/ui/views/options/passwords_page_view.h b/chrome/browser/ui/views/options/passwords_page_view.h index e5f7a26..36f0d3c 100644 --- a/chrome/browser/ui/views/options/passwords_page_view.h +++ b/chrome/browser/ui/views/options/passwords_page_view.h @@ -8,7 +8,6 @@ #include <vector> -#include "app/table_model.h" #include "app/text_elider.h" #include "base/compiler_specific.h" #include "base/scoped_ptr.h" @@ -18,6 +17,7 @@ #include "chrome/browser/prefs/pref_member.h" #include "chrome/browser/ui/views/confirm_message_box_dialog.h" #include "chrome/browser/ui/views/options/options_page_view.h" +#include "ui/base/models/table_model.h" #include "views/controls/button/native_button.h" #include "views/controls/label.h" #include "views/controls/table/table_view.h" @@ -73,7 +73,7 @@ class PasswordsTableModel : public TableModel, virtual int RowCount() OVERRIDE; virtual string16 GetText(int row, int column) OVERRIDE; virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; - virtual void SetObserver(TableModelObserver* observer) OVERRIDE; + virtual void SetObserver(ui::TableModelObserver* observer) OVERRIDE; // Delete the PasswordForm at specified row from the database (and remove // from view). @@ -120,7 +120,7 @@ class PasswordsTableModel : public TableModel, } // The TableView observing this model. - TableModelObserver* observer_; + ui::TableModelObserver* observer_; // Dispatching row count events specific to this password manager table model // to this observer. diff --git a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc index c5002ab..695686f 100644 --- a/chrome/browser/ui/views/options/simple_content_exceptions_view.cc +++ b/chrome/browser/ui/views/options/simple_content_exceptions_view.cc @@ -116,12 +116,14 @@ void SimpleContentExceptionsView::Init() { using views::GridLayout; - std::vector<TableColumn> columns; + std::vector<ui::TableColumn> columns; columns.push_back( - TableColumn(IDS_EXCEPTIONS_HOSTNAME_HEADER, TableColumn::LEFT, -1, .75)); + ui::TableColumn(IDS_EXCEPTIONS_HOSTNAME_HEADER, ui::TableColumn::LEFT, -1, + .75)); columns.back().sortable = true; columns.push_back( - TableColumn(IDS_EXCEPTIONS_ACTION_HEADER, TableColumn::LEFT, -1, .25)); + ui::TableColumn(IDS_EXCEPTIONS_ACTION_HEADER, ui::TableColumn::LEFT, -1, + .25)); columns.back().sortable = true; table_ = new views::TableView(model_.get(), columns, views::TEXT_ONLY, false, true, false); diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.cc b/chrome/browser/ui/views/status_icons/status_icon_win.cc index d4572e4..c9b4f8c 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_win.cc +++ b/chrome/browser/ui/views/status_icons/status_icon_win.cc @@ -61,7 +61,7 @@ void StatusIconWin::InitIconData(NOTIFYICONDATA* icon_data) { icon_data->uID = icon_id_; } -void StatusIconWin::UpdatePlatformContextMenu(menus::MenuModel* menu) { +void StatusIconWin::UpdatePlatformContextMenu(ui::MenuModel* menu) { // If no items are passed, blow away our context menu. if (!menu) { context_menu_.reset(); diff --git a/chrome/browser/ui/views/status_icons/status_icon_win.h b/chrome/browser/ui/views/status_icons/status_icon_win.h index 6bbda23..e353023 100644 --- a/chrome/browser/ui/views/status_icons/status_icon_win.h +++ b/chrome/browser/ui/views/status_icons/status_icon_win.h @@ -39,7 +39,7 @@ class StatusIconWin : public StatusIcon { protected: // Overridden from StatusIcon. - virtual void UpdatePlatformContextMenu(menus::MenuModel* menu); + virtual void UpdatePlatformContextMenu(ui::MenuModel* menu); private: void InitIconData(NOTIFYICONDATA* icon_data); diff --git a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc index 5f61c45..4c44a8f 100644 --- a/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc +++ b/chrome/browser/ui/views/status_icons/status_tray_win_unittest.cc @@ -2,7 +2,6 @@ // Use of this source code is governed by a BSD-style license that can be // found in the LICENSE file. -#include "app/menus/simple_menu_model.h" #include "app/resource_bundle.h" #include "base/string_util.h" #include "base/utf_string_conversions.h" @@ -12,6 +11,7 @@ #include "grit/theme_resources.h" #include "testing/gmock/include/gmock/gmock.h" #include "testing/gtest/include/gtest/gtest.h" +#include "ui/base/models/simple_menu_model.h" class SkBitmap; @@ -35,7 +35,7 @@ TEST(StatusTrayWinTest, CreateIconAndMenu) { icon->SetImage(*bitmap); icon->SetPressedImage(*bitmap); icon->SetToolTip(ASCIIToUTF16("tool tip")); - menus::SimpleMenuModel* menu = new menus::SimpleMenuModel(NULL); + ui::SimpleMenuModel* menu = new ui::SimpleMenuModel(NULL); menu->AddItem(0, L"foo"); icon->SetContextMenu(menu); } diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc index 42a05e9..bedf718 100644 --- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc +++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.cc @@ -62,7 +62,7 @@ void RenderViewContextMenuViews::PlatformInit() { bool RenderViewContextMenuViews::GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accel) { + ui::Accelerator* accel) { // There are no formally defined accelerators we can query so we assume // that Ctrl+C, Ctrl+V, Ctrl+X, Ctrl-A, etc do what they normally do. switch (command_id) { diff --git a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h index 266e762..af13bd0 100644 --- a/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h +++ b/chrome/browser/ui/views/tab_contents/render_view_context_menu_views.h @@ -36,7 +36,7 @@ class RenderViewContextMenuViews : public RenderViewContextMenu { // RenderViewContextMenu implementation -------------------------------------- virtual void PlatformInit(); virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); private: // The context menu itself and its contents. scoped_ptr<views::Menu2> menu_; diff --git a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc index 5389ec8..07ab52b 100644 --- a/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc +++ b/chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc @@ -31,7 +31,7 @@ static TabRendererData::NetworkState TabContentsNetworkState( } class BrowserTabStripController::TabContextMenuContents - : public menus::SimpleMenuModel::Delegate { + : public ui::SimpleMenuModel::Delegate { public: TabContextMenuContents(BaseTab* tab, BrowserTabStripController* controller) @@ -57,7 +57,7 @@ class BrowserTabStripController::TabContextMenuContents // We could be gone now. Assume |this| is junk! } - // Overridden from menus::SimpleMenuModel::Delegate: + // Overridden from ui::SimpleMenuModel::Delegate: virtual bool IsCommandIdChecked(int command_id) const { return controller_->IsCommandCheckedForTab( static_cast<TabStripModel::ContextMenuCommand>(command_id), @@ -70,7 +70,7 @@ class BrowserTabStripController::TabContextMenuContents } virtual bool GetAcceleratorForCommandId( int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { int browser_cmd; return TabStripModel::ContextMenuCommandToBrowserCommand(command_id, &browser_cmd) ? diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index e12dd20..568301e 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -5,7 +5,6 @@ #include "chrome/browser/task_manager/task_manager.h" #include "app/l10n_util.h" -#include "app/table_model_observer.h" #include "base/command_line.h" #include "base/compiler_specific.h" #include "base/metrics/stats_table.h" @@ -22,6 +21,7 @@ #include "grit/chromium_strings.h" #include "grit/generated_resources.h" #include "grit/theme_resources.h" +#include "ui/base/models/table_model_observer.h" #include "views/accelerator.h" #include "views/background.h" #include "views/controls/button/native_button.h" @@ -62,7 +62,7 @@ class TaskManagerTableModel : public views::GroupTableModel, string16 GetText(int row, int column) OVERRIDE; SkBitmap GetIcon(int row) OVERRIDE; void GetGroupRangeForItem(int item, views::GroupRange* range) OVERRIDE; - void SetObserver(TableModelObserver* observer) OVERRIDE; + void SetObserver(ui::TableModelObserver* observer) OVERRIDE; virtual int CompareValues(int row1, int row2, int column_id) OVERRIDE; // TaskManagerModelObserver. @@ -73,7 +73,7 @@ class TaskManagerTableModel : public views::GroupTableModel, private: TaskManagerModel* model_; - TableModelObserver* observer_; + ui::TableModelObserver* observer_; }; int TaskManagerTableModel::RowCount() { @@ -159,7 +159,7 @@ void TaskManagerTableModel::GetGroupRangeForItem(int item, range->length = range_pair.second; } -void TaskManagerTableModel::SetObserver(TableModelObserver* observer) { +void TaskManagerTableModel::SetObserver(ui::TableModelObserver* observer) { observer_ = observer; } @@ -275,7 +275,7 @@ class TaskManagerView : public views::View, TaskManagerModel* model_; // all possible columns, not necessarily visible - std::vector<TableColumn> columns_; + std::vector<ui::TableColumn> columns_; scoped_ptr<TaskManagerTableModel> table_model_; @@ -313,42 +313,44 @@ void TaskManagerView::Init() { table_model_.reset(new TaskManagerTableModel(model_)); // Page column has no header label. - columns_.push_back(TableColumn(IDS_TASK_MANAGER_PAGE_COLUMN, - TableColumn::LEFT, -1, 1)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_PAGE_COLUMN, + ui::TableColumn::LEFT, -1, 1)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_SHARED_MEM_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_SHARED_MEM_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_CPU_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_CPU_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_NET_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_NET_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn( + IDS_TASK_MANAGER_WEBCORE_IMAGE_CACHE_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn( + IDS_TASK_MANAGER_WEBCORE_SCRIPTS_CACHE_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_WEBCORE_CSS_CACHE_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back(TableColumn(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN, - TableColumn::RIGHT, -1, 0)); + columns_.push_back(ui::TableColumn(IDS_TASK_MANAGER_SQLITE_MEMORY_USED_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; columns_.push_back( - TableColumn(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN, - TableColumn::RIGHT, -1, 0)); + ui::TableColumn(IDS_TASK_MANAGER_JAVASCRIPT_MEMORY_ALLOCATED_COLUMN, + ui::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; tab_table_ = new views::GroupTableView(table_model_.get(), columns_, @@ -408,7 +410,8 @@ void TaskManagerView::UpdateStatsCounters() { // stat names not in the string table would be filtered out. // TODO(erikkay): Width is hard-coded right now, so many column // names are clipped. - TableColumn col(i, ASCIIToUTF16(row), TableColumn::RIGHT, 90, 0); + ui::TableColumn col(i, ASCIIToUTF16(row), ui::TableColumn::RIGHT, 90, + 0); col.sortable = true; columns_.push_back(col); tab_table_->AddColumn(col); @@ -617,7 +620,7 @@ void TaskManagerView::ShowContextMenu(views::View* source, UpdateStatsCounters(); scoped_ptr<views::Menu> menu(views::Menu::Create( this, views::Menu::TOPLEFT, source->GetWidget()->GetNativeView())); - for (std::vector<TableColumn>::iterator i = + for (std::vector<ui::TableColumn>::iterator i = columns_.begin(); i != columns_.end(); ++i) { menu->AppendMenuItem(i->id, l10n_util::GetStringUTF16(i->id), views::Menu::CHECKBOX); diff --git a/chrome/browser/ui/views/toolbar_view.cc b/chrome/browser/ui/views/toolbar_view.cc index 38ab6e5..4545630 100644 --- a/chrome/browser/ui/views/toolbar_view.cc +++ b/chrome/browser/ui/views/toolbar_view.cc @@ -323,7 +323,7 @@ AccessibilityTypes::Role ToolbarView::GetAccessibleRole() { //////////////////////////////////////////////////////////////////////////////// // ToolbarView, Menu::BaseControllerDelegate overrides: -bool ToolbarView::GetAcceleratorInfo(int id, menus::Accelerator* accel) { +bool ToolbarView::GetAcceleratorInfo(int id, ui::Accelerator* accel) { return GetWidget()->GetAccelerator(id, accel); } @@ -451,10 +451,10 @@ void ToolbarView::Observe(NotificationType type, } //////////////////////////////////////////////////////////////////////////////// -// ToolbarView, menus::AcceleratorProvider implementation: +// ToolbarView, ui::AcceleratorProvider implementation: bool ToolbarView::GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator) { + ui::Accelerator* accelerator) { // The standard Ctrl-X, Ctrl-V and Ctrl-C are not defined as accelerators // anywhere so we need to check for them explicitly here. // TODO(cpu) Bug 1109102. Query WebKit land for the actual bindings. diff --git a/chrome/browser/ui/views/toolbar_view.h b/chrome/browser/ui/views/toolbar_view.h index 8c07dc2..4d2f1c6 100644 --- a/chrome/browser/ui/views/toolbar_view.h +++ b/chrome/browser/ui/views/toolbar_view.h @@ -8,7 +8,6 @@ #include <vector> -#include "app/menus/accelerator.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" #include "chrome/browser/command_updater.h" @@ -18,6 +17,7 @@ #include "chrome/browser/ui/views/location_bar/location_bar_view.h" #include "chrome/browser/ui/views/reload_button.h" #include "ui/base/animation/slide_animation.h" +#include "ui/base/models/accelerator.h" #include "views/controls/button/menu_button.h" #include "views/controls/menu/menu.h" #include "views/controls/menu/menu_wrapper.h" @@ -37,7 +37,7 @@ class WrenchMenu; // The Browser Window's toolbar. class ToolbarView : public AccessiblePaneView, public views::ViewMenuDelegate, - public menus::AcceleratorProvider, + public ui::AcceleratorProvider, public LocationBarView::Delegate, public NotificationObserver, public CommandUpdater::CommandObserver, @@ -90,7 +90,7 @@ class ToolbarView : public AccessiblePaneView, virtual AccessibilityTypes::Role GetAccessibleRole(); // Overridden from Menu::BaseControllerDelegate: - virtual bool GetAcceleratorInfo(int id, menus::Accelerator* accel); + virtual bool GetAcceleratorInfo(int id, ui::Accelerator* accel); // Overridden from views::MenuDelegate: virtual void RunMenu(views::View* source, const gfx::Point& pt); @@ -111,9 +111,9 @@ class ToolbarView : public AccessiblePaneView, const NotificationSource& source, const NotificationDetails& details); - // Overridden from menus::AcceleratorProvider: + // Overridden from ui::AcceleratorProvider: virtual bool GetAcceleratorForCommandId(int command_id, - menus::Accelerator* accelerator); + ui::Accelerator* accelerator); // Overridden from views::View: virtual gfx::Size GetPreferredSize(); @@ -192,7 +192,7 @@ class ToolbarView : public AccessiblePaneView, Browser* browser_; // Contents of the profiles menu to populate with profile names. - scoped_ptr<menus::SimpleMenuModel> profiles_menu_contents_; + scoped_ptr<ui::SimpleMenuModel> profiles_menu_contents_; // Controls whether or not a home button should be shown on the toolbar. BooleanPrefMember show_home_button_; @@ -201,7 +201,7 @@ class ToolbarView : public AccessiblePaneView, DisplayMode display_mode_; // The contents of the wrench menu. - scoped_ptr<menus::SimpleMenuModel> wrench_menu_model_; + scoped_ptr<ui::SimpleMenuModel> wrench_menu_model_; #if defined(OS_CHROMEOS) // Wrench menu using domui menu. diff --git a/chrome/browser/ui/views/uninstall_view.h b/chrome/browser/ui/views/uninstall_view.h index 23aad8c..3f29582 100644 --- a/chrome/browser/ui/views/uninstall_view.h +++ b/chrome/browser/ui/views/uninstall_view.h @@ -6,8 +6,8 @@ #define CHROME_BROWSER_UI_VIEWS_UNINSTALL_VIEW_H_ #pragma once -#include "app/combobox_model.h" #include "base/string16.h" +#include "ui/base/models/combobox_model.h" #include "views/controls/combobox/combobox.h" #include "views/window/dialog_delegate.h" @@ -22,7 +22,7 @@ class Label; class UninstallView : public views::View, public views::ButtonListener, public views::DialogDelegate, - public ComboboxModel { + public ui::ComboboxModel { public: explicit UninstallView(int& user_selection); virtual ~UninstallView(); @@ -40,7 +40,7 @@ class UninstallView : public views::View, virtual std::wstring GetWindowTitle() const; virtual views::View* GetContentsView(); - // Overridden from views::Combobox::Model. + // Overridden from ui::ComboboxModel. virtual int GetItemCount(); virtual string16 GetItemAt(int index); diff --git a/chrome/browser/ui/views/url_picker.cc b/chrome/browser/ui/views/url_picker.cc index b7bfd0e..fe6354d 100644 --- a/chrome/browser/ui/views/url_picker.cc +++ b/chrome/browser/ui/views/url_picker.cc @@ -6,7 +6,6 @@ #include "app/l10n_util.h" #include "app/resource_bundle.h" -#include "app/table_model.h" #include "base/stl_util-inl.h" #include "base/string16.h" #include "base/utf_string_conversions.h" @@ -20,6 +19,7 @@ #include "grit/locale_settings.h" #include "net/base/net_util.h" #include "ui/base/keycodes/keyboard_codes.h" +#include "ui/base/models/table_model.h" #include "views/background.h" #include "views/controls/label.h" #include "views/controls/table/table_view.h" @@ -52,13 +52,11 @@ UrlPicker::UrlPicker(UrlPickerDelegate* delegate, url_table_model_.reset(new PossibleURLModel()); - TableColumn col1(IDS_ASI_PAGE_COLUMN, TableColumn::LEFT, -1, - 50); + ui::TableColumn col1(IDS_ASI_PAGE_COLUMN, ui::TableColumn::LEFT, -1, 50); col1.sortable = true; - TableColumn col2(IDS_ASI_URL_COLUMN, TableColumn::LEFT, -1, - 50); + ui::TableColumn col2(IDS_ASI_URL_COLUMN, TableColumn::LEFT, -1, 50); col2.sortable = true; - std::vector<TableColumn> cols; + std::vector<ui::TableColumn> cols; cols.push_back(col1); cols.push_back(col2); diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc index 9eb85c4..37b34d5 100644 --- a/chrome/browser/ui/views/wrench_menu.cc +++ b/chrome/browser/ui/views/wrench_menu.cc @@ -37,7 +37,7 @@ #include "views/controls/menu/submenu_view.h" #include "views/window/window.h" -using menus::MenuModel; +using ui::MenuModel; using views::CustomButton; using views::ImageButton; using views::Label; @@ -250,7 +250,7 @@ string16 GetAccessibleNameForWrenchMenuItem( string16 accessible_name = l10n_util::GetStringUTF16(accessible_string_id); string16 accelerator_text; - menus::Accelerator menu_accelerator; + ui::Accelerator menu_accelerator; if (model->GetAcceleratorAt(item_index, &menu_accelerator)) { accelerator_text = views::Accelerator(menu_accelerator.GetKeyCode(), @@ -569,7 +569,7 @@ WrenchMenu::WrenchMenu(Browser* browser) selected_index_(0) { } -void WrenchMenu::Init(menus::MenuModel* model) { +void WrenchMenu::Init(ui::MenuModel* model) { DCHECK(!root_.get()); root_.reset(new MenuItemView(this)); root_->SetAccessibleName( @@ -637,7 +637,7 @@ bool WrenchMenu::GetAccelerator(int id, views::Accelerator* accelerator) { return false; } - menus::Accelerator menu_accelerator; + ui::Accelerator menu_accelerator; if (!entry.first->GetAcceleratorAt(entry.second, &menu_accelerator)) return false; diff --git a/chrome/browser/ui/views/wrench_menu.h b/chrome/browser/ui/views/wrench_menu.h index 6efaaa8..f77e67d 100644 --- a/chrome/browser/ui/views/wrench_menu.h +++ b/chrome/browser/ui/views/wrench_menu.h @@ -9,9 +9,9 @@ #include <map> #include <utility> -#include "app/menus/menu_model.h" #include "base/ref_counted.h" #include "base/scoped_ptr.h" +#include "ui/base/models/menu_model.h" #include "views/controls/menu/menu_delegate.h" class Browser; @@ -28,7 +28,7 @@ class WrenchMenu : public base::RefCounted<WrenchMenu>, public: explicit WrenchMenu(Browser* browser); - void Init(menus::MenuModel* model); + void Init(ui::MenuModel* model); // Shows the menu relative to the specified view. void RunMenu(views::MenuButton* host); @@ -45,7 +45,7 @@ class WrenchMenu : public base::RefCounted<WrenchMenu>, class CutCopyPasteView; class ZoomView; - typedef std::pair<menus::MenuModel*,int> Entry; + typedef std::pair<ui::MenuModel*,int> Entry; typedef std::map<int,Entry> IDToEntry; ~WrenchMenu(); @@ -54,20 +54,20 @@ class WrenchMenu : public base::RefCounted<WrenchMenu>, // |PopulateMenu| for any submenu. |next_id| is incremented for every menu // that is created. void PopulateMenu(views::MenuItemView* parent, - menus::MenuModel* model, + ui::MenuModel* model, int* next_id); // Adds a new menu to |parent| to represent the MenuModel/index pair passed // in. views::MenuItemView* AppendMenuItem(views::MenuItemView* parent, - menus::MenuModel* model, + ui::MenuModel* model, int index, - menus::MenuModel::ItemType menu_type, + ui::MenuModel::ItemType menu_type, int* next_id); // Invoked from the cut/copy/paste menus. Cancels the current active menu and // activates the menu item in |model| at |index|. - void CancelAndEvaluate(menus::MenuModel* model, int index); + void CancelAndEvaluate(ui::MenuModel* model, int index); // The views menu. scoped_ptr<views::MenuItemView> root_; @@ -83,7 +83,7 @@ class WrenchMenu : public base::RefCounted<WrenchMenu>, // If |selected_menu_model_| is non-null after the menu completes // ActivatedAt is invoked. This is done so that ActivatedAt isn't invoked // while the message loop is nested. - menus::MenuModel* selected_menu_model_; + ui::MenuModel* selected_menu_model_; int selected_index_; DISALLOW_COPY_AND_ASSIGN(WrenchMenu); |