diff options
author | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
---|---|---|
committer | ben@chromium.org <ben@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2008-10-16 23:51:38 +0000 |
commit | c2dacc9ec41232903ba700c6aef5ef98bfcb8af8 (patch) | |
tree | 4aa4d7100862c64bdd92d70e6323001beb19edb7 /chrome/browser | |
parent | d66e710ec668e34271def44d7f0416260657171c (diff) | |
download | chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.zip chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.gz chromium_src-c2dacc9ec41232903ba700c6aef5ef98bfcb8af8.tar.bz2 |
Rename ChromeViews namespace to views
http://crbug.com/2188
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@3495 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
234 files changed, 2881 insertions, 3006 deletions
diff --git a/chrome/browser/app_modal_dialog_queue.cc b/chrome/browser/app_modal_dialog_queue.cc index 4a3ce46..b0736bc 100644 --- a/chrome/browser/app_modal_dialog_queue.cc +++ b/chrome/browser/app_modal_dialog_queue.cc @@ -7,16 +7,14 @@ #include "chrome/browser/browser_list.h" // static -std::queue<ChromeViews::AppModalDialogDelegate*>* +std::queue<views::AppModalDialogDelegate*>* AppModalDialogQueue::app_modal_dialog_queue_ = NULL; // static -void AppModalDialogQueue::AddDialog( - ChromeViews::AppModalDialogDelegate* dialog) { +void AppModalDialogQueue::AddDialog(views::AppModalDialogDelegate* dialog) { DCHECK(dialog->IsModal()); if (!app_modal_dialog_queue_) { - app_modal_dialog_queue_ = - new std::queue<ChromeViews::AppModalDialogDelegate*>; + app_modal_dialog_queue_ = new std::queue<views::AppModalDialogDelegate*>; ShowModalDialog(dialog); } @@ -43,7 +41,7 @@ void AppModalDialogQueue::ActivateModalDialog() { // static void AppModalDialogQueue::ShowModalDialog( - ChromeViews::AppModalDialogDelegate* dialog) { + views::AppModalDialogDelegate* dialog) { dialog->ShowModalDialog(); BrowserList::SetIsShowingAppModalDialog(true); } diff --git a/chrome/browser/app_modal_dialog_queue.h b/chrome/browser/app_modal_dialog_queue.h index 7307645..d1748a1 100644 --- a/chrome/browser/app_modal_dialog_queue.h +++ b/chrome/browser/app_modal_dialog_queue.h @@ -23,7 +23,7 @@ class AppModalDialogQueue { // sloppy app modality. // Note: The AppModalDialogDelegate |dialog| must be window modal before it // can be added as app modal. - static void AddDialog(ChromeViews::AppModalDialogDelegate* dialog); + static void AddDialog(views::AppModalDialogDelegate* dialog); // Removes the current dialog in the queue (the one that is being shown). // Shows the next dialog in the queue, if any is present. This does not @@ -41,11 +41,11 @@ class AppModalDialogQueue { private: // Shows |dialog| and notifies the BrowserList that a modal dialog is showing. - static void ShowModalDialog(ChromeViews::AppModalDialogDelegate* dialog); + static void ShowModalDialog(views::AppModalDialogDelegate* dialog); // Contains all app modal dialogs which are waiting to be shown, with the // currently modal dialog at the front of the queue. - static std::queue<ChromeViews::AppModalDialogDelegate*>* + static std::queue<views::AppModalDialogDelegate*>* app_modal_dialog_queue_; }; diff --git a/chrome/browser/autocomplete/autocomplete_edit.cc b/chrome/browser/autocomplete/autocomplete_edit.cc index e262e1a..09b2991 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.cc +++ b/chrome/browser/autocomplete/autocomplete_edit.cc @@ -641,7 +641,7 @@ AutocompleteEditView::AutocompleteEditView( const ChromeFont& font, AutocompleteEditController* controller, ToolbarModel* toolbar_model, - ChromeViews::View* parent_view, + views::View* parent_view, HWND hwnd, Profile* profile, CommandController* command_controller, @@ -1113,7 +1113,7 @@ void AutocompleteEditView::PasteAndGo(const std::wstring& text) { } bool AutocompleteEditView::OverrideAccelerator( - const ChromeViews::Accelerator& accelerator) { + const views::Accelerator& accelerator) { // Only override <esc>. if ((accelerator.GetKeyCode() != VK_ESCAPE) || accelerator.IsAltDown()) return false; diff --git a/chrome/browser/autocomplete/autocomplete_edit.h b/chrome/browser/autocomplete/autocomplete_edit.h index 35b75b7..15e3688 100644 --- a/chrome/browser/autocomplete/autocomplete_edit.h +++ b/chrome/browser/autocomplete/autocomplete_edit.h @@ -24,7 +24,7 @@ class AutocompletePopupModel; class CommandController; class Profile; class TabContents; -namespace ChromeViews { +namespace views { class View; } @@ -467,7 +467,7 @@ class AutocompleteEditView AutocompleteEditView(const ChromeFont& font, AutocompleteEditController* controller, ToolbarModel* toolbar_model, - ChromeViews::View* parent_view, + views::View* parent_view, HWND hwnd, Profile* profile, CommandController* command_controller, @@ -477,7 +477,7 @@ class AutocompleteEditView AutocompleteEditModel* model() { return model_.get(); } const AutocompleteEditModel* model() const { return model_.get(); } - ChromeViews::View* parent_view() const { return parent_view_; } + views::View* parent_view() const { return parent_view_; } // For use when switching tabs, this saves the current state onto the tab so // that it can be restored during a later call to Update(). @@ -584,7 +584,7 @@ class AutocompleteEditView // Called before an accelerator is processed to give us a chance to override // it. - bool OverrideAccelerator(const ChromeViews::Accelerator& accelerator); + bool OverrideAccelerator(const views::Accelerator& accelerator); // Handler for external events passed in to us. The View that owns us may // send us events that we should treat as if they were events on us. @@ -804,7 +804,7 @@ class AutocompleteEditView // The parent view for the edit, used to align the popup and for // accessibility. - ChromeViews::View* parent_view_; + views::View* parent_view_; ToolbarModel* toolbar_model_; diff --git a/chrome/browser/autocomplete/autocomplete_popup.cc b/chrome/browser/autocomplete/autocomplete_popup.cc index c30bbb5..7f17572 100644 --- a/chrome/browser/autocomplete/autocomplete_popup.cc +++ b/chrome/browser/autocomplete/autocomplete_popup.cc @@ -173,7 +173,7 @@ void AutocompletePopupView::UpdatePopupAppearance() { // Subtract the top left corner to make the coordinates relative to the // location bar view itself, and convert to screen coordinates. gfx::Point top_left(-rc.TopLeft()); - ChromeViews::View::ConvertPointToScreen(edit_view_->parent_view(), &top_left); + views::View::ConvertPointToScreen(edit_view_->parent_view(), &top_left); rc.OffsetRect(top_left.ToPOINT()); // Expand by one pixel on each side since that's the amount the location bar // view is inset from the divider line that edges the adjacent buttons. diff --git a/chrome/browser/automation/automation_provider.cc b/chrome/browser/automation/automation_provider.cc index 716e3e1..85443a9 100644 --- a/chrome/browser/automation/automation_provider.cc +++ b/chrome/browser/automation/automation_provider.cc @@ -1141,17 +1141,16 @@ void AutomationProvider::WindowGetViewBounds(const IPC::Message& message, void* iter = NULL; if (window_tracker_->ContainsHandle(handle)) { HWND hwnd = window_tracker_->GetResource(handle); - ChromeViews::RootView* root_view = - ChromeViews::ContainerWin::FindRootView(hwnd); + views::RootView* root_view = views::ContainerWin::FindRootView(hwnd); if (root_view) { - ChromeViews::View* view = root_view->GetViewByID(view_id); + views::View* view = root_view->GetViewByID(view_id); if (view) { succeeded = true; gfx::Point point; if (screen_coordinates) - ChromeViews::View::ConvertPointToScreen(view, &point); + views::View::ConvertPointToScreen(view, &point); else - ChromeViews::View::ConvertPointToView(view, root_view, &point); + views::View::ConvertPointToView(view, root_view, &point); bounds = view->GetLocalBounds(false); bounds.set_origin(point); } @@ -1166,15 +1165,15 @@ void AutomationProvider::WindowGetViewBounds(const IPC::Message& message, // that it's being sent to can do the requisite post-processing. class MouseEventTask : public Task { public: - MouseEventTask(ChromeViews::View* view, - ChromeViews::Event::EventType type, + MouseEventTask(views::View* view, + views::Event::EventType type, POINT point, int flags) : view_(view), type_(type), point_(point), flags_(flags) {} virtual ~MouseEventTask() {} virtual void Run() { - ChromeViews::MouseEvent event(type_, point_.x, point_.y, flags_); + views::MouseEvent event(type_, point_.x, point_.y, flags_); // We need to set the cursor position before we process the event because // some code (tab dragging, for instance) queries the actual cursor location // rather than the location of the mouse event. Note that the reason why @@ -1185,15 +1184,15 @@ class MouseEventTask : public Task { view_->ConvertPointToScreen(view_, &screen_location); ::SetCursorPos(screen_location.x(), screen_location.y()); switch (type_) { - case ChromeViews::Event::ET_MOUSE_PRESSED: + case views::Event::ET_MOUSE_PRESSED: view_->OnMousePressed(event); break; - case ChromeViews::Event::ET_MOUSE_DRAGGED: + case views::Event::ET_MOUSE_DRAGGED: view_->OnMouseDragged(event); break; - case ChromeViews::Event::ET_MOUSE_RELEASED: + case views::Event::ET_MOUSE_RELEASED: view_->OnMouseReleased(event, false); break; @@ -1203,16 +1202,16 @@ class MouseEventTask : public Task { } private: - ChromeViews::View* view_; - ChromeViews::Event::EventType type_; + views::View* view_; + views::Event::EventType type_; POINT point_; int flags_; DISALLOW_COPY_AND_ASSIGN(MouseEventTask); }; -void AutomationProvider::ScheduleMouseEvent(ChromeViews::View* view, - ChromeViews::Event::EventType type, +void AutomationProvider::ScheduleMouseEvent(views::View* view, + views::Event::EventType type, POINT point, int flags) { MessageLoop::current()->PostTask(FROM_HERE, @@ -1270,14 +1269,14 @@ void AutomationProvider::WindowSimulateClick(const IPC::Message& message, ui_controls::SendMouseMove(click.x, click.y); ui_controls::MouseButton button = ui_controls::LEFT; - if ((flags & ChromeViews::Event::EF_LEFT_BUTTON_DOWN) == - ChromeViews::Event::EF_LEFT_BUTTON_DOWN) { + if ((flags & views::Event::EF_LEFT_BUTTON_DOWN) == + views::Event::EF_LEFT_BUTTON_DOWN) { button = ui_controls::LEFT; - } else if ((flags & ChromeViews::Event::EF_RIGHT_BUTTON_DOWN) == - ChromeViews::Event::EF_RIGHT_BUTTON_DOWN) { + } else if ((flags & views::Event::EF_RIGHT_BUTTON_DOWN) == + views::Event::EF_RIGHT_BUTTON_DOWN) { button = ui_controls::RIGHT; - } else if ((flags & ChromeViews::Event::EF_MIDDLE_BUTTON_DOWN) == - ChromeViews::Event::EF_MIDDLE_BUTTON_DOWN) { + } else if ((flags & views::Event::EF_MIDDLE_BUTTON_DOWN) == + views::Event::EF_MIDDLE_BUTTON_DOWN) { button = ui_controls::MIDDLE; } else { NOTREACHED(); @@ -1298,21 +1297,21 @@ void AutomationProvider::WindowSimulateDrag(const IPC::Message& message, UINT down_message = 0; UINT up_message = 0; WPARAM wparam_flags = 0; - if (flags & ChromeViews::Event::EF_SHIFT_DOWN) + if (flags & views::Event::EF_SHIFT_DOWN) wparam_flags |= MK_SHIFT; - if (flags & ChromeViews::Event::EF_CONTROL_DOWN) + if (flags & views::Event::EF_CONTROL_DOWN) wparam_flags |= MK_CONTROL; - if (flags & ChromeViews::Event::EF_LEFT_BUTTON_DOWN) { + if (flags & views::Event::EF_LEFT_BUTTON_DOWN) { wparam_flags |= MK_LBUTTON; down_message = WM_LBUTTONDOWN; up_message = WM_LBUTTONUP; } - if (flags & ChromeViews::Event::EF_MIDDLE_BUTTON_DOWN) { + if (flags & views::Event::EF_MIDDLE_BUTTON_DOWN) { wparam_flags |= MK_MBUTTON; down_message = WM_MBUTTONDOWN; up_message = WM_MBUTTONUP; } - if (flags & ChromeViews::Event::EF_RIGHT_BUTTON_DOWN) { + if (flags & views::Event::EF_RIGHT_BUTTON_DOWN) { wparam_flags |= MK_RBUTTON; down_message = WM_LBUTTONDOWN; up_message = WM_LBUTTONUP; @@ -1335,12 +1334,12 @@ void AutomationProvider::WindowSimulateDrag(const IPC::Message& message, if (press_escape_en_route) { // Press Escape. ui_controls::SendKeyPress(VK_ESCAPE, - ((flags & ChromeViews::Event::EF_CONTROL_DOWN) - == ChromeViews::Event::EF_CONTROL_DOWN), - ((flags & ChromeViews::Event::EF_SHIFT_DOWN) == - ChromeViews::Event::EF_SHIFT_DOWN), - ((flags & ChromeViews::Event::EF_ALT_DOWN) == - ChromeViews::Event::EF_ALT_DOWN)); + ((flags & views::Event::EF_CONTROL_DOWN) + == views::Event::EF_CONTROL_DOWN), + ((flags & views::Event::EF_SHIFT_DOWN) == + views::Event::EF_SHIFT_DOWN), + ((flags & views::Event::EF_ALT_DOWN) == + views::Event::EF_ALT_DOWN)); } SendMessage(top_level_hwnd, up_message, wparam_flags, MAKELPARAM(end.x, end.y)); @@ -1362,12 +1361,12 @@ void AutomationProvider::WindowSimulateKeyPress(const IPC::Message& message, // The key event is sent to whatever window is active. ui_controls::SendKeyPress(key, - ((flags & ChromeViews::Event::EF_CONTROL_DOWN) == - ChromeViews::Event::EF_CONTROL_DOWN), - ((flags & ChromeViews::Event::EF_SHIFT_DOWN) == - ChromeViews::Event::EF_SHIFT_DOWN), - ((flags & ChromeViews::Event::EF_ALT_DOWN) == - ChromeViews::Event::EF_ALT_DOWN)); + ((flags & views::Event::EF_CONTROL_DOWN) == + views::Event::EF_CONTROL_DOWN), + ((flags & views::Event::EF_SHIFT_DOWN) == + views::Event::EF_SHIFT_DOWN), + ((flags & views::Event::EF_ALT_DOWN) == + views::Event::EF_ALT_DOWN)); } void AutomationProvider::GetFocusedViewID(const IPC::Message& message, @@ -1375,10 +1374,10 @@ void AutomationProvider::GetFocusedViewID(const IPC::Message& message, int view_id = -1; if (window_tracker_->ContainsHandle(handle)) { HWND hwnd = window_tracker_->GetResource(handle); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(hwnd); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(hwnd); DCHECK(focus_manager); - ChromeViews::View* focused_view = focus_manager->GetFocusedView(); + views::View* focused_view = focus_manager->GetFocusedView(); if (focused_view) view_id = focused_view->GetID(); } diff --git a/chrome/browser/automation/automation_provider.h b/chrome/browser/automation/automation_provider.h index d67615f..ebb63d2 100644 --- a/chrome/browser/automation/automation_provider.h +++ b/chrome/browser/automation/automation_provider.h @@ -161,8 +161,8 @@ class AutomationProvider : public base::RefCounted<AutomationProvider>, void GetShelfVisibility(const IPC::Message& message, int handle); void SetFilteredInet(const IPC::Message& message, bool enabled); - void ScheduleMouseEvent(ChromeViews::View* view, - ChromeViews::Event::EventType type, + void ScheduleMouseEvent(views::View* view, + views::Event::EventType type, POINT point, int flags); void GetFocusedViewID(const IPC::Message& message, int handle); diff --git a/chrome/browser/automation/ui_controls.cc b/chrome/browser/automation/ui_controls.cc index f87490e..c557ff7 100644 --- a/chrome/browser/automation/ui_controls.cc +++ b/chrome/browser/automation/ui_controls.cc @@ -332,12 +332,12 @@ bool SendMouseClick(MouseButton type) { return SendMouseEventsImpl(type, UP | DOWN, NULL); } -void MoveMouseToCenterAndPress( - ChromeViews::View* view, MouseButton button, int state, Task* task) { +void MoveMouseToCenterAndPress(views::View* view, MouseButton button, + int state, Task* task) { DCHECK(view); DCHECK(view->GetContainer()); gfx::Point view_center(view->width() / 2, view->height() / 2); - ChromeViews::View::ConvertPointToScreen(view, &view_center); + views::View::ConvertPointToScreen(view, &view_center); SendMouseMove(view_center.x(), view_center.y()); SendMouseEventsNotifyWhenDone(button, state, task); } diff --git a/chrome/browser/automation/ui_controls.h b/chrome/browser/automation/ui_controls.h index fc05a46..a39d1cc 100644 --- a/chrome/browser/automation/ui_controls.h +++ b/chrome/browser/automation/ui_controls.h @@ -8,7 +8,7 @@ #include <string> #include <wtypes.h> -namespace ChromeViews { +namespace views { class View; } @@ -57,8 +57,10 @@ bool SendMouseClick(MouseButton type); // A combination of SendMouseMove to the middle of the view followed by // SendMouseEvents. -void MoveMouseToCenterAndPress( - ChromeViews::View* view, MouseButton button, int state, Task* task); +void MoveMouseToCenterAndPress(views::View* view, + MouseButton button, + int state, + Task* task); } // ui_controls diff --git a/chrome/browser/bookmark_bar_context_menu_controller.cc b/chrome/browser/bookmark_bar_context_menu_controller.cc index 12b2566..458a5b6 100644 --- a/chrome/browser/bookmark_bar_context_menu_controller.cc +++ b/chrome/browser/bookmark_bar_context_menu_controller.cc @@ -172,7 +172,7 @@ class EditFolderController : public InputWindowDelegate, l10n_util::GetString(IDS_BOOMARK_FOLDER_EDITOR_WINDOW_TITLE); } - virtual ChromeViews::View* GetContentsView() { + virtual views::View* GetContentsView() { return view_; } @@ -184,7 +184,7 @@ class EditFolderController : public InputWindowDelegate, int visual_order_; bool is_new_; - ChromeViews::Window* window_; + views::Window* window_; DISALLOW_EVIL_CONSTRUCTORS(EditFolderController); }; @@ -254,7 +254,7 @@ BookmarkBarContextMenuController::BookmarkBarContextMenuController( menu_.AppendSeparator(); menu_.AppendMenuItem(IDS_BOOMARK_BAR_ALWAYS_SHOW, l10n_util::GetString(IDS_BOOMARK_BAR_ALWAYS_SHOW), - ChromeViews::MenuItemView::CHECKBOX); + views::MenuItemView::CHECKBOX); } void BookmarkBarContextMenuController::RunMenuAt(int x, int y) { @@ -266,7 +266,7 @@ void BookmarkBarContextMenuController::RunMenuAt(int x, int y) { // width/height don't matter here. menu_.RunMenuAt(view_->GetContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), - ChromeViews::MenuItemView::TOPLEFT, true); + views::MenuItemView::TOPLEFT, true); if (view_->GetModelChangedListener() == this) view_->SetModelChangedListener(last_listener); diff --git a/chrome/browser/bookmark_bar_context_menu_controller.h b/chrome/browser/bookmark_bar_context_menu_controller.h index 3052a3d..e6227cd 100644 --- a/chrome/browser/bookmark_bar_context_menu_controller.h +++ b/chrome/browser/bookmark_bar_context_menu_controller.h @@ -15,7 +15,7 @@ class PageNavigator; // BookmarkBarContextMenuController manages the context menus shown for the // bookmark bar, items on the bookmark bar, and submens of folders on the // bookmark bar. -class BookmarkBarContextMenuController : public ChromeViews::MenuDelegate, +class BookmarkBarContextMenuController : public views::MenuDelegate, public BookmarkBarView::ModelChangedListener { public: // Recursively opens all bookmarks of |node|. |initial_disposition| dictates @@ -36,7 +36,7 @@ class BookmarkBarContextMenuController : public ChromeViews::MenuDelegate, virtual void ModelChanged(); // Returns the menu. - ChromeViews::MenuItemView* menu() { return &menu_; } + views::MenuItemView* menu() { return &menu_; } // Menu::Delegate methods. virtual void ExecuteCommand(int id); @@ -48,7 +48,7 @@ class BookmarkBarContextMenuController : public ChromeViews::MenuDelegate, // bookmarks/folders. BookmarkNode* GetParentAndVisualOrderForNewNode(int* visual_order); - ChromeViews::MenuItemView menu_; + views::MenuItemView menu_; BookmarkBarView* view_; BookmarkNode* node_; diff --git a/chrome/browser/bookmarks/bookmark_model.h b/chrome/browser/bookmarks/bookmark_model.h index 7c2a6ba..d9f47ac 100644 --- a/chrome/browser/bookmarks/bookmark_model.h +++ b/chrome/browser/bookmarks/bookmark_model.h @@ -32,7 +32,7 @@ class StarredURLDatabase; // BookmarkNode contains information about a starred entry: title, URL, favicon, // star id and type. BookmarkNodes are returned from a BookmarkModel. // -class BookmarkNode : public ChromeViews::TreeNode<BookmarkNode> { +class BookmarkNode : public views::TreeNode<BookmarkNode> { friend class BookmarkEditorView; friend class BookmarkModel; friend class BookmarkCodec; diff --git a/chrome/browser/bookmarks/bookmark_model_unittest.cc b/chrome/browser/bookmarks/bookmark_model_unittest.cc index a6cab2a..9edde81 100644 --- a/chrome/browser/bookmarks/bookmark_model_unittest.cc +++ b/chrome/browser/bookmarks/bookmark_model_unittest.cc @@ -477,7 +477,7 @@ TEST_F(BookmarkModelTest, NotifyURLsStarred) { namespace { // See comment in PopulateNodeFromString. -typedef ChromeViews::TreeNodeWithValue<history::StarredEntry::Type> TestNode; +typedef views::TreeNodeWithValue<history::StarredEntry::Type> TestNode; // Does the work of PopulateNodeFromString. index gives the index of the current // element in description to process. diff --git a/chrome/browser/browser.cc b/chrome/browser/browser.cc index 3f3ebe3..b9d92e4 100644 --- a/chrome/browser/browser.cc +++ b/chrome/browser/browser.cc @@ -828,8 +828,7 @@ void Browser::ShowHtmlDialog(HtmlDialogContentsDelegate* delegate, HWND parent_hwnd) { parent_hwnd = parent_hwnd ? parent_hwnd : GetTopLevelHWND(); HtmlDialogView* html_view = new HtmlDialogView(this, profile_, delegate); - ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), - html_view); + views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), html_view); html_view->InitDialog(); html_view->window()->Show(); } @@ -1535,12 +1534,12 @@ void Browser::TabStripEmpty() { void Browser::RemoveShelvesForTabContents(TabContents* contents) { DCHECK(!g_browser_process->IsUsingNewFrames()); - ChromeViews::View* shelf = contents->GetDownloadShelfView(); + views::View* shelf = contents->GetDownloadShelfView(); if (shelf && shelf->GetParent() != NULL) shelf->GetParent()->RemoveChildView(shelf); if (contents->AsWebContents()) { - ChromeViews::View* info_bar = + views::View* info_bar = contents->AsWebContents()->view()->GetInfoBarView(); if (info_bar && info_bar->GetParent() != NULL) info_bar->GetParent()->RemoveChildView(info_bar); diff --git a/chrome/browser/browser.h b/chrome/browser/browser.h index 184496a..f57cbd4 100644 --- a/chrome/browser/browser.h +++ b/chrome/browser/browser.h @@ -384,7 +384,7 @@ class Browser : public TabStripModelDelegate, void CloseFrame(); // Returns the root view for this browser. - ChromeViews::RootView* GetRootView() const; + views::RootView* GetRootView() const; // Returns what the user's home page is, or the new tab page if the home page // has not been set. diff --git a/chrome/browser/browser_commands.cc b/chrome/browser/browser_commands.cc index eb1d405..98f7b98 100644 --- a/chrome/browser/browser_commands.cc +++ b/chrome/browser/browser_commands.cc @@ -495,7 +495,7 @@ void Browser::ExecuteCommand(int id) { case IDC_ABOUT: { UserMetrics::RecordAction(L"AboutChrome", profile_); - ChromeViews::Window::CreateChromeWindow( + views::Window::CreateChromeWindow( GetTopLevelHWND(), gfx::Rect(), new AboutChromeView(profile_))->Show(); @@ -862,8 +862,8 @@ void Browser::OpenKeywordEditor() { } void Browser::OpenImportSettingsDialog() { - ChromeViews::Window::CreateChromeWindow(GetTopLevelHWND(), gfx::Rect(), - new ImporterView(profile_))->Show(); + views::Window::CreateChromeWindow(GetTopLevelHWND(), gfx::Rect(), + new ImporterView(profile_))->Show(); } void Browser::OpenBugReportDialog() { @@ -902,12 +902,12 @@ void Browser::OpenBugReportDialog() { bug_report_view->set_png_data(screenshot_png); // Create and show the dialog - ChromeViews::Window::CreateChromeWindow(GetTopLevelHWND(), gfx::Rect(), - bug_report_view)->Show(); + views::Window::CreateChromeWindow(GetTopLevelHWND(), gfx::Rect(), + bug_report_view)->Show(); } void Browser::OpenClearBrowsingDataDialog() { - ChromeViews::Window::CreateChromeWindow( + views::Window::CreateChromeWindow( GetTopLevelHWND(), gfx::Rect(), new ClearBrowsingDataView(profile_))->Show(); diff --git a/chrome/browser/browser_focus_uitest.cc b/chrome/browser/browser_focus_uitest.cc index 4b7b39a..ec14e5e 100644 --- a/chrome/browser/browser_focus_uitest.cc +++ b/chrome/browser/browser_focus_uitest.cc @@ -43,7 +43,7 @@ bool ActivateTabByClick(AutomationProxy* automation, POINT click(bounds.CenterPoint().ToPOINT()); if (!browser_window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)) + views::Event::EF_LEFT_BUTTON_DOWN)) return false; // Wait a bit to let the click be processed. @@ -86,7 +86,7 @@ TEST_F(BrowserFocusTest, BrowsersRememberFocus) { POINT click(bounds.CenterPoint().ToPOINT()); EXPECT_TRUE(window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ::Sleep(kActionDelayMs); EXPECT_TRUE(window->GetFocusedViewID(&focused_view_id)); EXPECT_EQ(VIEW_ID_LOCATION_BAR, focused_view_id); @@ -173,7 +173,7 @@ TEST_F(BrowserFocusTest, TabsRememberFocus) { EXPECT_TRUE(window->GetViewBounds(view_id, &bounds, true)); POINT click(bounds.CenterPoint().ToPOINT()); EXPECT_TRUE(window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ::Sleep(kActionDelayMs); } @@ -250,7 +250,7 @@ TEST_F(BrowserFocusTest, LocationBarLockFocus) { EXPECT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &bounds, true)); POINT click(bounds.CenterPoint().ToPOINT()); EXPECT_TRUE(window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ::Sleep(kActionDelayMs); // Wait for the page to steal focus. @@ -282,7 +282,7 @@ TEST_F(BrowserFocusTest, FocusTraversal) { EXPECT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &bounds, true)); POINT click(bounds.CenterPoint().ToPOINT()); EXPECT_TRUE(window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ::Sleep(kActionDelayMs); const wchar_t* kExpElementIDs[] = { @@ -323,7 +323,7 @@ TEST_F(BrowserFocusTest, FocusTraversal) { // Now let's press tab to move the focus. for (int j = 0; j < 7; ++j) { - window->SimulateOSKeyPress(L'\t', ChromeViews::Event::EF_SHIFT_DOWN); + window->SimulateOSKeyPress(L'\t', views::Event::EF_SHIFT_DOWN); ::Sleep(kActionDelayMs); // Let's make sure the focus is on the expected element in the page. diff --git a/chrome/browser/browser_list.cc b/chrome/browser/browser_list.cc index b4fa057..f3cc18f 100644 --- a/chrome/browser/browser_list.cc +++ b/chrome/browser/browser_list.cc @@ -65,7 +65,7 @@ void BrowserList::RemoveBrowser(Browser* browser) { } // static -void BrowserList::AddDependentWindow(ChromeViews::Window* window) { +void BrowserList::AddDependentWindow(views::Window* window) { DependentWindowList::const_iterator existing = find(dependent_windows_.begin(), dependent_windows_.end(), window); DCHECK(existing == dependent_windows_.end()); @@ -74,7 +74,7 @@ void BrowserList::AddDependentWindow(ChromeViews::Window* window) { } // static -void BrowserList::RemoveDependentWindow(ChromeViews::Window* window) { +void BrowserList::RemoveDependentWindow(views::Window* window) { DependentWindowList::iterator existing = find(dependent_windows_.begin(), dependent_windows_.end(), window); DCHECK(existing != dependent_windows_.end()); diff --git a/chrome/browser/browser_list.h b/chrome/browser/browser_list.h index 096d516..f385777 100644 --- a/chrome/browser/browser_list.h +++ b/chrome/browser/browser_list.h @@ -10,7 +10,7 @@ #include "chrome/browser/browser.h" -namespace ChromeViews { +namespace views { class Window; }; class WebContents; @@ -44,8 +44,8 @@ class BrowserList { // top level, but whose lifetime is associated wtih the existence of at least // one active Browser. When the last Browser is destroyed, all open dependent // windows are closed. - static void AddDependentWindow(ChromeViews::Window* window); - static void RemoveDependentWindow(ChromeViews::Window* window); + static void AddDependentWindow(views::Window* window); + static void RemoveDependentWindow(views::Window* window); static void AddObserver(Observer* observer); static void RemoveObserver(Observer* observer); @@ -147,7 +147,7 @@ class BrowserList { static list_type browsers_; static std::vector<Observer*> observers_; static list_type last_active_browsers_; - typedef std::vector<ChromeViews::Window*> DependentWindowList; + typedef std::vector<views::Window*> DependentWindowList; static DependentWindowList dependent_windows_; // True if last_active_ is app modal, false otherwise. diff --git a/chrome/browser/browser_process.h b/chrome/browser/browser_process.h index 172c16b..cad8e89 100644 --- a/chrome/browser/browser_process.h +++ b/chrome/browser/browser_process.h @@ -35,12 +35,12 @@ class Thread; namespace sandbox { class BrokerServices; } -namespace ChromeViews { -class AcceleratorHandler; -} namespace printing { class PrintJobManager; } +namespace views { +class AcceleratorHandler; +} // NOT THREAD SAFE, call only from the main thread. // These functions shouldn't return NULL unless otherwise noted. @@ -107,7 +107,7 @@ class BrowserProcess { virtual bool IsShuttingDown() = 0; - virtual ChromeViews::AcceleratorHandler* accelerator_handler() = 0; + virtual views::AcceleratorHandler* accelerator_handler() = 0; virtual printing::PrintJobManager* print_job_manager() = 0; diff --git a/chrome/browser/browser_process_impl.cc b/chrome/browser/browser_process_impl.cc index 24a3098..9ff0b7b 100644 --- a/chrome/browser/browser_process_impl.cc +++ b/chrome/browser/browser_process_impl.cc @@ -183,7 +183,7 @@ BrowserProcessImpl::~BrowserProcessImpl() { print_job_manager_.reset(); // The ViewStorage needs to go before the NotificationService. - ChromeViews::ViewStorage::DeleteSharedInstance(); + views::ViewStorage::DeleteSharedInstance(); // Now OK to destroy NotificationService. main_notification_service_.reset(); @@ -341,8 +341,8 @@ void BrowserProcessImpl::CreateDebuggerWrapper(int port) { void BrowserProcessImpl::CreateAcceleratorHandler() { DCHECK(accelerator_handler_.get() == NULL); - scoped_ptr<ChromeViews::AcceleratorHandler> accelerator_handler( - new ChromeViews::AcceleratorHandler); + scoped_ptr<views::AcceleratorHandler> accelerator_handler( + new views::AcceleratorHandler); accelerator_handler_.swap(accelerator_handler); } diff --git a/chrome/browser/browser_process_impl.h b/chrome/browser/browser_process_impl.h index 3149125..47a205d 100644 --- a/chrome/browser/browser_process_impl.h +++ b/chrome/browser/browser_process_impl.h @@ -144,7 +144,7 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe { return 0 == module_ref_count_; } - virtual ChromeViews::AcceleratorHandler* accelerator_handler() { + virtual views::AcceleratorHandler* accelerator_handler() { DCHECK(CalledOnValidThread()); if (!accelerator_handler_.get()) CreateAcceleratorHandler(); @@ -238,7 +238,7 @@ class BrowserProcessImpl : public BrowserProcess, public NonThreadSafe { scoped_ptr<AutomationProviderList> automation_provider_list_; - scoped_ptr<ChromeViews::AcceleratorHandler> accelerator_handler_; + scoped_ptr<views::AcceleratorHandler> accelerator_handler_; scoped_ptr<GoogleURLTracker> google_url_tracker_; diff --git a/chrome/browser/browser_window.h b/chrome/browser/browser_window.h index 271d0cc..4012ddf 100644 --- a/chrome/browser/browser_window.h +++ b/chrome/browser/browser_window.h @@ -15,9 +15,6 @@ class BookmarkBarView; class Browser; class BrowserList; class BrowserView; -namespace ChromeViews { -class RootView; -} class GoButton; class LocationBarView; class Profile; @@ -25,6 +22,9 @@ class StatusBubble; class TabContents; class TabStrip; class ToolbarStarToggle; +namespace views { +class RootView; +} //////////////////////////////////////////////////////////////////////////////// // BrowserWindow interface @@ -115,7 +115,7 @@ class BrowserWindow { // Note if you are not calling FrameUtil::LoadAccelerators() on this frame, // this method is never invoked. virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table) = 0; + std::map<views::Accelerator, int>* accelerator_table) = 0; // Updates internal state specifying whether the throbber is to be shown. // If the throbber was shown, and should still be shown, the frame of the diff --git a/chrome/browser/chrome_plugin_host.cc b/chrome/browser/chrome_plugin_host.cc index 702e300..f96a8da 100644 --- a/chrome/browser/chrome_plugin_host.cc +++ b/chrome/browser/chrome_plugin_host.cc @@ -274,7 +274,7 @@ class ModelessHtmlDialogDelegate : public HtmlDialogContentsDelegate { // The following public methods are called from the UI thread. - // ChromeViews::WindowDelegate implementation: + // views::WindowDelegate implementation: virtual bool IsModal() const { return false; } // HtmlDialogContentsDelegate implementation: diff --git a/chrome/browser/constrained_window.h b/chrome/browser/constrained_window.h index 8d0f2fa..3244462 100644 --- a/chrome/browser/constrained_window.h +++ b/chrome/browser/constrained_window.h @@ -9,7 +9,7 @@ #include "webkit/glue/window_open_disposition.h" class ConstrainedWindow; -namespace ChromeViews { +namespace views { class View; class WindowDelegate; } @@ -74,17 +74,17 @@ class ConstrainedTabContentsDelegate { // class ConstrainedWindow { public: - // Create a Constrained Window that contains a ChromeViews::View subclass + // Create a Constrained Window that contains a views::View subclass // that provides the client area. Typical uses include the HTTP Basic Auth // prompt. The caller must provide an object implementing - // ChromeViews::WindowDelegate so that the Constrained Window can be properly + // views::WindowDelegate so that the Constrained Window can be properly // configured. If |initial_bounds| is empty, the dialog will be centered // within the constraining TabContents. static ConstrainedWindow* CreateConstrainedDialog( TabContents* owner, const gfx::Rect& initial_bounds, - ChromeViews::View* contents_view, - ChromeViews::WindowDelegate* window_delegate); + views::View* contents_view, + views::WindowDelegate* window_delegate); // Create a Constrained Window that contains a TabContents subclass, e.g. for // a web popup. |initial_bounds| specifies the desired position of the diff --git a/chrome/browser/controller.cc b/chrome/browser/controller.cc index fc916d7..a9a7619 100644 --- a/chrome/browser/controller.cc +++ b/chrome/browser/controller.cc @@ -111,7 +111,7 @@ void CommandController::RemoveCommandObserver(int id, list->erase(existing); } -void CommandController::AddManagedButton(ChromeViews::Button* b, int command) { +void CommandController::AddManagedButton(views::Button* b, int command) { ButtonController* bc = new ButtonController(b, this, command); managed_button_controllers_.push_back(bc); } diff --git a/chrome/browser/controller.h b/chrome/browser/controller.h index 74825f3..246c841 100644 --- a/chrome/browser/controller.h +++ b/chrome/browser/controller.h @@ -93,7 +93,7 @@ class CommandController : public Controller { // Add a button to the list of managed buttons. The button is synced with // the provided command - void AddManagedButton(ChromeViews::Button* button, int command); + void AddManagedButton(views::Button* button, int command); // Controller virtual bool SupportsCommand(int id) const; @@ -120,15 +120,15 @@ class CommandController : public Controller { // // ButtonController // - // An adapter class to use ChromeViews buttons with our controller + // An adapter class to use views buttons with our controller // /////////////////////////////////////////////////////////////////////////////// - class ButtonController : public ChromeViews::BaseButton::ButtonListener, + class ButtonController : public views::BaseButton::ButtonListener, public CommandObserver { public: - ButtonController(ChromeViews::Button* b, + ButtonController(views::Button* b, CommandController* controller, int command) : button_(b), @@ -144,12 +144,12 @@ class CommandController : public Controller { button_->SetEnabled(enabled); } - virtual void ButtonPressed(ChromeViews::BaseButton* sender) { + virtual void ButtonPressed(views::BaseButton* sender) { controller_->ExecuteCommand(sender->GetTag()); } private: - ChromeViews::Button* button_; + views::Button* button_; CommandController* controller_; }; diff --git a/chrome/browser/debugger/debugger_view.cc b/chrome/browser/debugger/debugger_view.cc index 704be14..9cbe4f4 100644 --- a/chrome/browser/debugger/debugger_view.cc +++ b/chrome/browser/debugger/debugger_view.cc @@ -48,8 +48,8 @@ void DebuggerView::Layout() { void DebuggerView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) { DCHECK(GetContainer()); OnInit(); diff --git a/chrome/browser/debugger/debugger_view.h b/chrome/browser/debugger/debugger_view.h index 72544b4..e9e18e9 100644 --- a/chrome/browser/debugger/debugger_view.h +++ b/chrome/browser/debugger/debugger_view.h @@ -20,8 +20,8 @@ class DebuggerWindow; class TabContentsContainerView; class WebContents; -class DebuggerView : public ChromeViews::View, - public TabContentsDelegate { +class DebuggerView : public views::View, + public TabContentsDelegate { public: DebuggerView(); virtual ~DebuggerView(); @@ -43,7 +43,7 @@ class DebuggerView : public ChromeViews::View, void SetOutputViewReady(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual std::string GetClassName() const { return "DebuggerView"; } @@ -51,8 +51,8 @@ class DebuggerView : public ChromeViews::View, virtual void Layout(); virtual void Paint(ChromeCanvas* canvas); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); // Overridden from PageNavigator (TabContentsDelegate's base interface): virtual void OpenURLFromTab(TabContents* source, diff --git a/chrome/browser/debugger/debugger_window.cc b/chrome/browser/debugger/debugger_window.cc index a30bb0a..731c907 100644 --- a/chrome/browser/debugger/debugger_window.cc +++ b/chrome/browser/debugger/debugger_window.cc @@ -37,7 +37,7 @@ void DebuggerWindow::Show(TabContents* tab) { return; } view_ = new DebuggerView(); - window_ = ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), this); + window_ = views::Window::CreateChromeWindow(NULL, gfx::Rect(), this); window_->Show(); view_->OnShow(); debugger_ready_ = true; @@ -127,7 +127,7 @@ void DebuggerWindow::SetDebuggerBreak(bool brk) { } /////////////////////////////////////////////////////////////////// -// ChromeViews::WindowDelegate methods +// views::WindowDelegate methods std::wstring DebuggerWindow::GetWindowTitle() const { if (!debugger_ready_) { @@ -157,20 +157,21 @@ bool DebuggerWindow::CanResize() const { return true; } -ChromeViews::View* DebuggerWindow::GetContentsView() { +views::View* DebuggerWindow::GetContentsView() { return view_; } /////////////////////////////////////////////////////////////////// -// Overridden from ChromeViews::TextField::Controller: +// Overridden from views::TextField::Controller: -void DebuggerWindow::ContentsChanged(ChromeViews::TextField* sender, - const std::wstring& new_contents) { +void DebuggerWindow::ContentsChanged(views::TextField* sender, + const std::wstring& new_contents) { // } -void DebuggerWindow::HandleKeystroke(ChromeViews::TextField* sender, UINT message, - TCHAR key, UINT repeat_count, UINT flags) { +void DebuggerWindow::HandleKeystroke(views::TextField* sender, UINT message, + TCHAR key, UINT repeat_count, + UINT flags) { #ifndef CHROME_DEBUGGER_DISABLED if (key == VK_RETURN) { std::wstring txt = sender->GetText(); diff --git a/chrome/browser/debugger/debugger_window.h b/chrome/browser/debugger/debugger_window.h index ca2e5b9..5ea1e57 100644 --- a/chrome/browser/debugger/debugger_window.h +++ b/chrome/browser/debugger/debugger_window.h @@ -14,8 +14,8 @@ class DebuggerView; class TabContents; class DebuggerWindow : public DebuggerInputOutput, - public ChromeViews::WindowDelegate, - public ChromeViews::TextField::Controller { + public views::WindowDelegate, + public views::TextField::Controller { public: DebuggerWindow(); virtual ~DebuggerWindow(); @@ -37,20 +37,20 @@ class DebuggerWindow : public DebuggerInputOutput, virtual void SetDebuggerReady(bool ready); virtual void SetDebuggerBreak(bool brk); - // ChromeViews::WindowDelegate methods: + // views::WindowDelegate methods: virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool CanResize() const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::TextField::Controller: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // Overridden from views::TextField::Controller: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, UINT message, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags); private: - ChromeViews::Window* window_; + views::Window* window_; DebuggerView* view_; bool debugger_ready_; diff --git a/chrome/browser/dom_ui/html_dialog_contents.h b/chrome/browser/dom_ui/html_dialog_contents.h index b8935f5..1a4c3a1 100644 --- a/chrome/browser/dom_ui/html_dialog_contents.h +++ b/chrome/browser/dom_ui/html_dialog_contents.h @@ -9,7 +9,7 @@ #include "chrome/views/window_delegate.h" // Implement this class to receive notifications. -class HtmlDialogContentsDelegate : public ChromeViews::WindowDelegate { +class HtmlDialogContentsDelegate : public views::WindowDelegate { public: // Get the HTML file path for the content to load in the dialog. virtual GURL GetDialogContentURL() const = 0; diff --git a/chrome/browser/download/download_util.cc b/chrome/browser/download/download_util.cc index 96de46c..7fab6f8 100644 --- a/chrome/browser/download/download_util.cc +++ b/chrome/browser/download/download_util.cc @@ -245,7 +245,7 @@ SkBitmap* g_foreground_32 = NULL; SkBitmap* g_background_32 = NULL; void PaintDownloadProgress(ChromeCanvas* canvas, - ChromeViews::View* containing_view, + views::View* containing_view, int origin_x, int origin_y, int start_angle, @@ -344,7 +344,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas, } void PaintDownloadComplete(ChromeCanvas* canvas, - ChromeViews::View* containing_view, + views::View* containing_view, int origin_x, int origin_y, double animation_progress, diff --git a/chrome/browser/download/download_util.h b/chrome/browser/download/download_util.h index 0ad10ab..aa52946 100644 --- a/chrome/browser/download/download_util.h +++ b/chrome/browser/download/download_util.h @@ -160,7 +160,7 @@ enum PaintDownloadProgressSize { // drawing in a right-to-left locale, we need to mirror the position of the // progress animation within the containing View. void PaintDownloadProgress(ChromeCanvas* canvas, - ChromeViews::View* containing_view, + views::View* containing_view, int origin_x, int origin_y, int start_angle, @@ -168,7 +168,7 @@ void PaintDownloadProgress(ChromeCanvas* canvas, PaintDownloadProgressSize size); void PaintDownloadComplete(ChromeCanvas* canvas, - ChromeViews::View* containing_view, + views::View* containing_view, int origin_x, int origin_y, double animation_progress, diff --git a/chrome/browser/drag_utils.cc b/chrome/browser/drag_utils.cc index 8ba82af..cb7570e 100644 --- a/chrome/browser/drag_utils.cc +++ b/chrome/browser/drag_utils.cc @@ -140,8 +140,7 @@ void SetURLAndDragImage(const GURL& url, data->SetURL(url, title); // Create a button to render the drag image for us. - ChromeViews::TextButton button( - title.empty() ? UTF8ToWide(url.spec()) : title); + views::TextButton button(title.empty() ? UTF8ToWide(url.spec()) : title); button.set_max_width(BookmarkBarView::kMaxButtonWidth); if (icon.isNull()) { button.SetIcon(*ResourceBundle::GetSharedInstance().GetBitmapNamed( diff --git a/chrome/browser/external_tab_container.cc b/chrome/browser/external_tab_container.cc index abf033f..6b7c131 100644 --- a/chrome/browser/external_tab_container.cc +++ b/chrome/browser/external_tab_container.cc @@ -50,11 +50,11 @@ bool ExternalTabContainer::Init(Profile* profile) { // is the same as the lifetime of the window SetProp(*this, kWindowObjectKey, this); - ChromeViews::SetRootViewForHWND(m_hWnd, &root_view_); + views::SetRootViewForHWND(m_hWnd, &root_view_); // CreateFocusManager will subclass this window and delete the FocusManager // instance when this window goes away. - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::CreateFocusManager(m_hWnd, GetRootView()); + views::FocusManager* focus_manager = + views::FocusManager::CreateFocusManager(m_hWnd, GetRootView()); DCHECK(focus_manager); focus_manager->AddKeystrokeListener(this); tab_contents_ = TabContents::CreateWithType(TAB_CONTENTS_WEB, @@ -93,8 +93,8 @@ bool ExternalTabContainer::Init(Profile* profile) { } void ExternalTabContainer::OnDestroy() { - ChromeViews::FocusManager * focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetHWND()); + views::FocusManager * focus_manager = + views::FocusManager::GetFocusManager(GetHWND()); if (focus_manager) { focus_manager->RemoveKeystrokeListener(this); } @@ -259,8 +259,8 @@ void ExternalTabContainer::PaintNow(const CRect& update_rect) { RDW_INVALIDATE | RDW_ALLCHILDREN | RDW_NOERASE); } -ChromeViews::RootView* ExternalTabContainer::GetRootView() { - return const_cast<ChromeViews::RootView*>(&root_view_); +views::RootView* ExternalTabContainer::GetRootView() { + return const_cast<views::RootView*>(&root_view_); } bool ExternalTabContainer::IsVisible() { diff --git a/chrome/browser/external_tab_container.h b/chrome/browser/external_tab_container.h index 2e3d589..5099958 100644 --- a/chrome/browser/external_tab_container.h +++ b/chrome/browser/external_tab_container.h @@ -30,8 +30,8 @@ class TabContentsContainerView; // It also implements Container class ExternalTabContainer : public TabContentsDelegate, public NotificationObserver, - public ChromeViews::Container, - public ChromeViews::KeystrokeListener, + public views::Container, + public views::KeystrokeListener, public CWindowImpl<ExternalTabContainer, CWindow, CWinTraits<WS_POPUP | @@ -88,21 +88,21 @@ class ExternalTabContainer : public TabContentsDelegate, const NotificationDetails& details); //////////////////////////////////////////////////////////////////////////////// - // ChromeViews::Container + // views::Container //////////////////////////////////////////////////////////////////////////////// virtual void GetBounds(CRect *out, bool including_frame) const; virtual void MoveToFront(bool should_activate); virtual HWND GetHWND() const; virtual void PaintNow(const CRect& update_rect); - virtual ChromeViews::RootView* GetRootView(); + virtual views::RootView* GetRootView(); virtual bool IsVisible(); virtual bool IsActive(); virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { + views::Accelerator* accelerator) { return false; } - // ChromeViews::KeystrokeListener implementation + // views::KeystrokeListener implementation // This method checks whether this keydown message is needed by the // external host. If so, it sends it over to the external host virtual bool ProcessKeyDown(HWND window, UINT message, WPARAM wparam, @@ -135,7 +135,7 @@ class ExternalTabContainer : public TabContentsDelegate, NotificationRegistrar registrar_; // Root view - ChromeViews::RootView root_view_; + views::RootView root_view_; // The accelerator table of the external host. HACCEL external_accel_table_; unsigned int external_accel_entry_count_; diff --git a/chrome/browser/find_in_page_controller.cc b/chrome/browser/find_in_page_controller.cc index 0f05267..df3b92d 100644 --- a/chrome/browser/find_in_page_controller.cc +++ b/chrome/browser/find_in_page_controller.cc @@ -47,13 +47,13 @@ FindInPageController::FindInPageController(TabContents* parent_tab, view_ = new FindInPageView(this); - ChromeViews::FocusManager* focus_manager; - focus_manager = ChromeViews::FocusManager::GetFocusManager(parent_hwnd_); + views::FocusManager* focus_manager; + focus_manager = views::FocusManager::GetFocusManager(parent_hwnd_); DCHECK(focus_manager); // Stores the currently focused view, and tracks focus changes so that we can // restore focus when the find box is closed. - focus_tracker_.reset(new ChromeViews::ExternalFocusTracker(view_, + focus_tracker_.reset(new views::ExternalFocusTracker(view_, focus_manager)); // Figure out where to place the dialog, initialize and set the position. @@ -152,7 +152,7 @@ void FindInPageController::UpdateWindowEdges(const gfx::Rect& new_pos) { static const int kAddedWidth = 14; int difference = (curr_pos_relative_.right() - kAddedWidth) - dialog_bounds.width() - - ChromeViews::NativeScrollBar::GetVerticalScrollBarWidth() + + views::NativeScrollBar::GetVerticalScrollBarWidth() + 1; if (difference > 0) { POINT exclude[4]; @@ -320,13 +320,13 @@ void FindInPageController::SetParent(HWND new_parent) { WM_CHANGEUISTATE, MAKEWPARAM(UIS_INITIALIZE, 0), 0); // We have a new focus manager now, so start tracking with that. - focus_tracker_.reset(new ChromeViews::ExternalFocusTracker(view_, - focus_manager_)); + focus_tracker_.reset(new views::ExternalFocusTracker(view_, + focus_manager_)); } } //////////////////////////////////////////////////////////////////////////////// -// FindInPageController, ChromeViews::ContainerWin implementation: +// FindInPageController, views::ContainerWin implementation: void FindInPageController::OnFinalMessage(HWND window) { // We are exiting, so we no longer need to monitor focus changes. @@ -340,10 +340,10 @@ void FindInPageController::OnFinalMessage(HWND window) { }; //////////////////////////////////////////////////////////////////////////////// -// FindInPageController, ChromeViews::FocusChangeListener implementation: +// FindInPageController, views::FocusChangeListener implementation: -void FindInPageController::FocusWillChange(ChromeViews::View* focused_before, - ChromeViews::View* focused_now) { +void FindInPageController::FocusWillChange(views::View* focused_before, + views::View* focused_now) { // First we need to determine if one or both of the views passed in are child // views of our view. bool our_view_before = focused_before && view_->IsParentOf(focused_before); @@ -366,10 +366,10 @@ void FindInPageController::FocusWillChange(ChromeViews::View* focused_before, } //////////////////////////////////////////////////////////////////////////////// -// FindInPageController, ChromeViews::AcceleratorTarget implementation: +// FindInPageController, views::AcceleratorTarget implementation: bool FindInPageController::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { + const views::Accelerator& accelerator) { DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); // We only expect Escape key. // This will end the Find session and hide the window, causing it to loose // focus and in the process unregister us as the handler for the Escape @@ -451,8 +451,8 @@ void FindInPageController::GetDialogBounds(gfx::Rect* bounds) { // We need to find the View for the toolbar because we want to visually // extend it (draw our dialog slightly overlapping its border). - ChromeViews::View* root_view = ChromeViews::GetRootViewForHWND(parent_hwnd_); - ChromeViews::View* toolbar = NULL; + views::View* root_view = views::GetRootViewForHWND(parent_hwnd_); + views::View* toolbar = NULL; BookmarkBarView* bookmark_bar = NULL; if (root_view) { toolbar = root_view->GetViewByID(VIEW_ID_TOOLBAR); @@ -490,7 +490,7 @@ void FindInPageController::GetDialogBounds(gfx::Rect* bounds) { // required to ensure correct positioning relative to the top,left of the // window. gfx::Point topleft; - ChromeViews::View::ConvertPointToContainer(toolbar, &topleft); + views::View::ConvertPointToContainer(toolbar, &topleft); toolbar_bounds.Offset(topleft.x(), topleft.y()); } @@ -545,7 +545,7 @@ void FindInPageController::GetDialogBounds(gfx::Rect* bounds) { // We also want to stay well within limits of the vertical scrollbar and not // draw on the window border (frame) itself either. - int width = ChromeViews::NativeScrollBar::GetVerticalScrollBarWidth(); + int width = views::NativeScrollBar::GetVerticalScrollBarWidth(); width += kWindowBorderWidth; bounds->set_x(bounds->x() + width); bounds->set_width(bounds->width() - (2 * width)); @@ -652,8 +652,7 @@ void FindInPageController::SetFocusChangeListener(HWND parent_hwnd) { } // Register as a listener with the new focus manager. - focus_manager_ = - ChromeViews::FocusManager::GetFocusManager(parent_hwnd); + focus_manager_ = views::FocusManager::GetFocusManager(parent_hwnd); DCHECK(focus_manager_); focus_manager_->AddFocusChangeListener(this); } @@ -666,11 +665,11 @@ void FindInPageController::RestoreSavedFocus() { } void FindInPageController::RegisterEscAccelerator() { - ChromeViews::Accelerator escape(VK_ESCAPE, false, false, false); + views::Accelerator escape(VK_ESCAPE, false, false, false); // TODO(finnur): Once we fix issue 1307173 we should not remember any old // accelerator targets and just Register and Unregister when needed. - ChromeViews::AcceleratorTarget* old_target = + views::AcceleratorTarget* old_target = focus_manager_->RegisterAccelerator(escape, this); if (!old_accel_target_for_esc_) @@ -681,8 +680,8 @@ void FindInPageController::UnregisterEscAccelerator() { // TODO(finnur): Once we fix issue 1307173 we should not remember any old // accelerator targets and just Register and Unregister when needed. DCHECK(old_accel_target_for_esc_ != NULL); - ChromeViews::Accelerator escape(VK_ESCAPE, false, false, false); - ChromeViews::AcceleratorTarget* current_target = + views::Accelerator escape(VK_ESCAPE, false, false, false); + views::AcceleratorTarget* current_target = focus_manager_->GetTargetForAccelerator(escape); if (current_target == this) focus_manager_->RegisterAccelerator(escape, old_accel_target_for_esc_); diff --git a/chrome/browser/find_in_page_controller.h b/chrome/browser/find_in_page_controller.h index 733d068..02399f9 100644 --- a/chrome/browser/find_in_page_controller.h +++ b/chrome/browser/find_in_page_controller.h @@ -14,9 +14,9 @@ class FindInPageView; class SlideAnimation; class TabContents; -namespace ChromeViews { - class ExternalFocusTracker; - class View; +namespace views { +class ExternalFocusTracker; +class View; } //////////////////////////////////////////////////////////////////////////////// @@ -33,8 +33,8 @@ namespace ChromeViews { // //////////////////////////////////////////////////////////////////////////////// class FindInPageController : public RenderViewHostDelegate::FindInPage, - public ChromeViews::FocusChangeListener, - public ChromeViews::ContainerWin, + public views::FocusChangeListener, + public views::ContainerWin, public AnimationDelegate { public: FindInPageController(TabContents* parent_tab, @@ -107,15 +107,15 @@ class FindInPageController : public RenderViewHostDelegate::FindInPage, find_string_ = find_string; } - // Overridden from ChromeViews::ContainerWin: + // Overridden from views::ContainerWin: virtual void OnFinalMessage(HWND window); - // Overridden from ChromeViews::FocusChangeListener: - virtual void FocusWillChange(ChromeViews::View* focused_before, - ChromeViews::View* focused_now); + // Overridden from views::FocusChangeListener: + virtual void FocusWillChange(views::View* focused_before, + views::View* focused_now); - // Overridden from ChromeViews::AcceleratorTarget: - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + // Overridden from views::AcceleratorTarget: + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); // AnimationDelegate implementation: virtual void AnimationProgressed(const Animation* animation); @@ -221,16 +221,16 @@ class FindInPageController : public RenderViewHostDelegate::FindInPage, bool show_on_tab_selection_; // The focus manager we register with to keep track of focus changes. - ChromeViews::FocusManager* focus_manager_; + views::FocusManager* focus_manager_; // Stores the previous accelerator target for the Escape key, so that we can // restore the state once we loose focus. - ChromeViews::AcceleratorTarget* old_accel_target_for_esc_; + views::AcceleratorTarget* old_accel_target_for_esc_; // Tracks and stores the last focused view which is not the FindInPageView or // any of its children. Used to restore focus once the FindInPageView is // closed. - scoped_ptr<ChromeViews::ExternalFocusTracker> focus_tracker_; + scoped_ptr<views::ExternalFocusTracker> focus_tracker_; DISALLOW_COPY_AND_ASSIGN(FindInPageController); }; diff --git a/chrome/browser/find_in_page_controller_interactive_uitest.cc b/chrome/browser/find_in_page_controller_interactive_uitest.cc index 203b1ca..383a64a 100644 --- a/chrome/browser/find_in_page_controller_interactive_uitest.cc +++ b/chrome/browser/find_in_page_controller_interactive_uitest.cc @@ -40,7 +40,7 @@ bool ActivateTabByClick(AutomationProxy* automation, POINT click(bounds.CenterPoint().ToPOINT()); if (!browser_window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)) + views::Event::EF_LEFT_BUTTON_DOWN)) return false; // Wait a bit to let the click be processed. @@ -84,7 +84,7 @@ TEST_F(FindInPageTest, CrashEscHandlers) { EXPECT_TRUE(window->GetViewBounds(VIEW_ID_LOCATION_BAR, &bounds, false)); POINT click(bounds.CenterPoint().ToPOINT()); EXPECT_TRUE(window->SimulateOSClick(click, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ::Sleep(kActionDelayMs); int focused_view_id; EXPECT_TRUE(window->GetFocusedViewID(&focused_view_id)); diff --git a/chrome/browser/find_in_page_view.cc b/chrome/browser/find_in_page_view.cc index 2c3aa19..3868e0f 100644 --- a/chrome/browser/find_in_page_view.cc +++ b/chrome/browser/find_in_page_view.cc @@ -92,54 +92,54 @@ FindInPageView::FindInPageView(FindInPageController* controller) active_match_ordinal_(-1) { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - find_text_ = new ChromeViews::TextField(); + find_text_ = new views::TextField(); find_text_->SetFont(rb.GetFont(ResourceBundle::BaseFont)); find_text_->set_default_width_in_chars(kDefaultCharWidth); AddChildView(find_text_); - match_count_text_ = new ChromeViews::Label(); + match_count_text_ = new views::Label(); match_count_text_->SetFont(rb.GetFont(ResourceBundle::BaseFont)); match_count_text_->SetColor(kTextColorMatchCount); - match_count_text_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_CENTER); + match_count_text_->SetHorizontalAlignment(views::Label::ALIGN_CENTER); AddChildView(match_count_text_); // Create a focus forwarder view which sends focus to find_text_. focus_forwarder_view_ = new FocusForwarderView(find_text_); AddChildView(focus_forwarder_view_); - find_previous_button_ = new ChromeViews::Button(); + find_previous_button_ = new views::Button(); find_previous_button_->SetEnabled(false); find_previous_button_->SetFocusable(true); - find_previous_button_->SetImage(ChromeViews::Button::BS_NORMAL, + find_previous_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_FINDINPAGE_PREV)); - find_previous_button_->SetImage(ChromeViews::Button::BS_HOT, + find_previous_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_FINDINPAGE_PREV_H)); - find_previous_button_->SetImage(ChromeViews::Button::BS_DISABLED, + find_previous_button_->SetImage(views::Button::BS_DISABLED, rb.GetBitmapNamed(IDR_FINDINPAGE_PREV_P)); find_previous_button_->SetTooltipText( l10n_util::GetString(IDS_FIND_IN_PAGE_PREVIOUS_TOOLTIP)); AddChildView(find_previous_button_); - find_next_button_ = new ChromeViews::Button(); + find_next_button_ = new views::Button(); find_next_button_->SetEnabled(false); find_next_button_->SetFocusable(true); - find_next_button_->SetImage(ChromeViews::Button::BS_NORMAL, + find_next_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_FINDINPAGE_NEXT)); - find_next_button_->SetImage(ChromeViews::Button::BS_HOT, + find_next_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_FINDINPAGE_NEXT_H)); - find_next_button_->SetImage(ChromeViews::Button::BS_DISABLED, + find_next_button_->SetImage(views::Button::BS_DISABLED, rb.GetBitmapNamed(IDR_FINDINPAGE_NEXT_P)); find_next_button_->SetTooltipText( l10n_util::GetString(IDS_FIND_IN_PAGE_NEXT_TOOLTIP)); AddChildView(find_next_button_); - close_button_ = new ChromeViews::Button(); + close_button_ = new views::Button(); close_button_->SetFocusable(true); - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, + close_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_CLOSE_BAR)); - close_button_->SetImage(ChromeViews::Button::BS_HOT, + close_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, + close_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); close_button_->SetTooltipText( l10n_util::GetString(IDS_FIND_IN_PAGE_CLOSE_TOOLTIP)); @@ -176,7 +176,7 @@ void FindInPageView::ResetMatchCount() { void FindInPageView::ResetMatchCountBackground() { match_count_text_->SetBackground( - ChromeViews::Background::CreateSolidBackground(kBackgroundColorMatch)); + views::Background::CreateSolidBackground(kBackgroundColorMatch)); match_count_text_->SetColor(kTextColorMatchCount); } @@ -202,7 +202,7 @@ void FindInPageView::UpdateMatchCount(int number_of_matches, ResetMatchCountBackground(); } else { match_count_text_->SetBackground( - ChromeViews::Background::CreateSolidBackground(kBackgroundColorNoMatch)); + views::Background::CreateSolidBackground(kBackgroundColorNoMatch)); match_count_text_->SetColor(kTextColorNoMatch); MessageBeep(MB_OK); } @@ -238,7 +238,7 @@ void FindInPageView::OnShow() { } /////////////////////////////////////////////////////////////////////////////// -// FindInPageView, ChromeViews::View overrides: +// FindInPageView, views::View overrides: void FindInPageView::Paint(ChromeCanvas* canvas) { SkPaint paint; @@ -422,9 +422,9 @@ gfx::Size FindInPageView::GetPreferredSize() { } //////////////////////////////////////////////////////////////////////////////// -// FindInPageView, ChromeViews::BaseButton::ButtonListener implementation: +// FindInPageView, views::BaseButton::ButtonListener implementation: -void FindInPageView::ButtonPressed(ChromeViews::BaseButton* sender) { +void FindInPageView::ButtonPressed(views::BaseButton* sender) { switch (sender->GetTag()) { case FIND_PREVIOUS_TAG: case FIND_NEXT_TAG: @@ -443,9 +443,9 @@ void FindInPageView::ButtonPressed(ChromeViews::BaseButton* sender) { } //////////////////////////////////////////////////////////////////////////////// -// FindInPageView, ChromeViews::TextField::Controller implementation: +// FindInPageView, views::TextField::Controller implementation: -void FindInPageView::ContentsChanged(ChromeViews::TextField* sender, +void FindInPageView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { // When the user changes something in the text box we check the contents and // if the textbox contains something we set it as the new search string and @@ -462,7 +462,7 @@ void FindInPageView::ContentsChanged(ChromeViews::TextField* sender, } } -void FindInPageView::HandleKeystroke(ChromeViews::TextField* sender, +void FindInPageView::HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags) { // If the dialog is not visible, there is no reason to process keyboard input. @@ -484,7 +484,7 @@ void FindInPageView::HandleKeystroke(ChromeViews::TextField* sender, } bool FindInPageView::FocusForwarderView::OnMousePressed( - const ChromeViews::MouseEvent& event) { + const views::MouseEvent& event) { if (view_to_focus_on_mousedown_) { view_to_focus_on_mousedown_->ClearSelection(); view_to_focus_on_mousedown_->RequestFocus(); diff --git a/chrome/browser/find_in_page_view.h b/chrome/browser/find_in_page_view.h index 4f09ae0..a6c957f 100644 --- a/chrome/browser/find_in_page_view.h +++ b/chrome/browser/find_in_page_view.h @@ -11,10 +11,10 @@ class FindInPageController; -namespace ChromeViews { - class Label; - class MouseEvent; - class View; +namespace views { +class Label; +class MouseEvent; +class View; } //////////////////////////////////////////////////////////////////////////////// @@ -24,9 +24,9 @@ namespace ChromeViews { // button. It communicates the user search words to the FindInPageController. // //////////////////////////////////////////////////////////////////////////////// -class FindInPageView : public ChromeViews::View, - public ChromeViews::BaseButton::ButtonListener, - public ChromeViews::TextField::Controller { +class FindInPageView : public views::View, + public views::BaseButton::ButtonListener, + public views::TextField::Controller { public: // A tag denoting which button the user pressed. enum ButtonTag { @@ -65,19 +65,19 @@ class FindInPageView : public ChromeViews::View, // Find window (while animating the opening or closing of the window). void animation_offset(int offset) { animation_offset_ = offset; } - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); - // Overridden from ChromeViews::ButtonListener::ButtonPressed: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // Overridden from views::ButtonListener::ButtonPressed: + virtual void ButtonPressed(views::BaseButton* sender); - // Overridden from ChromeViews::TextField::Controller: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // Overridden from views::TextField::Controller: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, UINT message, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags); // Set whether or not we're attempting to blend with the toolbar. @@ -90,16 +90,16 @@ class FindInPageView : public ChromeViews::View, // match_count label. The user, however, expects being able to click anywhere // inside what looks like the find text box (including on or around the // match_count label) and have focus brought to the find box. - class FocusForwarderView : public ChromeViews::View { + class FocusForwarderView : public views::View { public: explicit FocusForwarderView( - ChromeViews::TextField* view_to_focus_on_mousedown) + views::TextField* view_to_focus_on_mousedown) : view_to_focus_on_mousedown_(view_to_focus_on_mousedown) {} private: - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); + virtual bool OnMousePressed(const views::MouseEvent& event); - ChromeViews::TextField* view_to_focus_on_mousedown_; + views::TextField* view_to_focus_on_mousedown_; DISALLOW_EVIL_CONSTRUCTORS(FocusForwarderView); }; @@ -109,12 +109,12 @@ class FindInPageView : public ChromeViews::View, FindInPageController* controller_; // The controls in the window. - ChromeViews::TextField* find_text_; - ChromeViews::Label* match_count_text_; + views::TextField* find_text_; + views::Label* match_count_text_; FocusForwarderView* focus_forwarder_view_; - ChromeViews::Button* find_previous_button_; - ChromeViews::Button* find_next_button_; - ChromeViews::Button* close_button_; + views::Button* find_previous_button_; + views::Button* find_next_button_; + views::Button* close_button_; // Whether or not we're attempting to blend with the toolbar (this is // false if the bookmarks bar is visible). diff --git a/chrome/browser/first_run.cc b/chrome/browser/first_run.cc index da1bdd3..96ca07d 100644 --- a/chrome/browser/first_run.cc +++ b/chrome/browser/first_run.cc @@ -158,8 +158,8 @@ bool Upgrade::RelaunchChromeBrowser(const CommandLine& command_line) { } void OpenFirstRunDialog(Profile* profile) { - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), - new FirstRunView(profile))->Show(); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), + new FirstRunView(profile))->Show(); // We must now run a message loop (will be terminated when the First Run UI // is closed) so that the window can receive messages and we block the // browser window from showing up. We pass the accelerator handler here so diff --git a/chrome/browser/frame_util.cc b/chrome/browser/frame_util.cc index 63f27f0..9580c4e 100644 --- a/chrome/browser/frame_util.cc +++ b/chrome/browser/frame_util.cc @@ -87,9 +87,10 @@ BrowserWindow* FrameUtil::CreateBrowserWindow(const gfx::Rect& bounds, } // static -bool FrameUtil::LoadAccelerators(BrowserWindow* frame, +bool FrameUtil::LoadAccelerators( + BrowserWindow* frame, HACCEL accelerator_table, - ChromeViews::AcceleratorTarget* accelerator_target) { + views::AcceleratorTarget* accelerator_target) { DCHECK(!g_browser_process->IsUsingNewFrames()); // We have to copy the table to access its contents. @@ -103,18 +104,18 @@ bool FrameUtil::LoadAccelerators(BrowserWindow* frame, CopyAcceleratorTable(accelerator_table, accelerators, count); HWND hwnd = static_cast<HWND>(frame->GetPlatformID()); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(hwnd); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(hwnd); DCHECK(focus_manager); // Let's build our own accelerator table. - std::map<ChromeViews::Accelerator, int>* our_accelerators = - new std::map<ChromeViews::Accelerator, int>; + std::map<views::Accelerator, int>* our_accelerators = + new std::map<views::Accelerator, int>; for (int i = 0; i < count; ++i) { bool alt_down = (accelerators[i].fVirt & FALT) == FALT; bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; - ChromeViews::Accelerator accelerator(accelerators[i].key, + views::Accelerator accelerator(accelerators[i].key, shift_down, ctrl_down, alt_down); (*our_accelerators)[accelerator] = accelerators[i].cmd; diff --git a/chrome/browser/frame_util.h b/chrome/browser/frame_util.h index 12358b5..1c38ca0 100644 --- a/chrome/browser/frame_util.h +++ b/chrome/browser/frame_util.h @@ -9,7 +9,7 @@ class Browser; class BrowserWindow; -namespace ChromeViews { +namespace views { class AcceleratorTarget; } namespace gfx { @@ -33,7 +33,7 @@ class FrameUtil { static bool LoadAccelerators( BrowserWindow* frame, HACCEL accelerator_table, - ChromeViews::AcceleratorTarget* accelerator_target); + views::AcceleratorTarget* accelerator_target); // Activate any app modal dialog that might be present. Returns true if one // was present. diff --git a/chrome/browser/google_update.cc b/chrome/browser/google_update.cc index 71e22e5..0269e4c 100644 --- a/chrome/browser/google_update.cc +++ b/chrome/browser/google_update.cc @@ -161,7 +161,7 @@ GoogleUpdate::~GoogleUpdate() { } //////////////////////////////////////////////////////////////////////////////// -// GoogleUpdate, ChromeViews::DialogDelegate implementation: +// GoogleUpdate, views::DialogDelegate implementation: void GoogleUpdate::CheckForUpdate(bool install_if_newer) { // We need to shunt this request over to InitiateGoogleUpdateCheck and have diff --git a/chrome/browser/history/starred_url_database.h b/chrome/browser/history/starred_url_database.h index b7ff79e..87bcef4 100644 --- a/chrome/browser/history/starred_url_database.h +++ b/chrome/browser/history/starred_url_database.h @@ -114,7 +114,7 @@ class StarredURLDatabase : public URLDatabase { StarID CreateStarredEntry(StarredEntry* entry); // Used when checking integrity of starred table. - typedef ChromeViews::TreeNodeWithValue<history::StarredEntry> StarredNode; + typedef views::TreeNodeWithValue<history::StarredEntry> StarredNode; // Returns the max group id, or 0 if there is an error. UIStarID GetMaxGroupID(); diff --git a/chrome/browser/history_tab_ui.cc b/chrome/browser/history_tab_ui.cc index ea4afee..6c63f2c 100644 --- a/chrome/browser/history_tab_ui.cc +++ b/chrome/browser/history_tab_ui.cc @@ -69,7 +69,7 @@ const std::wstring HistoryTabUI::GetSearchButtonText() const { return l10n_util::GetString(IDS_HISTORY_SEARCH_BUTTON); } -ChromeViews::View* HistoryTabUI::GetView() { +views::View* HistoryTabUI::GetView() { return &searchable_container_; } diff --git a/chrome/browser/history_tab_ui.h b/chrome/browser/history_tab_ui.h index 8c83a52..a99039e 100644 --- a/chrome/browser/history_tab_ui.h +++ b/chrome/browser/history_tab_ui.h @@ -29,7 +29,7 @@ class HistoryTabUI : public NativeUI, virtual const int GetFavIconID() const; virtual const int GetSectionIconID() const; virtual const std::wstring GetSearchButtonText() const; - virtual ChromeViews::View* GetView(); + virtual views::View* GetView(); virtual void WillBecomeVisible(NativeUIContents* parent); virtual void WillBecomeInvisible(NativeUIContents* parent); virtual void Navigate(const PageState& state); diff --git a/chrome/browser/history_view.cc b/chrome/browser/history_view.cc index 7ff4225..035e5e1 100644 --- a/chrome/browser/history_view.cc +++ b/chrome/browser/history_view.cc @@ -85,7 +85,7 @@ static const int kIconPadding = 4; // SnippetRenderer is a View that can displayed text with bolding and wrapping. // It's used to display search result snippets. -class SnippetRenderer : public ChromeViews::View { +class SnippetRenderer : public views::View { public: SnippetRenderer(); @@ -224,8 +224,8 @@ int SnippetRenderer::ProcessRun( } // A View for an individual history result. -class HistoryItemRenderer : public ChromeViews::View, - public ChromeViews::LinkController, +class HistoryItemRenderer : public views::View, + public views::LinkController, public StarToggle::Delegate { public: HistoryItemRenderer(HistoryView* parent, bool show_full); @@ -280,7 +280,7 @@ class HistoryItemRenderer : public ChromeViews::View, virtual void StarStateChanged(bool state); // Notification that the link was clicked. - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); // Returns the region the mouse is over. DragRegion GetDragRegion(int x, int y); @@ -297,8 +297,8 @@ class HistoryItemRenderer : public ChromeViews::View, // Widgets. StarToggle* star_toggle_; - ChromeViews::Link* title_link_; - ChromeViews::Label* time_label_; + views::Link* title_link_; + views::Label* time_label_; SnippetRenderer* snippet_label_; DISALLOW_EVIL_CONSTRUCTORS(HistoryItemRenderer); @@ -316,19 +316,19 @@ HistoryItemRenderer::HistoryItemRenderer(HistoryView* parent, star_toggle_->set_change_state_immediately(false); AddChildView(star_toggle_); - title_link_ = new ChromeViews::Link(); + title_link_ = new views::Link(); title_link_->SetFont(text_font); - title_link_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + title_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_link_->SetController(this); AddChildView(title_link_); const SkColor kTimeColor = SkColorSetRGB(136, 136, 136); // Gray. - time_label_ = new ChromeViews::Label(); + time_label_ = new views::Label(); ChromeFont time_font(text_font); time_label_->SetFont(time_font); time_label_->SetColor(kTimeColor); - time_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + time_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(time_label_); snippet_label_ = new SnippetRenderer(); @@ -355,7 +355,7 @@ std::wstring HistoryItemRenderer::DisplayURL(const GURL& url) { } void HistoryItemRenderer::Paint(ChromeCanvas* canvas) { - ChromeViews::View::Paint(canvas); + views::View::Paint(canvas); // Draw thumbnail or placeholder. if (show_full_) { @@ -557,7 +557,7 @@ void HistoryItemRenderer::SetDisplayStyle(bool show_full) { void HistoryItemRenderer::StarStateChanged(bool state) { // Show the user a tip that can be used to edit the bookmark/star. gfx::Point star_location; - ChromeViews::View::ConvertPointToScreen(star_toggle_, &star_location); + views::View::ConvertPointToScreen(star_toggle_, &star_location); // Shift the location to make the bubble appear at a visually pleasing // location. gfx::Rect star_bounds(star_location.x(), star_location.y() + 4, @@ -577,7 +577,7 @@ void HistoryItemRenderer::StarStateChanged(bool state) { BookmarkBubbleView::Show(parent, star_bounds, NULL, profile, url, state); } -void HistoryItemRenderer::LinkActivated(ChromeViews::Link* link, +void HistoryItemRenderer::LinkActivated(views::Link* link, int event_flags) { if (link == title_link_) { const GURL& url = model_->GetURL(model_index_); @@ -663,7 +663,7 @@ void HistoryView::EnsureRenderer() { renderer_ = new HistoryItemRenderer(this, show_results_); if (show_delete_controls_ && !delete_renderer_.get()) { delete_renderer_.reset( - new ChromeViews::Link( + new views::Link( l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK))); delete_renderer_->SetFont(day_break_font_); } @@ -794,20 +794,20 @@ void HistoryView::SetShowDeleteControls(bool show_delete_controls) { } int HistoryView::GetPageScrollIncrement( - ChromeViews::ScrollView* scroll_view, bool is_horizontal, + views::ScrollView* scroll_view, bool is_horizontal, bool is_positive) { return scroll_helper_.GetPageScrollIncrement(scroll_view, is_horizontal, is_positive); } int HistoryView::GetLineScrollIncrement( - ChromeViews::ScrollView* scroll_view, bool is_horizontal, + views::ScrollView* scroll_view, bool is_horizontal, bool is_positive) { return scroll_helper_.GetLineScrollIncrement(scroll_view, is_horizontal, is_positive); } -ChromeViews::VariableRowHeightScrollHelper::RowInfo +views::VariableRowHeightScrollHelper::RowInfo HistoryView::GetRowInfo(int y) { // Get the time separator header for a given Y click. BreakOffsets::iterator i = GetBreakOffsetIteratorForY(y); @@ -816,7 +816,7 @@ ChromeViews::VariableRowHeightScrollHelper::RowInfo // Check if the click is on the separator header. if (y < current_y + GetBreakOffsetHeight(i->second)) { - return ChromeViews::VariableRowHeightScrollHelper::RowInfo( + return views::VariableRowHeightScrollHelper::RowInfo( current_y, GetBreakOffsetHeight(i->second)); } @@ -831,12 +831,12 @@ ChromeViews::VariableRowHeightScrollHelper::RowInfo } // Find the item that corresponds to this new current_y value. - return ChromeViews::VariableRowHeightScrollHelper::RowInfo( + return views::VariableRowHeightScrollHelper::RowInfo( current_y, GetEntryHeight()); } bool HistoryView::IsVisible() { - ChromeViews::Container* vc = GetContainer(); + views::Container* vc = GetContainer(); return vc && vc->IsVisible(); } @@ -888,7 +888,7 @@ int HistoryView::GetBreakOffsetHeight(HistoryView::BreakValue value) { } void HistoryView::Paint(ChromeCanvas* canvas) { - ChromeViews::View::Paint(canvas); + views::View::Paint(canvas); EnsureRenderer(); @@ -1164,7 +1164,7 @@ bool HistoryView::GetFloatingViewIDForPoint(int x, int y, int* id) { } bool HistoryView::EnumerateFloatingViews( - ChromeViews::View::FloatingViewPosition position, + views::View::FloatingViewPosition position, int starting_id, int* id) { DCHECK(id); @@ -1173,7 +1173,7 @@ bool HistoryView::EnumerateFloatingViews( position, starting_id, id); } -ChromeViews::View* HistoryView::ValidateFloatingViewForID(int id) { +views::View* HistoryView::ValidateFloatingViewForID(int id) { if (id >= GetMaxViewID()) return NULL; @@ -1183,7 +1183,7 @@ ChromeViews::View* HistoryView::ValidateFloatingViewForID(int id) { int y = GetYCoordinateForViewID(id, &model_index, &is_delete_control); if (is_delete_control) { - ChromeViews::Link* delete_link = new ChromeViews::Link( + views::Link* delete_link = new views::Link( l10n_util::GetString(IDS_HISTORY_DELETE_PRIOR_VISITS_LINK)); delete_link->SetID(model_index); delete_link->SetFont(day_break_font_); @@ -1207,7 +1207,7 @@ ChromeViews::View* HistoryView::ValidateFloatingViewForID(int id) { AttachFloatingView(floating_view, id); #ifdef DEBUG_FLOATING_VIEWS - floating_view->SetBackground(ChromeViews::Background::CreateSolidBackground( + floating_view->SetBackground(views::Background::CreateSolidBackground( SkColorSetRGB(255, 0, 0))); floating_view->SchedulePaint(); #endif @@ -1232,7 +1232,7 @@ int HistoryView::GetMaxViewID() { return std::max(0, deletes + model_->GetItemCount()); } -void HistoryView::LinkActivated(ChromeViews::Link* source, int event_flags) { +void HistoryView::LinkActivated(views::Link* source, int event_flags) { DeleteDayAtModelIndex(source->GetID()); } diff --git a/chrome/browser/history_view.h b/chrome/browser/history_view.h index 8f5998c..35c9db3 100644 --- a/chrome/browser/history_view.h +++ b/chrome/browser/history_view.h @@ -19,10 +19,10 @@ class HistoryItemRenderer; class BaseHistoryModel; class SearchableUIContainer; -class HistoryView : public ChromeViews::View, +class HistoryView : public views::View, public BaseHistoryModelObserver, - public ChromeViews::LinkController, - ChromeViews::VariableRowHeightScrollHelper::Controller { + public views::LinkController, + views::VariableRowHeightScrollHelper::Controller { public: HistoryView(SearchableUIContainer* container, BaseHistoryModel* model, @@ -41,9 +41,9 @@ class HistoryView : public ChromeViews::View, // Overriden for focus traversal. virtual bool EnumerateFloatingViews( - ChromeViews::View::FloatingViewPosition position, + views::View::FloatingViewPosition position, int starting_id, int* id); - virtual ChromeViews::View* ValidateFloatingViewForID(int id); + virtual views::View* ValidateFloatingViewForID(int id); // Render the visible area. virtual void Paint(ChromeCanvas* canvas); @@ -64,11 +64,11 @@ class HistoryView : public ChromeViews::View, PageNavigator* navigator() const { return navigator_; } // Scrolling. - virtual int GetPageScrollIncrement(ChromeViews::ScrollView* scroll_view, + virtual int GetPageScrollIncrement(views::ScrollView* scroll_view, bool is_horizontal, bool is_positive); - virtual int GetLineScrollIncrement(ChromeViews::ScrollView* scroll_view, + virtual int GetLineScrollIncrement(views::ScrollView* scroll_view, bool is_horizontal, bool is_positive); - virtual ChromeViews::VariableRowHeightScrollHelper::RowInfo GetRowInfo(int y); + virtual views::VariableRowHeightScrollHelper::RowInfo GetRowInfo(int y); private: // For any given break (see comments for BreakOffsets, below), we store the @@ -99,7 +99,7 @@ class HistoryView : public ChromeViews::View, bool* is_delete_control); // Invoked when the user clicks the delete previous visits link. - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); // Prompts the user to make sure they really want to delete, and if so // deletes the day at the specified model index. @@ -126,7 +126,7 @@ class HistoryView : public ChromeViews::View, HistoryItemRenderer* renderer_; // Used to render 'delete' controls. - scoped_ptr<ChromeViews::Link> delete_renderer_; + scoped_ptr<views::Link> delete_renderer_; // Class that performs the navigation when the user clicks on a page. PageNavigator* navigator_; @@ -193,7 +193,7 @@ class HistoryView : public ChromeViews::View, int GetBreakOffsetHeight(BreakValue value); - ChromeViews::VariableRowHeightScrollHelper scroll_helper_; + views::VariableRowHeightScrollHelper scroll_helper_; // Whether we are showing search results. bool show_results_; diff --git a/chrome/browser/importer/importer.cc b/chrome/browser/importer/importer.cc index 2a63072..4c600d9 100644 --- a/chrome/browser/importer/importer.cc +++ b/chrome/browser/importer/importer.cc @@ -346,8 +346,8 @@ void ImporterHost::Observe(NotificationType type, } void ImporterHost::ShowWarningDialog() { - ChromeViews::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(), - new ImporterLockView(this))->Show(); + views::Window::CreateChromeWindow(GetActiveWindow(), gfx::Rect(), + new ImporterLockView(this))->Show(); } void ImporterHost::OnLockViewEnd(bool is_continue) { diff --git a/chrome/browser/js_before_unload_handler.cc b/chrome/browser/js_before_unload_handler.cc index 321716b..01fca94 100644 --- a/chrome/browser/js_before_unload_handler.cc +++ b/chrome/browser/js_before_unload_handler.cc @@ -27,7 +27,7 @@ void JavascriptBeforeUnloadHandler::RunBeforeUnloadDialog( } ////////////////////////////////////////////////////////////////////////////// -// JavascriptBeforeUnloadHandler, ChromeViews::DialogDelegate implementation: +// JavascriptBeforeUnloadHandler, views::DialogDelegate implementation: std::wstring JavascriptBeforeUnloadHandler::GetWindowTitle() const { return l10n_util::GetString(IDS_BEFOREUNLOAD_MESSAGEBOX_TITLE); diff --git a/chrome/browser/js_before_unload_handler.h b/chrome/browser/js_before_unload_handler.h index a00b8544..bb75356 100644 --- a/chrome/browser/js_before_unload_handler.h +++ b/chrome/browser/js_before_unload_handler.h @@ -18,7 +18,7 @@ class JavascriptBeforeUnloadHandler : public JavascriptMessageBoxHandler { IPC::Message* reply_msg); virtual ~JavascriptBeforeUnloadHandler() {} - // ChromeViews::DialogDelegate Methods: + // views::DialogDelegate Methods: virtual std::wstring GetWindowTitle() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; diff --git a/chrome/browser/jsmessage_box_handler.cc b/chrome/browser/jsmessage_box_handler.cc index bcb4e92..df740cc 100644 --- a/chrome/browser/jsmessage_box_handler.cc +++ b/chrome/browser/jsmessage_box_handler.cc @@ -46,7 +46,7 @@ JavascriptMessageBoxHandler::~JavascriptMessageBoxHandler() { } ////////////////////////////////////////////////////////////////////////////// -// JavascriptMessageBoxHandler, ChromeViews::DialogDelegate implementation: +// JavascriptMessageBoxHandler, views::DialogDelegate implementation: int JavascriptMessageBoxHandler::GetDialogButtons() const { int dialog_buttons = 0; @@ -119,7 +119,7 @@ bool JavascriptMessageBoxHandler::Accept() { } ////////////////////////////////////////////////////////////////////////////// -// JavascriptMessageBoxHandler, ChromeViews::AppModalDialogDelegate +// JavascriptMessageBoxHandler, views::AppModalDialogDelegate // implementation: void JavascriptMessageBoxHandler::ShowModalDialog() { @@ -133,8 +133,7 @@ void JavascriptMessageBoxHandler::ShowModalDialog() { web_contents_->Activate(); HWND root_hwnd = GetAncestor(web_contents_->GetContainerHWND(), GA_ROOT); - dialog_ = - ChromeViews::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this); + dialog_ = views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this); dialog_->Show(); } @@ -147,9 +146,9 @@ void JavascriptMessageBoxHandler::ActivateModalDialog() { } /////////////////////////////////////////////////////////////////////////////// -// JavascriptMessageBoxHandler, ChromeViews::WindowDelegate implementation: +// JavascriptMessageBoxHandler, views::WindowDelegate implementation: -ChromeViews::View* JavascriptMessageBoxHandler::GetContentsView() { +views::View* JavascriptMessageBoxHandler::GetContentsView() { return message_box_view_; } diff --git a/chrome/browser/jsmessage_box_handler.h b/chrome/browser/jsmessage_box_handler.h index b2df346..0c66c89 100644 --- a/chrome/browser/jsmessage_box_handler.h +++ b/chrome/browser/jsmessage_box_handler.h @@ -11,13 +11,12 @@ class MessageBoxView; class WebContents; - -namespace ChromeViews { +namespace views { class Window; } class JavascriptMessageBoxHandler - : public ChromeViews::AppModalDialogDelegate, + : public views::AppModalDialogDelegate, public NotificationObserver { public: // Creates and runs a Javascript Message Box dialog. @@ -34,20 +33,20 @@ class JavascriptMessageBoxHandler IPC::Message* reply_msg); virtual ~JavascriptMessageBoxHandler(); - // ChromeViews::DialogDelegate Methods: + // views::DialogDelegate Methods: virtual int GetDialogButtons() const; virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool Cancel(); virtual bool Accept(); - // ChromeViews::AppModalDialogDelegate + // views::AppModalDialogDelegate virtual void ShowModalDialog(); virtual void ActivateModalDialog(); - // ChromeViews::WindowDelegate Methods: + // views::WindowDelegate Methods: virtual bool IsModal() const { return true; } - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); protected: // Use RunJavaScriptMessageBox to use. @@ -78,7 +77,7 @@ class JavascriptMessageBoxHandler int dialog_flags_; // The dialog if it is currently visible. - ChromeViews::Window* dialog_; + views::Window* dialog_; DISALLOW_EVIL_CONSTRUCTORS(JavascriptMessageBoxHandler); }; diff --git a/chrome/browser/login_prompt.cc b/chrome/browser/login_prompt.cc index fe1d7d4..1e95b0c 100644 --- a/chrome/browser/login_prompt.cc +++ b/chrome/browser/login_prompt.cc @@ -27,7 +27,7 @@ #include "generated_resources.h" using namespace std; -using ChromeViews::LoginView; +using views::LoginView; class LoginHandlerImpl; @@ -51,7 +51,7 @@ static void ResetLoginHandlerForRequest(URLRequest* request) { // have been called. class LoginHandlerImpl : public LoginHandler, public base::RefCountedThreadSafe<LoginHandlerImpl>, - public ChromeViews::DialogDelegate { + public views::DialogDelegate { public: LoginHandlerImpl(URLRequest* request, MessageLoop* ui_loop) : dialog_(NULL), @@ -104,7 +104,7 @@ class LoginHandlerImpl : public LoginHandler, password_manager_ = password_manager; } - // ChromeViews::DialogDelegate methods: + // views::DialogDelegate methods: virtual std::wstring GetDialogButtonLabel(DialogButton button) const { if (button == DIALOGBUTTON_OK) return l10n_util::GetString(IDS_LOGIN_DIALOG_OK_BUTTON_LABEL); @@ -140,7 +140,7 @@ class LoginHandlerImpl : public LoginHandler, SetAuth(login_view_->GetUsername(), login_view_->GetPassword()); return true; } - virtual ChromeViews::View* GetContentsView() { + virtual views::View* GetContentsView() { return login_view_; } diff --git a/chrome/browser/modal_html_dialog_delegate.h b/chrome/browser/modal_html_dialog_delegate.h index 4b83c4c..25afd706 100644 --- a/chrome/browser/modal_html_dialog_delegate.h +++ b/chrome/browser/modal_html_dialog_delegate.h @@ -27,7 +27,7 @@ class ModalHtmlDialogDelegate const NotificationSource& source, const NotificationDetails& details); - // ChromeViews::WindowDelegate implementation: + // views::WindowDelegate implementation: virtual bool IsModal() const; // ModalHtmlDialogContents::ModalHTMLDialogContentsDelegate implementation: diff --git a/chrome/browser/native_ui_contents.cc b/chrome/browser/native_ui_contents.cc index 785ca8a..2cf0572 100644 --- a/chrome/browser/native_ui_contents.cc +++ b/chrome/browser/native_ui_contents.cc @@ -25,8 +25,8 @@ #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; //static bool NativeUIContents::g_ui_factories_initialized = false; @@ -71,7 +71,7 @@ namespace { // NativeRootView is a trivial RootView subclass that allows URL drops and // forwards them to the NavigationController to open. -class NativeRootView : public ChromeViews::RootView { +class NativeRootView : public views::RootView { public: explicit NativeRootView(NativeUIContents* host) : RootView(host), @@ -83,7 +83,7 @@ class NativeRootView : public ChromeViews::RootView { return data.HasURL(); } - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event) { + virtual int OnDragUpdated(const views::DropTargetEvent& event) { if (event.GetSourceOperations() & DragDropTypes::DRAG_COPY) return DragDropTypes::DRAG_COPY; if (event.GetSourceOperations() & DragDropTypes::DRAG_LINK) @@ -91,7 +91,7 @@ class NativeRootView : public ChromeViews::RootView { return DragDropTypes::DRAG_NONE; } - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event) { + virtual int OnPerformDrop(const views::DropTargetEvent& event) { GURL url; std::wstring title; if (!event.GetData().GetURLAndTitle(&url, &title) || !url.is_valid()) @@ -137,7 +137,7 @@ NativeUIContents::NativeUIContents(Profile* profile) NativeUIContents::~NativeUIContents() { if (current_ui_) { - ChromeViews::RootView* root_view = GetRootView(); + views::RootView* root_view = GetRootView(); current_ui_->WillBecomeInvisible(this); root_view->RemoveChildView(current_view_); current_ui_ = NULL; @@ -163,13 +163,13 @@ LRESULT NativeUIContents::OnCreate(LPCREATESTRUCT create_struct) { tmp.left = tmp.top = 0; // Install the focus manager so we get notified of Tab key events. - ChromeViews::FocusManager::InstallFocusSubclass(GetHWND(), NULL); + views::FocusManager::InstallFocusSubclass(GetHWND(), NULL); GetRootView()->SetBackground(new NativeUIBackground); return 0; } void NativeUIContents::OnDestroy() { - ChromeViews::FocusManager::UninstallFocusSubclass(GetHWND()); + views::FocusManager::UninstallFocusSubclass(GetHWND()); } void NativeUIContents::OnSize(UINT size_command, const CSize& new_size) { @@ -224,7 +224,7 @@ void NativeUIContents::SetPageState(PageState* page_state) { } bool NativeUIContents::NavigateToPendingEntry(bool reload) { - ChromeViews::RootView* root_view = GetRootView(); + views::RootView* root_view = GetRootView(); DCHECK(root_view); if (current_ui_) { @@ -284,7 +284,7 @@ bool NativeUIContents::NavigateToPendingEntry(bool reload) { void NativeUIContents::Layout() { if (current_view_) { - ChromeViews::RootView* root_view = GetRootView(); + views::RootView* root_view = GetRootView(); current_view_->SetBounds(0, 0, root_view->width(), root_view->height()); current_view_->Layout(); @@ -332,11 +332,11 @@ void NativeUIContents::SetIsLoading(bool is_loading, } // FocusTraversable Implementation -ChromeViews::View* NativeUIContents::FindNextFocusableView( - ChromeViews::View* starting_view, bool reverse, - ChromeViews::FocusTraversable::Direction direction, bool dont_loop, - ChromeViews::FocusTraversable** focus_traversable, - ChromeViews::View** focus_traversable_view) { +views::View* NativeUIContents::FindNextFocusableView( + views::View* starting_view, bool reverse, + views::FocusTraversable::Direction direction, bool dont_loop, + views::FocusTraversable** focus_traversable, + views::View** focus_traversable_view) { return GetRootView()->FindNextFocusableView( starting_view, reverse, direction, dont_loop, focus_traversable, focus_traversable_view); @@ -383,7 +383,7 @@ void NativeUIContents::RegisterNativeUIFactory(const GURL& url, (*g_path_to_factory)[key] = factory; } -ChromeViews::RootView* NativeUIContents::CreateRootView() { +views::RootView* NativeUIContents::CreateRootView() { return new NativeRootView(this); } @@ -428,7 +428,7 @@ NativeUIBackground::~NativeUIBackground() { } void NativeUIBackground::Paint(ChromeCanvas* canvas, - ChromeViews::View* view) const { + views::View* view) const { static const SkColor kBackground = SkColorSetRGB(255, 255, 255); canvas->FillRectInt(kBackground, 0, 0, view->width(), view->height()); } @@ -442,7 +442,7 @@ void NativeUIBackground::Paint(ChromeCanvas* canvas, // only for native controls to be able to get query the background // brush. -class SearchableUIBackground : public ChromeViews::Background { +class SearchableUIBackground : public views::Background { public: explicit SearchableUIBackground(SkColor native_control_color) { SetNativeControlColor(native_control_color); @@ -451,7 +451,7 @@ class SearchableUIBackground : public ChromeViews::Background { // Empty implementation. // The actual painting of the bar happens in SearchableUIContainer::Paint. - virtual void Paint(ChromeCanvas* canvas, ChromeViews::View* view) const { } + virtual void Paint(ChromeCanvas* canvas, views::View* view) const { } private: DISALLOW_EVIL_CONSTRUCTORS(SearchableUIBackground); @@ -470,15 +470,15 @@ SearchableUIContainer::SearchableUIContainer( title_link_(NULL), title_image_(NULL), scroll_view_(NULL) { - title_link_ = new ChromeViews::Link; + title_link_ = new views::Link; ResourceBundle& resource_bundle = ResourceBundle::GetSharedInstance(); ChromeFont title_font(resource_bundle .GetFont(ResourceBundle::WebFont).DeriveFont(2)); title_link_->SetFont(title_font); - title_link_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + title_link_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_link_->SetController(this); - title_image_ = new ChromeViews::ImageView(); + title_image_ = new views::ImageView(); title_image_->SetVisible(false); // Get the product logo @@ -486,23 +486,23 @@ SearchableUIContainer::SearchableUIContainer( kProductLogo = resource_bundle.GetBitmapNamed(IDR_PRODUCT_LOGO); } - product_logo_ = new ChromeViews::ImageView(); + product_logo_ = new views::ImageView(); product_logo_->SetVisible(true); product_logo_->SetImage(*kProductLogo); AddChildView(product_logo_); - search_field_ = new ChromeViews::TextField; + search_field_ = new views::TextField; search_field_->SetFont(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::WebFont)); search_field_->SetController(this); - scroll_view_ = new ChromeViews::ScrollView; - scroll_view_->SetBackground(ChromeViews::Background::CreateSolidBackground(kBackground)); + scroll_view_ = new views::ScrollView; + scroll_view_->SetBackground(views::Background::CreateSolidBackground(kBackground)); // Set background class so that native controls can get a color. SetBackground(new SearchableUIBackground(kBackground)); - throbber_ = new ChromeViews::SmoothedThrobber(50); + throbber_ = new views::SmoothedThrobber(50); GridLayout* layout = new GridLayout(this); // View owns the LayoutManager and will delete it along with all the columns @@ -510,7 +510,7 @@ SearchableUIContainer::SearchableUIContainer( SetLayoutManager(layout); search_button_ = - new ChromeViews::NativeButton(std::wstring()); + new views::NativeButton(std::wstring()); search_button_->SetFont(resource_bundle.GetFont(ResourceBundle::WebFont)); search_button_->SetListener(this); @@ -571,7 +571,7 @@ SearchableUIContainer::SearchableUIContainer( SearchableUIContainer::~SearchableUIContainer() { } -void SearchableUIContainer::SetContents(ChromeViews::View* contents) { +void SearchableUIContainer::SetContents(views::View* contents) { // The column view will resize to accomodate long titles. title_link_->SetText(delegate_->GetTitle()); @@ -586,7 +586,7 @@ void SearchableUIContainer::SetContents(ChromeViews::View* contents) { scroll_view_->SetContents(contents); } -ChromeViews::View* SearchableUIContainer::GetContents() { +views::View* SearchableUIContainer::GetContents() { return scroll_view_->GetContents(); } @@ -622,11 +622,11 @@ void SearchableUIContainer::Paint(ChromeCanvas* canvas) { 0, scroll_view_->y() - 1, width(), 1); } -ChromeViews::TextField* SearchableUIContainer::GetSearchField() const { +views::TextField* SearchableUIContainer::GetSearchField() const { return search_field_; } -ChromeViews::ScrollView* SearchableUIContainer::GetScrollView() const { +views::ScrollView* SearchableUIContainer::GetScrollView() const { return scroll_view_; } @@ -643,11 +643,11 @@ void SearchableUIContainer::StopThrobber() { throbber_->Stop(); } -void SearchableUIContainer::ButtonPressed(ChromeViews::NativeButton* sender) { +void SearchableUIContainer::ButtonPressed(views::NativeButton* sender) { DoSearch(); } -void SearchableUIContainer::LinkActivated(ChromeViews::Link *link, +void SearchableUIContainer::LinkActivated(views::Link *link, int event_flags) { if (link == title_link_) { search_field_->SetText(std::wstring()); @@ -655,7 +655,7 @@ void SearchableUIContainer::LinkActivated(ChromeViews::Link *link, } } -void SearchableUIContainer::HandleKeystroke(ChromeViews::TextField* sender, +void SearchableUIContainer::HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, diff --git a/chrome/browser/native_ui_contents.h b/chrome/browser/native_ui_contents.h index d333fcf..58e8283 100644 --- a/chrome/browser/native_ui_contents.h +++ b/chrome/browser/native_ui_contents.h @@ -13,7 +13,7 @@ #include "chrome/views/native_button.h" #include "chrome/views/text_field.h" -namespace ChromeViews { +namespace views { class CheckBox; class FocusTraversable; class ScrollView; @@ -33,7 +33,7 @@ class NativeUI; // //////////////////////////////////////////////////////////////////////////////// class NativeUIContents : public TabContents, - public ChromeViews::ContainerWin { + public views::ContainerWin { public: explicit NativeUIContents(Profile* profile); @@ -64,14 +64,14 @@ class NativeUIContents : public TabContents, void SetIsLoading(bool is_loading, LoadNotificationDetails* details); // FocusTraversable Implementation - virtual ChromeViews::View* FindNextFocusableView( - ChromeViews::View* starting_view, + virtual views::View* FindNextFocusableView( + views::View* starting_view, bool reverse, - ChromeViews::FocusTraversable::Direction direction, + views::FocusTraversable::Direction direction, bool dont_loop, - ChromeViews::FocusTraversable** focus_traversable, - ChromeViews::View** focus_traversable_view); - virtual ChromeViews::RootView* GetContentsRootView() { return GetRootView(); } + views::FocusTraversable** focus_traversable, + views::View** focus_traversable_view); + virtual views::RootView* GetContentsRootView() { return GetRootView(); } // Return the scheme used. We currently use nativeui: static std::string GetScheme(); @@ -85,7 +85,7 @@ class NativeUIContents : public TabContents, virtual ~NativeUIContents(); // Overridden to create a view that that handles drag and drop. - virtual ChromeViews::RootView* CreateRootView(); + virtual views::RootView* CreateRootView(); private: // Initialize the factories. This is called the first time a NativeUIContents @@ -126,7 +126,7 @@ class NativeUIContents : public TabContents, // The current view for the current UI. We don't ask again just in case the // UI implementation keeps allocating new uis. - ChromeViews::View* current_view_; + views::View* current_view_; // The current page state for the native contents. scoped_ptr<PageState> state_; @@ -154,7 +154,7 @@ class NativeUI { virtual const int GetFavIconID () const = 0; // Return the view that should be used to render this user interface. - virtual ChromeViews::View* GetView() = 0; + virtual views::View* GetView() = 0; // Inform the view that it is about to become visible. virtual void WillBecomeVisible(NativeUIContents* parent) = 0; @@ -200,12 +200,12 @@ class NativeUIFactory { // A standard background for native UIs. // //////////////////////////////////////////////////////////////////////////////// -class NativeUIBackground : public ChromeViews::Background { +class NativeUIBackground : public views::Background { public: NativeUIBackground(); virtual ~NativeUIBackground(); - virtual void Paint(ChromeCanvas* canvas, ChromeViews::View* view) const; + virtual void Paint(ChromeCanvas* canvas, views::View* view) const; private: @@ -219,10 +219,10 @@ class NativeUIBackground : public ChromeViews::Background { // implements a consistent look for these UIs. // //////////////////////////////////////////////////////////////////////////////// -class SearchableUIContainer : public ChromeViews::View, - public ChromeViews::NativeButton::Listener, - public ChromeViews::LinkController, - public ChromeViews::TextField::Controller { +class SearchableUIContainer : public views::View, + public views::NativeButton::Listener, + public views::LinkController, + public views::TextField::Controller { public: // The Delegate is notified when the user clicks the search button. class Delegate { @@ -239,8 +239,8 @@ class SearchableUIContainer : public ChromeViews::View, virtual ~SearchableUIContainer(); // Add the view as the contents of the container. - void SetContents(ChromeViews::View* contents); - ChromeViews::View* GetContents(); + void SetContents(views::View* contents); + views::View* GetContents(); virtual void Layout(); @@ -248,8 +248,8 @@ class SearchableUIContainer : public ChromeViews::View, virtual void Paint(ChromeCanvas* canvas); // Provide the mode access to various UI elements. - ChromeViews::TextField* GetSearchField() const; - ChromeViews::ScrollView* GetScrollView() const; + views::TextField* GetSearchField() const; + views::ScrollView* GetScrollView() const; // Enable/disable the search text-field/button. void SetSearchEnabled(bool enabled); @@ -260,14 +260,14 @@ class SearchableUIContainer : public ChromeViews::View, private: // Invoked when the user presses the search button. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // TextField method, does nothing. - virtual void ContentsChanged(ChromeViews::TextField* sender, + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents) {} // Textfield method, if key is the return key the search is updated. - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, @@ -276,16 +276,16 @@ class SearchableUIContainer : public ChromeViews::View, // Notifies the delegate to update the search. void DoSearch(); - void LinkActivated(ChromeViews::Link* link, int event_flags); + void LinkActivated(views::Link* link, int event_flags); Delegate* delegate_; - ChromeViews::Link* title_link_; - ChromeViews::ImageView* title_image_; - ChromeViews::ImageView* product_logo_; - ChromeViews::TextField* search_field_; - ChromeViews::NativeButton* search_button_; - ChromeViews::ScrollView* scroll_view_; - ChromeViews::Throbber* throbber_; + views::Link* title_link_; + views::ImageView* title_image_; + views::ImageView* product_logo_; + views::TextField* search_field_; + views::NativeButton* search_button_; + views::ScrollView* scroll_view_; + views::Throbber* throbber_; DISALLOW_EVIL_CONSTRUCTORS(SearchableUIContainer); }; diff --git a/chrome/browser/password_manager.h b/chrome/browser/password_manager.h index 584f80c..7c0613b 100644 --- a/chrome/browser/password_manager.h +++ b/chrome/browser/password_manager.h @@ -21,7 +21,7 @@ class WebContents; // receiving password form data from the renderer and managing the password // database through the WebDataService. The PasswordManager is a LoginModel // for purposes of supporting HTTP authentication dialogs. -class PasswordManager : public ChromeViews::LoginModel { +class PasswordManager : public views::LoginModel { public: static void RegisterUserPrefs(PrefService* prefs); @@ -55,7 +55,7 @@ class PasswordManager : public ChromeViews::LoginModel { void ProvisionallySavePassword(PasswordForm form); // LoginModel implementation. - virtual void SetObserver(ChromeViews::LoginModelObserver* observer) { + virtual void SetObserver(views::LoginModelObserver* observer) { observer_ = observer; } @@ -105,7 +105,7 @@ class PasswordManager : public ChromeViews::LoginModel { WebContents* web_contents_; // The LoginModelObserver (i.e LoginView) requiring autofill. - ChromeViews::LoginModelObserver* observer_; + views::LoginModelObserver* observer_; // Set to false to disable the password manager (will no longer fill // passwords or ask you if you want to save passwords). diff --git a/chrome/browser/render_view_context_menu_controller.cc b/chrome/browser/render_view_context_menu_controller.cc index 98eaf85..b8eb31f 100644 --- a/chrome/browser/render_view_context_menu_controller.cc +++ b/chrome/browser/render_view_context_menu_controller.cc @@ -184,33 +184,34 @@ bool RenderViewContextMenuController::IsCommandEnabled(int id) const { } } -bool RenderViewContextMenuController::GetAcceleratorInfo(int id, - ChromeViews::Accelerator* accel) { +bool RenderViewContextMenuController::GetAcceleratorInfo( + int id, + views::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 (id) { case IDS_CONTENT_CONTEXT_UNDO: - *accel = ChromeViews::Accelerator(L'Z', false, true, false); + *accel = views::Accelerator(L'Z', false, true, false); return true; case IDS_CONTENT_CONTEXT_REDO: - *accel = ChromeViews::Accelerator(L'Z', true, true, false); + *accel = views::Accelerator(L'Z', true, true, false); return true; case IDS_CONTENT_CONTEXT_CUT: - *accel = ChromeViews::Accelerator(L'X', false, true, false); + *accel = views::Accelerator(L'X', false, true, false); return true; case IDS_CONTENT_CONTEXT_COPY: - *accel = ChromeViews::Accelerator(L'C', false, true, false); + *accel = views::Accelerator(L'C', false, true, false); return true; case IDS_CONTENT_CONTEXT_PASTE: - *accel = ChromeViews::Accelerator(L'V', false, true, false); + *accel = views::Accelerator(L'V', false, true, false); return true; case IDS_CONTENT_CONTEXT_SELECTALL: - *accel = ChromeViews::Accelerator(L'A', false, true, false); + *accel = views::Accelerator(L'A', false, true, false); default: return false; diff --git a/chrome/browser/render_view_context_menu_controller.h b/chrome/browser/render_view_context_menu_controller.h index 59f44c0..c742b82 100644 --- a/chrome/browser/render_view_context_menu_controller.h +++ b/chrome/browser/render_view_context_menu_controller.h @@ -20,7 +20,7 @@ class RenderViewContextMenuController : public Menu::Delegate { virtual std::wstring GetLabel(int id) const; virtual bool IsCommandEnabled(int id) const; virtual void ExecuteCommand(int id); - virtual bool GetAcceleratorInfo(int id, ChromeViews::Accelerator* accel); + virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); private: // Opens the specified URL string in a new tab. If |in_current_window| is diff --git a/chrome/browser/render_view_host.h b/chrome/browser/render_view_host.h index c0ebefe..98b045a 100644 --- a/chrome/browser/render_view_host.h +++ b/chrome/browser/render_view_host.h @@ -57,7 +57,7 @@ struct WebApplicationInfo; // // The intent of this class is to provide a view-agnostic communication // conduit with a renderer. This is so we can build HTML views not only as -// TabContents (see WebContents for an example) but also as ChromeViews, etc. +// TabContents (see WebContents for an example) but also as views, etc. // // The exact API of this object needs to be more thoroughly designed. Right // now it mimics what WebContents exposed, which is a fairly large API and may diff --git a/chrome/browser/render_widget_host_view_win.cc b/chrome/browser/render_widget_host_view_win.cc index d32e658..db70018 100644 --- a/chrome/browser/render_widget_host_view_win.cc +++ b/chrome/browser/render_widget_host_view_win.cc @@ -21,8 +21,7 @@ #include "chrome/common/l10n_util.h" #include "chrome/common/plugin_messages.h" #include "chrome/common/win_util.h" -// Included for ChromeViews::kReflectedMessage - TODO(beng): move this to -// win_util.h! +// Included for views::kReflectedMessage - TODO(beng): move this to win_util.h! #include "chrome/views/container_win.h" #include "webkit/glue/webcursor.h" @@ -163,8 +162,8 @@ void RenderWidgetHostViewWin::Focus() { } void RenderWidgetHostViewWin::Blur() { - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetParent()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetParent()); // We don't have a FocusManager if we are hidden. if (focus_manager && render_widget_host_->CanBlur()) focus_manager->ClearFocus(); @@ -735,7 +734,7 @@ LRESULT RenderWidgetHostViewWin::OnWheelEvent(UINT message, WPARAM wparam, new_message.lParam = lparam; handled_by_webcontents = - !!::SendMessage(GetParent(), ChromeViews::kReflectedMessage, 0, + !!::SendMessage(GetParent(), views::kReflectedMessage, 0, reinterpret_cast<LPARAM>(&new_message)); } diff --git a/chrome/browser/repost_form_warning_dialog.cc b/chrome/browser/repost_form_warning_dialog.cc index 5dfb12c..e3c6b97 100644 --- a/chrome/browser/repost_form_warning_dialog.cc +++ b/chrome/browser/repost_form_warning_dialog.cc @@ -30,7 +30,7 @@ RepostFormWarningDialog::~RepostFormWarningDialog() { } ////////////////////////////////////////////////////////////////////////////// -// RepostFormWarningDialog, ChromeViews::DialogDelegate implementation: +// RepostFormWarningDialog, views::DialogDelegate implementation: std::wstring RepostFormWarningDialog::GetWindowTitle() const { return l10n_util::GetString(IDS_HTTP_POST_WARNING_TITLE); @@ -60,9 +60,9 @@ bool RepostFormWarningDialog::Accept() { } /////////////////////////////////////////////////////////////////////////////// -// RepostFormWarningDialog, ChromeViews::WindowDelegate implementation: +// RepostFormWarningDialog, views::WindowDelegate implementation: -ChromeViews::View* RepostFormWarningDialog::GetContentsView() { +views::View* RepostFormWarningDialog::GetContentsView() { return message_box_view_; } @@ -80,7 +80,7 @@ RepostFormWarningDialog::RepostFormWarningDialog( HWND root_hwnd = NULL; if (BrowserList::GetLastActive()) root_hwnd = BrowserList::GetLastActive()->GetTopLevelHWND(); - ChromeViews::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this)->Show(); + views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this)->Show(); NotificationService::current()-> AddObserver(this, NOTIFY_LOAD_START, NotificationService::AllSources()); NotificationService::current()-> diff --git a/chrome/browser/repost_form_warning_dialog.h b/chrome/browser/repost_form_warning_dialog.h index 82000a4..8aeba7b 100644 --- a/chrome/browser/repost_form_warning_dialog.h +++ b/chrome/browser/repost_form_warning_dialog.h @@ -10,11 +10,11 @@ class MessageBoxView; class NavigationController; -namespace ChromeViews { +namespace views { class Window; } -class RepostFormWarningDialog : public ChromeViews::DialogDelegate, +class RepostFormWarningDialog : public views::DialogDelegate, public NotificationObserver { public: // Creates and runs a message box which asks the user if they want to resend @@ -23,16 +23,16 @@ class RepostFormWarningDialog : public ChromeViews::DialogDelegate, NavigationController* navigation_controller); virtual ~RepostFormWarningDialog(); - // ChromeViews::DialogDelegate Methods: + // views::DialogDelegate Methods: virtual std::wstring GetWindowTitle() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual void WindowClosing(); virtual bool Cancel(); virtual bool Accept(); - // ChromeViews::WindowDelegate Methods: + // views::WindowDelegate Methods: virtual bool IsModal() const { return true; } - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: // Use RunRepostFormWarningDialog to use. diff --git a/chrome/browser/ssl_manager.cc b/chrome/browser/ssl_manager.cc index d30dfc3..08ab798 100644 --- a/chrome/browser/ssl_manager.cc +++ b/chrome/browser/ssl_manager.cc @@ -46,16 +46,16 @@ SSLManager::SSLInfoBar::SSLInfoBar(SSLManager* manager, task_(task) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); if (!message.empty()) { - label_ = new ChromeViews::Label(message); + label_ = new views::Label(message); label_->SetFont(rb.GetFont(ResourceBundle::MediumFont)); - label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildViewLeading(label_); } if (!link_text.empty()) { DCHECK(task) << L"Link and no task"; // What do you want to do when users // click the link?? - link_ = new ChromeViews::Link(link_text); + link_ = new views::Link(link_text); link_->SetFont(rb.GetFont(ResourceBundle::MediumFont)); link_->SetController(this); AddChildViewTrailing(link_); @@ -77,7 +77,7 @@ const std::wstring SSLManager::SSLInfoBar::GetMessageText() const { return label_->GetText(); } -void SSLManager::SSLInfoBar::LinkActivated(ChromeViews::Link* source, +void SSLManager::SSLInfoBar::LinkActivated(views::Link* source, int event_flags) { if (task_.get()) { task_->Run(); diff --git a/chrome/browser/ssl_manager.h b/chrome/browser/ssl_manager.h index a5f466f..adf58f3 100644 --- a/chrome/browser/ssl_manager.h +++ b/chrome/browser/ssl_manager.h @@ -265,7 +265,7 @@ class SSLManager : public NotificationObserver { // An info bar with a message and an optional link that runs a task when // clicked. class SSLInfoBar : public InfoBarItemView, - public ChromeViews::LinkController { + public views::LinkController { public: SSLInfoBar(SSLManager* manager, const std::wstring& message, @@ -276,12 +276,12 @@ class SSLManager : public NotificationObserver { const std::wstring GetMessageText() const; - // ChromeViews::LinkController method. - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + // views::LinkController method. + virtual void LinkActivated(views::Link* source, int event_flags); private: - ChromeViews::Label* label_; - ChromeViews::Link* link_; + views::Label* label_; + views::Link* link_; SSLManager* manager_; scoped_ptr<Task> task_; diff --git a/chrome/browser/status_view.h b/chrome/browser/status_view.h index 7fe6018..7cdeec8 100644 --- a/chrome/browser/status_view.h +++ b/chrome/browser/status_view.h @@ -60,8 +60,8 @@ class StatusView : public TabContents, private: // FocusTraversal Implementation // TODO (jcampan): make focus traversal work - ChromeViews::View* FindNextFocusableView(ChromeViews::View* starting_view, - bool reverse, bool dont_loop) { + views::View* FindNextFocusableView(views::View* starting_view, bool reverse, + bool dont_loop) { return NULL; } diff --git a/chrome/browser/tab_contents.cc b/chrome/browser/tab_contents.cc index 77a55f7..fcd2b93 100644 --- a/chrome/browser/tab_contents.cc +++ b/chrome/browser/tab_contents.cc @@ -47,7 +47,7 @@ TabContents::TabContents(TabContentsType type) max_page_id_(-1), capturing_contents_(false) { last_focused_view_storage_id_ = - ChromeViews::ViewStorage::GetSharedInstance()->CreateStorageID(); + views::ViewStorage::GetSharedInstance()->CreateStorageID(); } TabContents::~TabContents() { @@ -55,8 +55,7 @@ TabContents::~TabContents() { // // It is possible the view went away before us, so we only do this if the // view is registered. - ChromeViews::ViewStorage* view_storage = - ChromeViews::ViewStorage::GetSharedInstance(); + views::ViewStorage* view_storage = views::ViewStorage::GetSharedInstance(); if (view_storage->RetrieveView(last_focused_view_storage_id_) != NULL) view_storage->RemoveView(last_focused_view_storage_id_); } @@ -260,8 +259,8 @@ bool TabContents::NavigateToPendingEntry(bool reload) { } ConstrainedWindow* TabContents::CreateConstrainedDialog( - ChromeViews::WindowDelegate* window_delegate, - ChromeViews::View* contents_view) { + views::WindowDelegate* window_delegate, + views::View* contents_view) { ConstrainedWindow* window = ConstrainedWindow::CreateConstrainedDialog( this, gfx::Rect(), contents_view, window_delegate); @@ -326,16 +325,16 @@ void TabContents::HideContents() { SetParent(GetContainerHWND(), NULL); // Remove any focus manager related information. - ChromeViews::FocusManager::UninstallFocusSubclass(GetContainerHWND()); + views::FocusManager::UninstallFocusSubclass(GetContainerHWND()); WasHidden(); } void TabContents::Focus() { - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainerHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainerHWND()); DCHECK(focus_manager); - ChromeViews::View* v = + views::View* v = focus_manager->GetViewForWindow(GetContainerHWND(), true); DCHECK(v); if (v) @@ -343,18 +342,18 @@ void TabContents::Focus() { } void TabContents::StoreFocus() { - ChromeViews::ViewStorage* view_storage = - ChromeViews::ViewStorage::GetSharedInstance(); + views::ViewStorage* view_storage = + views::ViewStorage::GetSharedInstance(); if (view_storage->RetrieveView(last_focused_view_storage_id_) != NULL) view_storage->RemoveView(last_focused_view_storage_id_); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainerHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainerHWND()); if (focus_manager) { // |focus_manager| can be NULL if the tab has been detached but still // exists. - ChromeViews::View* focused_view = focus_manager->GetFocusedView(); + views::View* focused_view = focus_manager->GetFocusedView(); if (focused_view) view_storage->StoreView(last_focused_view_storage_id_, focused_view); @@ -363,7 +362,7 @@ void TabContents::StoreFocus() { // TODO(brettw) this should move to the view somehow. HWND container_hwnd = GetContainerHWND(); if (container_hwnd) { - ChromeViews::View* focused_view = focus_manager->GetFocusedView(); + views::View* focused_view = focus_manager->GetFocusedView(); if (focused_view) { HWND hwnd = focused_view->GetRootView()->GetContainer()->GetHWND(); if (container_hwnd == hwnd || ::IsChild(container_hwnd, hwnd)) @@ -374,16 +373,16 @@ void TabContents::StoreFocus() { } void TabContents::RestoreFocus() { - ChromeViews::ViewStorage* view_storage = - ChromeViews::ViewStorage::GetSharedInstance(); - ChromeViews::View* last_focused_view = + views::ViewStorage* view_storage = + views::ViewStorage::GetSharedInstance(); + views::View* last_focused_view = view_storage->RetrieveView(last_focused_view_storage_id_); if (!last_focused_view) { SetInitialFocus(); } else { - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainerHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainerHWND()); // If you hit this DCHECK, please report it to Jay (jcampan). DCHECK(focus_manager != NULL) << "No focus manager when restoring focus."; @@ -547,7 +546,7 @@ void TabContents::RepositionSupressedPopupsToFit(const gfx::Size& new_size) { // http://b/1118139. gfx::Point anchor_position( new_size.width() - - ChromeViews::NativeScrollBar::GetVerticalScrollBarWidth(), + views::NativeScrollBar::GetVerticalScrollBarWidth(), new_size.height()); int window_count = static_cast<int>(child_windows_.size()); for (int i = window_count - 1; i >= 0; --i) { diff --git a/chrome/browser/tab_contents.h b/chrome/browser/tab_contents.h index fc6fa04..99daf5d 100644 --- a/chrome/browser/tab_contents.h +++ b/chrome/browser/tab_contents.h @@ -19,6 +19,9 @@ namespace gfx { class Rect; class Size; } +namespace views { +class WindowDelegate; +} class DOMUIHost; class DownloadItem; @@ -319,8 +322,8 @@ class TabContents : public PageNavigator, // is sized according to the preferred size of the content_view, and centered // within the contents. ConstrainedWindow* CreateConstrainedDialog( - ChromeViews::WindowDelegate* window_delegate, - ChromeViews::View* contents_view); + views::WindowDelegate* window_delegate, + views::View* contents_view); // Adds a new tab or window with the given already-created contents void AddNewContents(TabContents* new_contents, @@ -403,7 +406,7 @@ class TabContents : public PageNavigator, // this returns NULL, the TabContents is supposed to know how to process TAB // key events and is just sent the key messages. If this returns a RootView, // the focus is passed to the RootView. - virtual ChromeViews::RootView* GetContentsRootView() { return NULL; } + virtual views::RootView* GetContentsRootView() { return NULL; } // Toolbars and such --------------------------------------------------------- diff --git a/chrome/browser/task_manager.cc b/chrome/browser/task_manager.cc index e08db35..93d21bc 100644 --- a/chrome/browser/task_manager.cc +++ b/chrome/browser/task_manager.cc @@ -216,7 +216,7 @@ SkBitmap TaskManagerTableModel::GetIcon(int row) { } void TaskManagerTableModel::GetGroupRangeForItem(int item, - ChromeViews::GroupRange* range) { + views::GroupRange* range) { DCHECK((item >= 0) && (item < RowCount())) << " invalid item "<< item << " (items count=" << RowCount() << ")"; @@ -476,8 +476,7 @@ void TaskManagerTableModel::Refresh() { kUpdateTimeMs); } -void TaskManagerTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { +void TaskManagerTableModel::SetObserver(views::TableModelObserver* observer) { observer_ = observer; } @@ -653,11 +652,11 @@ bool TaskManagerTableModel::GetProcessMetricsForRows( // //////////////////////////////////////////////////////////////////////////////// -class TaskManagerContents : public ChromeViews::View, - public ChromeViews::NativeButton::Listener, - public ChromeViews::TableViewObserver, - public ChromeViews::LinkController, - public ChromeViews::ContextMenuController, +class TaskManagerContents : public views::View, + public views::NativeButton::Listener, + public views::TableViewObserver, + public views::LinkController, + public views::ContextMenuController, public Menu::Delegate { public: TaskManagerContents(TaskManager* task_manager, @@ -667,28 +666,28 @@ class TaskManagerContents : public ChromeViews::View, void Init(TaskManagerTableModel* table_model); virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, - ChromeViews::View* child); + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); void GetSelection(std::vector<int>* selection); void GetFocused(std::vector<int>* focused); // NativeButton::Listener implementation. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::TableViewObserver implementation. + // views::TableViewObserver implementation. virtual void OnSelectionChanged(); virtual void OnDoubleClick(); virtual void OnKeyDown(unsigned short virtual_keycode); - // ChromeViews::LinkController implementation. - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + // views::LinkController implementation. + virtual void LinkActivated(views::Link* source, int event_flags); // Called by the column picker to pick up any new stat counters that // may have appeared since last time. void UpdateStatsCounters(); // Menu::Delegate - virtual void ShowContextMenu(ChromeViews::View* source, + virtual void ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture); @@ -696,14 +695,14 @@ class TaskManagerContents : public ChromeViews::View, virtual void ExecuteCommand(int id); private: - scoped_ptr<ChromeViews::NativeButton> kill_button_; - scoped_ptr<ChromeViews::Link> about_memory_link_; - ChromeViews::GroupTableView* tab_table_; + scoped_ptr<views::NativeButton> kill_button_; + scoped_ptr<views::Link> about_memory_link_; + views::GroupTableView* tab_table_; TaskManager* task_manager_; // all possible columns, not necessarily visible - std::vector<ChromeViews::TableColumn> columns_; + std::vector<views::TableColumn> columns_; DISALLOW_EVIL_CONSTRUCTORS(TaskManagerContents); }; @@ -718,46 +717,31 @@ TaskManagerContents::~TaskManagerContents() { } void TaskManagerContents::Init(TaskManagerTableModel* table_model) { - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_PAGE_COLUMN, - ChromeViews::TableColumn::LEFT, -1, 1)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_PAGE_COLUMN, + views::TableColumn::LEFT, -1, 1)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_PHYSICAL_MEM_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_SHARED_MEM_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_SHARED_MEM_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_CPU_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_CPU_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_NET_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_NET_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - columns_.push_back( - ChromeViews::TableColumn( - IDS_TASK_MANAGER_PROCESS_ID_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0)); + columns_.push_back(views::TableColumn(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, + views::TableColumn::RIGHT, -1, 0)); columns_.back().sortable = true; - tab_table_ = new ChromeViews::GroupTableView(table_model, - columns_, - ChromeViews::ICON_AND_TEXT, - false, true, true); + tab_table_ = new views::GroupTableView(table_model, columns_, + views::ICON_AND_TEXT, false, true, + true); // Hide some columns by default tab_table_->SetColumnVisibility(IDS_TASK_MANAGER_PROCESS_ID_COLUMN, false); @@ -765,17 +749,17 @@ void TaskManagerContents::Init(TaskManagerTableModel* table_model) { tab_table_->SetColumnVisibility(IDS_TASK_MANAGER_PRIVATE_MEM_COLUMN, false); UpdateStatsCounters(); - ChromeViews::TableColumn col(kGoatsTeleportedColumn, L"Goats Teleported", - ChromeViews::TableColumn::RIGHT, -1, 0); + views::TableColumn col(kGoatsTeleportedColumn, L"Goats Teleported", + views::TableColumn::RIGHT, -1, 0); col.sortable = true; columns_.push_back(col); tab_table_->AddColumn(col); tab_table_->SetObserver(this); SetContextMenuController(this); - kill_button_.reset(new ChromeViews::NativeButton( + kill_button_.reset(new views::NativeButton( l10n_util::GetString(IDS_TASK_MANAGER_KILL))); kill_button_->SetListener(this); - about_memory_link_.reset(new ChromeViews::Link( + about_memory_link_.reset(new views::Link( l10n_util::GetString(IDS_TASK_MANAGER_ABOUT_MEMORY_LINK))); about_memory_link_->SetController(this); @@ -798,8 +782,7 @@ void TaskManagerContents::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. - ChromeViews::TableColumn col(i, row, ChromeViews::TableColumn::RIGHT, - 90, 0); + views::TableColumn col(i, row, views::TableColumn::RIGHT, 90, 0); col.sortable = true; columns_.push_back(col); tab_table_->AddColumn(col); @@ -809,8 +792,8 @@ void TaskManagerContents::UpdateStatsCounters() { } void TaskManagerContents::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { // Since we want the Kill button and the Memory Details link to show up in // the same visual row as the close button, which is provided by the // framework, we must add the buttons to the non-client view, which is the @@ -871,7 +854,7 @@ gfx::Size TaskManagerContents::GetPreferredSize() { void TaskManagerContents::GetSelection(std::vector<int>* selection) { DCHECK(selection); - for (ChromeViews::TableSelectionIterator iter = tab_table_->SelectionBegin(); + for (views::TableSelectionIterator iter = tab_table_->SelectionBegin(); iter != tab_table_->SelectionEnd(); ++iter) { // The TableView returns the selection starting from the end. selection->insert(selection->begin(), *iter); @@ -889,12 +872,12 @@ void TaskManagerContents::GetFocused(std::vector<int>* focused) { } // NativeButton::Listener implementation. -void TaskManagerContents::ButtonPressed(ChromeViews::NativeButton* sender) { +void TaskManagerContents::ButtonPressed(views::NativeButton* sender) { if (sender == kill_button_) task_manager_->KillSelectedProcesses(); } -// ChromeViews::TableViewObserver implementation. +// views::TableViewObserver implementation. void TaskManagerContents::OnSelectionChanged() { kill_button_->SetEnabled(!task_manager_->BrowserProcessIsSelected() && tab_table_->SelectedRowCount() > 0); @@ -909,8 +892,8 @@ void TaskManagerContents::OnKeyDown(unsigned short virtual_keycode) { task_manager_->ActivateFocusedTab(); } -// ChromeViews::LinkController implementation -void TaskManagerContents::LinkActivated(ChromeViews::Link* source, +// views::LinkController implementation +void TaskManagerContents::LinkActivated(views::Link* source, int event_flags) { DCHECK(source == about_memory_link_); Browser* browser = BrowserList::GetLastActive(); @@ -919,13 +902,13 @@ void TaskManagerContents::LinkActivated(ChromeViews::Link* source, PageTransition::LINK); } -void TaskManagerContents::ShowContextMenu(ChromeViews::View* source, +void TaskManagerContents::ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture) { UpdateStatsCounters(); Menu menu(this, Menu::TOPLEFT, source->GetContainer()->GetHWND()); - for (std::vector<ChromeViews::TableColumn>::iterator i = + for (std::vector<views::TableColumn>::iterator i = columns_.begin(); i != columns_.end(); ++i) { menu.AppendMenuItem(i->id, i->title, Menu::CHECKBOX); } @@ -963,7 +946,7 @@ void TaskManager::Open() { if (task_manager->window()) { task_manager->window()->MoveToFront(true); } else { - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), task_manager); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), task_manager); task_manager->table_model_->StartUpdating(); task_manager->window()->Show(); } @@ -1102,7 +1085,7 @@ void TaskManager::WindowClosing() { ReleaseWindow(); } -ChromeViews::View* TaskManager::GetContentsView() { +views::View* TaskManager::GetContentsView() { return contents_.get(); } diff --git a/chrome/browser/task_manager.h b/chrome/browser/task_manager.h index 3fd3a06..eb288cc 100644 --- a/chrome/browser/task_manager.h +++ b/chrome/browser/task_manager.h @@ -31,7 +31,7 @@ class TaskManagerWindow; struct BytesReadParam; -namespace ChromeViews { +namespace views { class View; class Window; } @@ -41,7 +41,7 @@ class ProcessMetrics; } // This class is a singleton. -class TaskManager : public ChromeViews::DialogDelegate { +class TaskManager : public views::DialogDelegate { public: // A resource represents one row in the task manager. // Resources from similar processes are grouped together by the task manager. @@ -123,7 +123,7 @@ class TaskManager : public ChromeViews::DialogDelegate { void AddResource(Resource* resource); void RemoveResource(Resource* resource); - // ChromeViews::DialogDelegate methods: + // views::DialogDelegate methods: virtual bool CanResize() const; virtual bool CanMaximize() const; virtual bool ShouldShowWindowIcon() const; @@ -138,7 +138,7 @@ class TaskManager : public ChromeViews::DialogDelegate { bool* always_on_top); virtual int GetDialogButtons() const; virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: // Obtain an instance via GetInstance(). @@ -164,7 +164,7 @@ class TaskManager : public ChromeViews::DialogDelegate { }; // The model that the table is using. -class TaskManagerTableModel : public ChromeViews::GroupTableModel, +class TaskManagerTableModel : public views::GroupTableModel, public URLRequestJobTracker::JobObserver, public base::RefCounted<TaskManagerTableModel> { public: @@ -175,8 +175,8 @@ class TaskManagerTableModel : public ChromeViews::GroupTableModel, int RowCount(); std::wstring GetText(int row, int column); SkBitmap GetIcon(int row); - void GetGroupRangeForItem(int item, ChromeViews::GroupRange* range); - void SetObserver(ChromeViews::TableModelObserver* observer); + void GetGroupRangeForItem(int item, views::GroupRange* range); + void SetObserver(views::TableModelObserver* observer); virtual int CompareValues(int row1, int row2, int column_id); // Returns the index at the specified row. @@ -308,7 +308,7 @@ class TaskManagerTableModel : public ChromeViews::GroupTableModel, // A map that contains the CPU usage (in %) for a process since last refresh. CPUUsageMap cpu_usage_map_; - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; MessageLoop* ui_loop_; diff --git a/chrome/browser/views/about_chrome_view.cc b/chrome/browser/views/about_chrome_view.cc index d5627e5..f7e6b1b 100644 --- a/chrome/browser/views/about_chrome_view.cc +++ b/chrome/browser/views/about_chrome_view.cc @@ -85,7 +85,7 @@ void AboutChromeView::Init() { // Views we will add to the *parent* of this dialog, since it will display // next to the buttons which we don't draw ourselves. - throbber_.reset(new ChromeViews::Throbber(50, true)); + throbber_.reset(new views::Throbber(50, true)); throbber_->SetParentOwned(false); throbber_->SetVisible(false); @@ -108,7 +108,7 @@ void AboutChromeView::Init() { // image for the dialog. We have two different background bitmaps, one for // LTR UIs and one for RTL UIs. We load the correct bitmap based on the UI // layout of the view. - about_dlg_background_ = new ChromeViews::ImageView(); + about_dlg_background_ = new views::ImageView(); SkBitmap* about_background; if (UILayoutIsRightToLeft()) about_background = rb.GetBitmapNamed(IDR_ABOUT_BACKGROUND_RTL); @@ -119,14 +119,14 @@ void AboutChromeView::Init() { AddChildView(about_dlg_background_); // Add the dialog labels. - about_title_label_ = new ChromeViews::Label( + about_title_label_ = new views::Label( l10n_util::GetString(IDS_PRODUCT_NAME)); about_title_label_->SetFont(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::BaseFont).DeriveFont(18, BOLD_FONTTYPE)); AddChildView(about_title_label_); // This is a text field so people can copy the version number from the dialog. - version_label_ = new ChromeViews::TextField(); + version_label_ = new views::TextField(); version_label_->SetText(current_version_); version_label_->SetReadOnly(true); version_label_->RemoveBorder(); @@ -135,12 +135,12 @@ void AboutChromeView::Init() { AddChildView(version_label_); // The copyright URL portion of the main label. - copyright_label_ = new ChromeViews::Label( + copyright_label_ = new views::Label( l10n_util::GetString(IDS_ABOUT_VERSION_COPYRIGHT)); - copyright_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + copyright_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(copyright_label_); - main_text_label_ = new ChromeViews::Label(L""); + main_text_label_ = new views::Label(L""); // Figure out what to write in the main label of the About box. std::vector<size_t> url_offsets; @@ -157,13 +157,13 @@ void AboutChromeView::Init() { main_label_chunk3_ = text.substr(link2); // The Chromium link within the main text of the dialog. - chromium_url_ = new ChromeViews::Link( + chromium_url_ = new views::Link( l10n_util::GetString(IDS_OPEN_SOURCE_PROJECT_NAME)); AddChildView(chromium_url_); chromium_url_->SetController(this); // The Open Source link within the main text of the dialog. - open_source_url_ = new ChromeViews::Link( + open_source_url_ = new views::Link( l10n_util::GetString(IDS_ABOUT_OPEN_SOURCE_SOFTWARE)); AddChildView(open_source_url_); open_source_url_->SetController(this); @@ -180,17 +180,17 @@ void AboutChromeView::Init() { // The Terms of Service URL at the bottom. terms_of_service_url_ = - new ChromeViews::Link(l10n_util::GetString(IDS_TERMS_OF_SERVICE)); + new views::Link(l10n_util::GetString(IDS_TERMS_OF_SERVICE)); AddChildView(terms_of_service_url_); terms_of_service_url_->SetController(this); #endif } //////////////////////////////////////////////////////////////////////////////// -// AboutChromeView, ChromeViews::View implementation: +// AboutChromeView, views::View implementation: gfx::Size AboutChromeView::GetPreferredSize() { - gfx::Size prefsize(ChromeViews::Window::GetLocalizedContentsSize( + gfx::Size prefsize(views::Window::GetLocalizedContentsSize( IDS_ABOUT_DIALOG_WIDTH_CHARS, IDS_ABOUT_DIALOG_HEIGHT_LINES)); // We compute the height of the dialog based on the size of the image (it @@ -296,7 +296,7 @@ void AboutChromeView::Layout() { sz = update_label_.GetPreferredSize(); int update_label_x = throbber_->x() + throbber_->width() + kRelatedControlHorizontalSpacing; - update_label_.SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + update_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT); update_label_.SetBounds(update_label_x, throbber_topleft_y + 1, parent_bounds.width() - update_label_x, @@ -305,16 +305,16 @@ void AboutChromeView::Layout() { void AboutChromeView::Paint(ChromeCanvas* canvas) { - ChromeViews::View::Paint(canvas); + views::View::Paint(canvas); ChromeFont font = ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::BaseFont); const gfx::Rect label_bounds = main_text_label_->bounds(); - ChromeViews::Link* link1 = + views::Link* link1 = chromium_url_appears_first_ ? chromium_url_ : open_source_url_; - ChromeViews::Link* link2 = + views::Link* link2 = chromium_url_appears_first_ ? open_source_url_ : chromium_url_; gfx::Rect* rect1 = chromium_url_appears_first_ ? &chromium_url_rect_ : &open_source_url_rect_; @@ -355,7 +355,7 @@ void AboutChromeView::Paint(ChromeCanvas* canvas) { void AboutChromeView::DrawTextAndPositionUrl(ChromeCanvas* canvas, const std::wstring& text, - ChromeViews::Link* link, + views::Link* link, gfx::Rect* rect, gfx::Size* position, const gfx::Rect& bounds, @@ -433,8 +433,8 @@ void AboutChromeView::WrapIfWordDoesntFit(int word_width, } void AboutChromeView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { // Since we want the some of the controls to show up in the same visual row // as the buttons, which are provided by the framework, we must add the // buttons to the non-client view, which is the parent of this view. @@ -476,7 +476,7 @@ void AboutChromeView::ViewHierarchyChanged(bool is_add, } //////////////////////////////////////////////////////////////////////////////// -// AboutChromeView, ChromeViews::DialogDelegate implementation: +// AboutChromeView, views::DialogDelegate implementation: int AboutChromeView::GetDialogButtons() const { return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; @@ -549,14 +549,14 @@ bool AboutChromeView::Accept() { return false; // We never allow this button to close the window. } -ChromeViews::View* AboutChromeView::GetContentsView() { +views::View* AboutChromeView::GetContentsView() { return this; } //////////////////////////////////////////////////////////////////////////////// -// AboutChromeView, ChromeViews::LinkController implementation: +// AboutChromeView, views::LinkController implementation: -void AboutChromeView::LinkActivated(ChromeViews::Link* source, +void AboutChromeView::LinkActivated(views::Link* source, int event_flags) { GURL url; if (source == terms_of_service_url_) diff --git a/chrome/browser/views/about_chrome_view.h b/chrome/browser/views/about_chrome_view.h index eaa35c2..cc29f01 100644 --- a/chrome/browser/views/about_chrome_view.h +++ b/chrome/browser/views/about_chrome_view.h @@ -12,10 +12,10 @@ #include "chrome/views/link.h" #include "chrome/views/view.h" -namespace ChromeViews { - class TextField; - class Throbber; - class Window; +namespace views { +class TextField; +class Throbber; +class Window; } class Profile; @@ -27,9 +27,9 @@ class Profile; // and check for updates. // //////////////////////////////////////////////////////////////////////////////// -class AboutChromeView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::LinkController, +class AboutChromeView : public views::View, + public views::DialogDelegate, + public views::LinkController, public GoogleUpdateStatusListener { public: explicit AboutChromeView(Profile* profile); @@ -38,15 +38,15 @@ class AboutChromeView : public ChromeViews::View, // Initialize the controls on the dialog. void Init(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); virtual void Layout(); virtual void Paint(ChromeCanvas* canvas); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual int GetDialogButtons() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool IsDialogButtonEnabled(DialogButton button) const; @@ -58,10 +58,10 @@ class AboutChromeView : public ChromeViews::View, virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::LinkController: - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + // Overridden from views::LinkController: + virtual void LinkActivated(views::Link* source, int event_flags); // Overridden from GoogleUpdateStatusListener: virtual void OnReportResults(GoogleUpdateUpgradeResult result, @@ -93,7 +93,7 @@ class AboutChromeView : public ChromeViews::View, // character, which we need to position the URLs within the text. void DrawTextAndPositionUrl(ChromeCanvas* canvas, const std::wstring& text, - ChromeViews::Link* link, + views::Link* link, gfx::Rect* rect, gfx::Size* position, const gfx::Rect& bounds, @@ -119,31 +119,31 @@ class AboutChromeView : public ChromeViews::View, Profile* profile_; // UI elements on the dialog. - ChromeViews::ImageView* about_dlg_background_; - ChromeViews::Label* about_title_label_; - ChromeViews::TextField* version_label_; - ChromeViews::Label* copyright_label_; - ChromeViews::Label* main_text_label_; + views::ImageView* about_dlg_background_; + views::Label* about_title_label_; + views::TextField* version_label_; + views::Label* copyright_label_; + views::Label* main_text_label_; int main_text_label_height_; - ChromeViews::Link* chromium_url_; + views::Link* chromium_url_; gfx::Rect chromium_url_rect_; - ChromeViews::Link* open_source_url_; + views::Link* open_source_url_; gfx::Rect open_source_url_rect_; - ChromeViews::Link* terms_of_service_url_; + views::Link* terms_of_service_url_; gfx::Rect terms_of_service_url_rect_; // UI elements we add to the parent view. - scoped_ptr<ChromeViews::Throbber> throbber_; - ChromeViews::ImageView success_indicator_; - ChromeViews::ImageView update_available_indicator_; - ChromeViews::ImageView timeout_indicator_; - ChromeViews::Label update_label_; + scoped_ptr<views::Throbber> throbber_; + views::ImageView success_indicator_; + views::ImageView update_available_indicator_; + views::ImageView timeout_indicator_; + views::Label update_label_; // Keeps track of the visible state of the Check For Updates button. CheckButtonStatus check_button_status_; // The text to display as the main label of the About box. We draw this text // word for word with the help of the WordIterator, and make room for URLs - // which are drawn using ChromeViews::Link. See also |url_offsets_|. + // which are drawn using views::Link. See also |url_offsets_|. std::wstring main_label_chunk1_; std::wstring main_label_chunk2_; std::wstring main_label_chunk3_; diff --git a/chrome/browser/views/bookmark_bar_view.cc b/chrome/browser/views/bookmark_bar_view.cc index f3118b5..1ddf120 100644 --- a/chrome/browser/views/bookmark_bar_view.cc +++ b/chrome/browser/views/bookmark_bar_view.cc @@ -46,11 +46,11 @@ #include "chrome/views/window.h" #include "generated_resources.h" -using ChromeViews::BaseButton; -using ChromeViews::DropTargetEvent; -using ChromeViews::MenuButton; -using ChromeViews::MenuItemView; -using ChromeViews::View; +using views::BaseButton; +using views::DropTargetEvent; +using views::MenuButton; +using views::MenuItemView; +using views::View; // Margins around the content. static const int kTopMargin = 2; @@ -174,7 +174,7 @@ static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, const std::wstring& languages) { const gfx::Rect monitor_bounds = win_util::GetMonitorBoundsForRect( gfx::Rect(screen_loc.x(), screen_loc.y(), 1, 1)); - ChromeFont tt_font = ChromeViews::TooltipManager::GetDefaultFont(); + ChromeFont tt_font = views::TooltipManager::GetDefaultFont(); std::wstring result; // First the title. @@ -191,7 +191,7 @@ static std::wstring CreateToolTipForURLAndTitle(const gfx::Point& screen_loc, // Only show the URL if the url and title differ. if (title != UTF8ToWide(url.spec())) { if (!result.empty()) - result.append(ChromeViews::TooltipManager::GetLineSeparator()); + result.append(views::TooltipManager::GetLineSeparator()); // We need to explicitly specify the directionality of the URL's text to // make sure it is treated as an LTR string when the context is RTL. For @@ -223,7 +223,7 @@ static int GetDragOperationsForNode(BookmarkNode* node) { // Buttons used for the bookmarks on the bookmark bar. -class BookmarkButton : public ChromeViews::TextButton { +class BookmarkButton : public views::TextButton { public: BookmarkButton(const GURL& url, const std::wstring& title, @@ -250,17 +250,17 @@ class BookmarkButton : public ChromeViews::TextButton { return !tooltip->empty(); } - virtual bool IsTriggerableEvent(const ChromeViews::MouseEvent& e) { + virtual bool IsTriggerableEvent(const views::MouseEvent& e) { return event_utils::IsPossibleDispositionEvent(e); } virtual void Paint(ChromeCanvas *canvas) { - ChromeViews::TextButton::Paint(canvas); + views::TextButton::Paint(canvas); PaintAnimation(this, canvas, show_animation_->GetCurrentValue()); } - static void PaintAnimation(ChromeViews::View* view, + static void PaintAnimation(views::View* view, ChromeCanvas* canvas, double animation_value) { // Since we can't change the alpha of the button (it contains un-alphable @@ -290,10 +290,10 @@ class BookmarkButton : public ChromeViews::TextButton { // Buttons used for folders on the bookmark bar, including the 'other folders' // button. -class BookmarkFolderButton : public ChromeViews::MenuButton { +class BookmarkFolderButton : public views::MenuButton { public: BookmarkFolderButton(const std::wstring& title, - ChromeViews::ViewMenuDelegate* menu_delegate, + views::ViewMenuDelegate* menu_delegate, bool show_menu_marker) : MenuButton(title, menu_delegate, show_menu_marker) { show_animation_.reset(new SlideAnimation(this)); @@ -306,14 +306,14 @@ class BookmarkFolderButton : public ChromeViews::MenuButton { } } - virtual bool IsTriggerableEvent(const ChromeViews::MouseEvent& e) { + virtual bool IsTriggerableEvent(const views::MouseEvent& e) { // This is hard coded to avoid potential notification on left mouse down, // which we want to show the menu. return e.IsMiddleMouseButton(); } virtual void Paint(ChromeCanvas *canvas) { - ChromeViews::MenuButton::Paint(canvas, false); + views::MenuButton::Paint(canvas, false); BookmarkButton::PaintAnimation(this, canvas, show_animation_->GetCurrentValue()); @@ -368,7 +368,7 @@ struct DropInfo { // MenuRunner is used to show the contents of bookmark folders on the // bookmark bar, other folder, or overflow bookmarks. // -class MenuRunner : public ChromeViews::MenuDelegate, +class MenuRunner : public views::MenuDelegate, public BookmarkBarView::ModelChangedListener { public: // start_child_index is the index of the first child in node to add to the @@ -455,7 +455,7 @@ class MenuRunner : public ChromeViews::MenuDelegate, // ViewMenuDelegate method. Overridden to forward to the PageNavigator so // that we accept any events that may trigger opening a url. - virtual bool IsTriggerableEvent(const ChromeViews::MouseEvent& e) { + virtual bool IsTriggerableEvent(const views::MouseEvent& e) { return event_utils::IsPossibleDispositionEvent(e); } @@ -494,7 +494,7 @@ class MenuRunner : public ChromeViews::MenuDelegate, } virtual int GetDropOperation(MenuItemView* item, - const ChromeViews::DropTargetEvent& event, + const views::DropTargetEvent& event, DropPosition* position) { DCHECK(drop_data_.is_valid); BookmarkNode* node = menu_id_to_node_map_[item->GetCommand()]; @@ -602,7 +602,7 @@ class MenuRunner : public ChromeViews::MenuDelegate, // TODO(sky/glen): this is temporary, need to decide on what this should // look like. -class ButtonSeparatorView : public ChromeViews::View { +class ButtonSeparatorView : public views::View { public: ButtonSeparatorView() {} virtual ~ButtonSeparatorView() {} @@ -741,7 +741,7 @@ void BookmarkBarView::SetPageNavigator(PageNavigator* navigator) { gfx::Size BookmarkBarView::GetPreferredSize() { if (!prefButtonHeight) { - ChromeViews::TextButton text_button(L"X"); + views::TextButton text_button(L"X"); gfx::Size text_button_pref = text_button.GetMinimumSize(); prefButtonHeight = static_cast<int>(text_button_pref.height()); } @@ -811,7 +811,7 @@ void BookmarkBarView::Layout() { instructions_->SetVisible(false); for (int i = 0; i < GetBookmarkButtonCount(); ++i) { - ChromeViews::View* child = GetChildViewAt(i); + views::View* child = GetChildViewAt(i); gfx::Size pref = child->GetPreferredSize(); int next_x = x + pref.width() + kButtonPadding; child->SetVisible(next_x < max_x); @@ -1127,20 +1127,20 @@ void BookmarkBarView::AnimationEnded(const Animation* animation) { SchedulePaint(); } -ChromeViews::TextButton* BookmarkBarView::GetBookmarkButton(int index) { +views::TextButton* BookmarkBarView::GetBookmarkButton(int index) { DCHECK(index >= 0 && index < GetBookmarkButtonCount()); - return static_cast<ChromeViews::TextButton*>(GetChildViewAt(index)); + return static_cast<views::TextButton*>(GetChildViewAt(index)); } -ChromeViews::MenuItemView* BookmarkBarView::GetMenu() { +views::MenuItemView* BookmarkBarView::GetMenu() { return menu_runner_.get() ? menu_runner_->menu() : NULL; } -ChromeViews::MenuItemView* BookmarkBarView::GetContextMenu() { +views::MenuItemView* BookmarkBarView::GetContextMenu() { return menu_runner_.get() ? menu_runner_->context_menu() : NULL; } -ChromeViews::MenuItemView* BookmarkBarView::GetDropMenu() { +views::MenuItemView* BookmarkBarView::GetDropMenu() { return drop_menu_runner_.get() ? drop_menu_runner_->menu() : NULL; } @@ -1162,7 +1162,7 @@ void BookmarkBarView::Init() { bookmarks_separator_view_ = new ButtonSeparatorView(); AddChildView(bookmarks_separator_view_); - instructions_ = new ChromeViews::Label( + instructions_ = new views::Label( l10n_util::GetString(IDS_BOOKMARKS_NO_ITEMS), rb.GetFont(ResourceBundle::BaseFont)); instructions_->SetColor(kInstructionsColor); @@ -1280,7 +1280,7 @@ void BookmarkBarView::BookmarkNodeRemovedImpl(BookmarkModel* model, return; } DCHECK(index >= 0 && index < GetBookmarkButtonCount()); - ChromeViews::View* button = GetChildViewAt(index); + views::View* button = GetChildViewAt(index); RemoveChildView(button); MessageLoop::current()->DeleteSoon(FROM_HERE, button); Layout(); @@ -1301,7 +1301,7 @@ void BookmarkBarView::BookmarkNodeChangedImpl(BookmarkModel* model, } int index = model_->GetBookmarkBarNode()->IndexOfChild(node); DCHECK(index != -1); - ChromeViews::TextButton* button = GetBookmarkButton(index); + views::TextButton* button = GetBookmarkButton(index); gfx::Size old_pref = button->GetPreferredSize(); ConfigureButton(node, button); gfx::Size new_pref = button->GetPreferredSize(); @@ -1330,7 +1330,7 @@ void BookmarkBarView::WriteDragData(View* sender, for (int i = 0; i < GetBookmarkButtonCount(); ++i) { if (sender == GetBookmarkButton(i)) { - ChromeViews::TextButton* button = GetBookmarkButton(i); + views::TextButton* button = GetBookmarkButton(i); ChromeCanvas canvas(button->width(), button->height(), false); button->Paint(&canvas, true); drag_utils::SetDragImageOnDataObject(canvas, button->width(), @@ -1361,7 +1361,7 @@ int BookmarkBarView::GetDragOperations(View* sender, int x, int y) { return DragDropTypes::DRAG_NONE; } -void BookmarkBarView::RunMenu(ChromeViews::View* view, +void BookmarkBarView::RunMenu(views::View* view, const CPoint& pt, HWND hwnd) { BookmarkNode* node; @@ -1416,7 +1416,7 @@ void BookmarkBarView::RunMenu(ChromeViews::View* view, false); } -void BookmarkBarView::ButtonPressed(ChromeViews::BaseButton* sender) { +void BookmarkBarView::ButtonPressed(views::BaseButton* sender) { BookmarkNode* node; if (sender->GetTag() == kOtherFolderButtonTag) { node = model_->other_node(); @@ -1463,7 +1463,7 @@ void BookmarkBarView::ShowContextMenu(View* source, controller.RunMenuAt(x, y); } -ChromeViews::View* BookmarkBarView::CreateBookmarkButton(BookmarkNode* node) { +views::View* BookmarkBarView::CreateBookmarkButton(BookmarkNode* node) { if (node->GetType() == history::StarredEntry::URL) { BookmarkButton* button = new BookmarkButton(node->GetURL(), node->GetTitle(), @@ -1472,7 +1472,7 @@ ChromeViews::View* BookmarkBarView::CreateBookmarkButton(BookmarkNode* node) { ConfigureButton(node, button); return button; } else { - ChromeViews::MenuButton* button = + views::MenuButton* button = new BookmarkFolderButton(node->GetTitle(), this, false); button->SetIcon(GetGroupIcon()); button->SetListener(this, 0); @@ -1482,7 +1482,7 @@ ChromeViews::View* BookmarkBarView::CreateBookmarkButton(BookmarkNode* node) { } void BookmarkBarView::ConfigureButton(BookmarkNode* node, - ChromeViews::TextButton* button) { + views::TextButton* button) { button->SetText(node->GetTitle()); button->ClearMaxTextSize(); button->SetContextMenuController(this); @@ -1667,7 +1667,7 @@ int BookmarkBarView::CalculateDropOperation(const DropTargetEvent& event, for (int i = 0; i < GetBookmarkButtonCount() && GetBookmarkButton(i)->IsVisible() && !found; i++) { - ChromeViews::TextButton* button = GetBookmarkButton(i); + views::TextButton* button = GetBookmarkButton(i); int button_x = mirrored_x - button->x(); int button_w = button->width(); if (button_x < button_w) { diff --git a/chrome/browser/views/bookmark_bar_view.h b/chrome/browser/views/bookmark_bar_view.h index ee978e3..91eb3206 100644 --- a/chrome/browser/views/bookmark_bar_view.h +++ b/chrome/browser/views/bookmark_bar_view.h @@ -24,7 +24,7 @@ class ButtonSeparatorView; struct DropInfo; } -namespace ChromeViews { +namespace views { class MenuItemView; } @@ -35,14 +35,14 @@ class MenuItemView; // BookmarkBarView shows the bookmarks from a specific Profile. BookmarkBarView // waits until the HistoryService for the profile has been loaded before // creating the BookmarkModel. -class BookmarkBarView : public ChromeViews::View, +class BookmarkBarView : public views::View, public BookmarkModelObserver, - public ChromeViews::ViewMenuDelegate, - public ChromeViews::BaseButton::ButtonListener, + public views::ViewMenuDelegate, + public views::BaseButton::ButtonListener, public Menu::Delegate, public NotificationObserver, - public ChromeViews::ContextMenuController, - public ChromeViews::DragController, + public views::ContextMenuController, + public views::DragController, public AnimationDelegate { friend class MenuRunner; friend class ShowFolderMenuTask; @@ -94,10 +94,10 @@ class BookmarkBarView : public ChromeViews::View, virtual void Paint(ChromeCanvas* canvas); virtual void PaintChildren(ChromeCanvas* canvas); virtual bool CanDrop(const OSExchangeData& data); - virtual void OnDragEntered(const ChromeViews::DropTargetEvent& event); - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event); + virtual void OnDragEntered(const views::DropTargetEvent& event); + virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event); + virtual int OnPerformDrop(const views::DropTargetEvent& event); // Sets the model change listener to listener. void SetModelChangedListener(ModelChangedListener* listener) { @@ -143,25 +143,25 @@ class BookmarkBarView : public ChromeViews::View, void AnimationEnded(const Animation* animation); // Returns the button at the specified index. - ChromeViews::TextButton* GetBookmarkButton(int index); + views::TextButton* GetBookmarkButton(int index); // Returns the button responsible for showing bookmarks in the other bookmark // folder. - ChromeViews::TextButton* other_bookmarked_button() const { + views::TextButton* other_bookmarked_button() const { return other_bookmarked_button_; } // Returns the active MenuItemView, or NULL if a menu isn't showing. - ChromeViews::MenuItemView* GetMenu(); + views::MenuItemView* GetMenu(); // Returns the drop MenuItemView, or NULL if a menu isn't showing. - ChromeViews::MenuItemView* GetDropMenu(); + views::MenuItemView* GetDropMenu(); // Returns the context menu, or null if one isn't showing. - ChromeViews::MenuItemView* GetContextMenu(); + views::MenuItemView* GetContextMenu(); // Returns the button used when not all the items on the bookmark bar fit. - ChromeViews::TextButton* overflow_button() const { return overflow_button_; } + views::TextButton* overflow_button() const { return overflow_button_; } // Maximum size of buttons on the bookmark bar. static const int kMaxButtonWidth; @@ -204,10 +204,10 @@ class BookmarkBarView : public ChromeViews::View, void Init(); // Creates the button showing the other bookmarked items. - ChromeViews::MenuButton* CreateOtherBookmarkedButton(); + views::MenuButton* CreateOtherBookmarkedButton(); // Creates the button used when not all bookmark buttons fit. - ChromeViews::MenuButton* CreateOverflowButton(); + views::MenuButton* CreateOverflowButton(); // Returns the number of buttons corresponding to starred urls/groups. This // is equivalent to the number of children the bookmark bar node from the @@ -268,7 +268,7 @@ class BookmarkBarView : public ChromeViews::View, // DragController method. Determines the node representing sender and invokes // WriteDragData to write the actual data. - virtual void WriteDragData(ChromeViews::View* sender, + virtual void WriteDragData(views::View* sender, int press_x, int press_y, OSExchangeData* data); @@ -277,7 +277,7 @@ class BookmarkBarView : public ChromeViews::View, void WriteDragData(BookmarkNode* node, OSExchangeData* data); // Returns the drag operations for the specified button. - virtual int GetDragOperations(ChromeViews::View* sender, int x, int y); + virtual int GetDragOperations(views::View* sender, int x, int y); // ViewMenuDelegate method. 3 types of menus may be shown: // . the menu allowing the user to choose when the bookmark bar is visible. @@ -285,25 +285,25 @@ class BookmarkBarView : public ChromeViews::View, // . menu for star groups. // The latter two are handled by a MenuRunner, which builds the appropriate // menu. - virtual void RunMenu(ChromeViews::View* view, const CPoint& pt, HWND hwnd); + virtual void RunMenu(views::View* view, const CPoint& pt, HWND hwnd); // Invoked when a star entry corresponding to a URL on the bookmark bar is // pressed. Forwards to the PageNavigator to open the URL. - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + virtual void ButtonPressed(views::BaseButton* sender); // Invoked for this View, one of the buttons or the 'other' button. Shows the // appropriate context menu. - virtual void ShowContextMenu(ChromeViews::View* source, + virtual void ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture); // Creates the button for rendering the specified bookmark node. - ChromeViews::View* CreateBookmarkButton(BookmarkNode* node); + views::View* CreateBookmarkButton(BookmarkNode* node); // COnfigures the button from the specified node. This sets the text, // and icon. - void ConfigureButton(BookmarkNode* node, ChromeViews::TextButton* button); + void ConfigureButton(BookmarkNode* node, views::TextButton* button); // Used when showing the menu allowing the user to choose when the bar is // visible. Return value corresponds to the users preference for when the @@ -338,7 +338,7 @@ class BookmarkBarView : public ChromeViews::View, // Returns the drop operation and index for the drop based on the event // and data. Returns DragDropTypes::DRAG_NONE if not a valid location. - int CalculateDropOperation(const ChromeViews::DropTargetEvent& event, + int CalculateDropOperation(const views::DropTargetEvent& event, const BookmarkDragData& data, int* index, bool* drop_on, @@ -347,7 +347,7 @@ class BookmarkBarView : public ChromeViews::View, // Invokes CanDropAt to determine if this is a valid location for the data, // then returns the appropriate drag operation based on the data. - int CalculateDropOperation(const ChromeViews::DropTargetEvent& event, + int CalculateDropOperation(const views::DropTargetEvent& event, const BookmarkDragData& data, BookmarkNode* parent, int index); @@ -403,7 +403,7 @@ class BookmarkBarView : public ChromeViews::View, scoped_ptr<MenuRunner> drop_menu_runner_; // Shows the other bookmark entries. - ChromeViews::MenuButton* other_bookmarked_button_; + views::MenuButton* other_bookmarked_button_; // ModelChangeListener. ModelChangedListener* model_changed_listener_; @@ -415,10 +415,10 @@ class BookmarkBarView : public ChromeViews::View, scoped_ptr<DropInfo> drop_info_; // Visible if not all the bookmark buttons fit. - ChromeViews::MenuButton* overflow_button_; + views::MenuButton* overflow_button_; // If no bookmarks are visible, we show some text explaining the bar. - ChromeViews::Label* instructions_; + views::Label* instructions_; ButtonSeparatorView* bookmarks_separator_view_; @@ -434,7 +434,7 @@ class BookmarkBarView : public ChromeViews::View, // If the bookmark bubble is showing, this is the visible ancestor of the URL. // The visible ancestor is either the other_bookmarked_button_, // overflow_button_ or a button on the bar. - ChromeViews::BaseButton* throbbing_view_; + views::BaseButton* throbbing_view_; DISALLOW_COPY_AND_ASSIGN(BookmarkBarView); }; diff --git a/chrome/browser/views/bookmark_bar_view_test.cc b/chrome/browser/views/bookmark_bar_view_test.cc index 9d2016a..c242a7b 100644 --- a/chrome/browser/views/bookmark_bar_view_test.cc +++ b/chrome/browser/views/bookmark_bar_view_test.cc @@ -68,7 +68,7 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { } virtual void SetUp() { - ChromeViews::MenuItemView::allow_task_nesting_during_run_ = true; + views::MenuItemView::allow_task_nesting_during_run_ = true; BookmarkBarView::testing_ = true; profile_.reset(new TestingProfile()); @@ -93,13 +93,13 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { // This code looks a bit hacky, but I've written it so that it shouldn't // be dependant upon any of the layout code in BookmarkBarView. Instead // we brute force search for a size that triggers the overflow button. - ChromeViews::View tmp_parent; + views::View tmp_parent; tmp_parent.AddChildView(bb_view_); bb_view_pref_ = bb_view_->GetPreferredSize(); bb_view_pref_.set_width(1000); - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(4); + views::TextButton* button = bb_view_->GetBookmarkButton(4); while (button->IsVisible()) { bb_view_pref_.set_width(bb_view_pref_.width() - 25); bb_view_->SetBounds(0, 0, bb_view_pref_.width(), bb_view_pref_.height()); @@ -113,12 +113,12 @@ class BookmarkBarViewEventTestBase : public ViewEventTestBase { virtual void TearDown() { BookmarkBarView::testing_ = false; - ChromeViews::MenuItemView::allow_task_nesting_during_run_ = false; + views::MenuItemView::allow_task_nesting_during_run_ = false; ViewEventTestBase::TearDown(); } protected: - virtual ChromeViews::View* CreateContentsView() { + virtual views::View* CreateContentsView() { return bb_view_; } @@ -173,7 +173,7 @@ class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest1::Step2)); @@ -182,18 +182,18 @@ class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); // Button should be depressed. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); - ASSERT_TRUE(button->GetState() == ChromeViews::BaseButton::BS_PUSHED); + views::TextButton* button = bb_view_->GetBookmarkButton(0); + ASSERT_TRUE(button->GetState() == views::BaseButton::BS_PUSHED); // Click on the 2nd menu item (A URL). ASSERT_TRUE(menu->GetSubmenu()); - ChromeViews::MenuItemView* menu_to_select = + views::MenuItemView* menu_to_select = menu->GetSubmenu()->GetMenuItemAt(0); ui_controls::MoveMouseToCenterAndPress(menu_to_select, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, @@ -207,10 +207,10 @@ class BookmarkBarViewTest1 : public BookmarkBarViewEventTestBase { GetURL()); // Make sure button is no longer pushed. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); - ASSERT_TRUE(button->GetState() == ChromeViews::BaseButton::BS_NORMAL); + views::TextButton* button = bb_view_->GetBookmarkButton(0); + ASSERT_TRUE(button->GetState() == views::BaseButton::BS_NORMAL); - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu == NULL || !menu->GetSubmenu()->IsShowing()); Done(); @@ -225,7 +225,7 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest2::Step2)); @@ -234,7 +234,7 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL && menu->GetSubmenu()->IsShowing()); // Click on 0x0, which should trigger closing menu. @@ -242,7 +242,7 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { // true. If that changes, this code will need to find another empty space // to press the mouse on. gfx::Point mouse_loc; - ChromeViews::View::ConvertPointToScreen(bb_view_, &mouse_loc); + views::View::ConvertPointToScreen(bb_view_, &mouse_loc); ui_controls::SendMouseMove(0, 0); ui_controls::SendMouseEventsNotifyWhenDone( ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, @@ -251,12 +251,12 @@ class BookmarkBarViewTest2 : public BookmarkBarViewEventTestBase { void Step3() { // The menu shouldn't be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu == NULL || !menu->GetSubmenu()->IsShowing()); // Make sure button is no longer pushed. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); - ASSERT_TRUE(button->GetState() == ChromeViews::BaseButton::BS_NORMAL); + views::TextButton* button = bb_view_->GetBookmarkButton(0); + ASSERT_TRUE(button->GetState() == views::BaseButton::BS_NORMAL); window_->Activate(); @@ -273,7 +273,7 @@ class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->other_bookmarked_button(); + views::TextButton* button = bb_view_->other_bookmarked_button(); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest3::Step2)); @@ -282,11 +282,11 @@ class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(1); ASSERT_TRUE(child_menu != NULL); @@ -298,8 +298,8 @@ class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { void Step3() { // Make sure sub menu is showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(1); ASSERT_TRUE(child_menu->GetSubmenu() != NULL); ASSERT_TRUE(child_menu->GetSubmenu()->IsShowing()); @@ -314,8 +314,8 @@ class BookmarkBarViewTest3 : public BookmarkBarViewEventTestBase { void Step4() { // Make sure sub menu we first clicked isn't showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(1); ASSERT_TRUE(child_menu->GetSubmenu() != NULL); ASSERT_FALSE(child_menu->GetSubmenu()->IsShowing()); @@ -345,7 +345,7 @@ class BookmarkBarViewTest4 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->other_bookmarked_button(); + views::TextButton* button = bb_view_->other_bookmarked_button(); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest4::Step2)); @@ -354,11 +354,11 @@ class BookmarkBarViewTest4 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(0); ASSERT_TRUE(child_menu != NULL); @@ -370,7 +370,7 @@ class BookmarkBarViewTest4 : public BookmarkBarViewEventTestBase { void Step3() { // Make sure the context menu is showing. - ChromeViews::MenuItemView* menu = bb_view_->GetContextMenu(); + views::MenuItemView* menu = bb_view_->GetContextMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); @@ -400,7 +400,7 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest5::Step2)); @@ -409,11 +409,11 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(0); ASSERT_TRUE(child_menu != NULL); @@ -424,10 +424,10 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { } void Step3() { - ChromeViews::MenuItemView* target_menu = + views::MenuItemView* target_menu = bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1); gfx::Point loc(1, target_menu->height() - 1); - ChromeViews::View::ConvertPointToScreen(target_menu, &loc); + views::View::ConvertPointToScreen(target_menu, &loc); // Start a drag. ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), @@ -439,10 +439,10 @@ class BookmarkBarViewTest5 : public BookmarkBarViewEventTestBase { void Step4() { // Drop the item so that it's now the second item. - ChromeViews::MenuItemView* target_menu = + views::MenuItemView* target_menu = bb_view_->GetMenu()->GetSubmenu()->GetMenuItemAt(1); gfx::Point loc(1, target_menu->height() - 1); - ChromeViews::View::ConvertPointToScreen(target_menu, &loc); + views::View::ConvertPointToScreen(target_menu, &loc); ui_controls::SendMouseMove(loc.x(), loc.y()); ui_controls::SendMouseEventsNotifyWhenDone(ui_controls::LEFT, @@ -467,7 +467,7 @@ class BookmarkBarViewTest6 : public BookmarkBarViewEventTestBase { protected: virtual void DoTestOnMessageLoop() { // Press the mouse button on the overflow button. Don't release it though. - ChromeViews::TextButton* button = bb_view_->overflow_button(); + views::TextButton* button = bb_view_->overflow_button(); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN, CreateEventTask(this, &BookmarkBarViewTest6::Step2)); } @@ -475,11 +475,11 @@ class BookmarkBarViewTest6 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(0); ASSERT_TRUE(child_menu != NULL); @@ -508,7 +508,7 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest7::Step2)); @@ -517,11 +517,11 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(0); ASSERT_TRUE(child_menu != NULL); @@ -533,10 +533,10 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { void Step3() { // Drag over other button. - ChromeViews::TextButton* other_button = + views::TextButton* other_button = bb_view_->other_bookmarked_button(); gfx::Point loc(other_button->width() / 2, other_button->height() / 2); - ChromeViews::View::ConvertPointToScreen(other_button, &loc); + views::View::ConvertPointToScreen(other_button, &loc); // Start a drag. ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), @@ -547,14 +547,14 @@ class BookmarkBarViewTest7 : public BookmarkBarViewEventTestBase { } void Step4() { - ChromeViews::MenuItemView* drop_menu = bb_view_->GetDropMenu(); + views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); ASSERT_TRUE(drop_menu != NULL); ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* target_menu = + views::MenuItemView* target_menu = drop_menu->GetSubmenu()->GetMenuItemAt(0); gfx::Point loc(1, 1); - ChromeViews::View::ConvertPointToScreen(target_menu, &loc); + views::View::ConvertPointToScreen(target_menu, &loc); ui_controls::SendMouseMove(loc.x(), loc.y()); ui_controls::SendMouseEventsNotifyWhenDone( ui_controls::LEFT, ui_controls::UP, @@ -581,7 +581,7 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest8::Step2)); @@ -590,11 +590,11 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* child_menu = + views::MenuItemView* child_menu = menu->GetSubmenu()->GetMenuItemAt(0); ASSERT_TRUE(child_menu != NULL); @@ -606,10 +606,10 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { void Step3() { // Drag over other button. - ChromeViews::TextButton* other_button = + views::TextButton* other_button = bb_view_->other_bookmarked_button(); gfx::Point loc(other_button->width() / 2, other_button->height() / 2); - ChromeViews::View::ConvertPointToScreen(other_button, &loc); + views::View::ConvertPointToScreen(other_button, &loc); // Start a drag. ui_controls::SendMouseMoveNotifyWhenDone(loc.x() + 10, loc.y(), @@ -620,25 +620,25 @@ class BookmarkBarViewTest8 : public BookmarkBarViewEventTestBase { } void Step4() { - ChromeViews::MenuItemView* drop_menu = bb_view_->GetDropMenu(); + views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); ASSERT_TRUE(drop_menu != NULL); ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); // Now drag back over first menu. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); gfx::Point loc(button->width() / 2, button->height() / 2); - ChromeViews::View::ConvertPointToScreen(button, &loc); + views::View::ConvertPointToScreen(button, &loc); ui_controls::SendMouseMoveNotifyWhenDone(loc.x(), loc.y(), NewRunnableMethod(this, &BookmarkBarViewTest8::Step5)); } void Step5() { // Drop on folder F11. - ChromeViews::MenuItemView* drop_menu = bb_view_->GetDropMenu(); + views::MenuItemView* drop_menu = bb_view_->GetDropMenu(); ASSERT_TRUE(drop_menu != NULL); ASSERT_TRUE(drop_menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* target_menu = + views::MenuItemView* target_menu = drop_menu->GetSubmenu()->GetMenuItemAt(1); ui_controls::MoveMouseToCenterAndPress( target_menu, ui_controls::LEFT, ui_controls::UP, @@ -666,7 +666,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest9::Step2)); @@ -675,25 +675,25 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); first_menu_ = menu->GetSubmenu()->GetMenuItemAt(0); gfx::Point menu_loc; - ChromeViews::View::ConvertPointToScreen(first_menu_, &menu_loc); + views::View::ConvertPointToScreen(first_menu_, &menu_loc); start_y_ = menu_loc.y(); // Move the mouse over the scroll button. - ChromeViews::View* scroll_container = menu->GetSubmenu()->GetParent(); + views::View* scroll_container = menu->GetSubmenu()->GetParent(); ASSERT_TRUE(scroll_container != NULL); scroll_container = scroll_container->GetParent(); ASSERT_TRUE(scroll_container != NULL); - ChromeViews::View* scroll_down_button = scroll_container->GetChildViewAt(1); + views::View* scroll_down_button = scroll_container->GetChildViewAt(1); ASSERT_TRUE(scroll_down_button); gfx::Point loc(scroll_down_button->width() / 2, scroll_down_button->height() / 2); - ChromeViews::View::ConvertPointToScreen(scroll_down_button, &loc); + views::View::ConvertPointToScreen(scroll_down_button, &loc); ui_controls::SendMouseMoveNotifyWhenDone( loc.x(), loc.y(), CreateEventTask(this, &BookmarkBarViewTest9::Step3)); } @@ -705,7 +705,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { void Step4() { gfx::Point menu_loc; - ChromeViews::View::ConvertPointToScreen(first_menu_, &menu_loc); + views::View::ConvertPointToScreen(first_menu_, &menu_loc); ASSERT_NE(start_y_, menu_loc.y()); // Hide menu. @@ -715,7 +715,7 @@ class BookmarkBarViewTest9 : public BookmarkBarViewEventTestBase { } int start_y_; - ChromeViews::MenuItemView* first_menu_; + views::MenuItemView* first_menu_; }; VIEW_TEST(BookmarkBarViewTest9, ScrollButtonScrolls) @@ -726,7 +726,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { virtual void DoTestOnMessageLoop() { // Move the mouse to the first folder on the bookmark bar and press the // mouse. - ChromeViews::TextButton* button = bb_view_->GetBookmarkButton(0); + views::TextButton* button = bb_view_->GetBookmarkButton(0); ui_controls::MoveMouseToCenterAndPress(button, ui_controls::LEFT, ui_controls::DOWN | ui_controls::UP, CreateEventTask(this, &BookmarkBarViewTest10::Step2)); @@ -735,7 +735,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { private: void Step2() { // Menu should be showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); @@ -747,7 +747,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { void Step3() { // Make sure menu is showing and item is selected. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); ASSERT_TRUE(menu->GetSubmenu()->GetMenuItemAt(0)->IsSelected()); @@ -759,7 +759,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { } void Step4() { - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); ASSERT_FALSE(menu->GetSubmenu()->GetMenuItemAt(0)->IsSelected()); @@ -773,10 +773,10 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { void Step5() { // Make sure the submenu is showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* submenu = menu->GetSubmenu()->GetMenuItemAt(1); + views::MenuItemView* submenu = menu->GetSubmenu()->GetMenuItemAt(1); ASSERT_TRUE(submenu->IsSelected()); ASSERT_TRUE(submenu->GetSubmenu()); ASSERT_TRUE(submenu->GetSubmenu()->IsShowing()); @@ -789,10 +789,10 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { void Step6() { // Make sure the submenu is showing. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); - ChromeViews::MenuItemView* submenu = menu->GetSubmenu()->GetMenuItemAt(1); + views::MenuItemView* submenu = menu->GetSubmenu()->GetMenuItemAt(1); ASSERT_TRUE(submenu->IsSelected()); ASSERT_TRUE(!submenu->GetSubmenu() || !submenu->GetSubmenu()->IsShowing()); @@ -804,7 +804,7 @@ class BookmarkBarViewTest10 : public BookmarkBarViewEventTestBase { void Step7() { // Make sure menu is showing and item is selected. - ChromeViews::MenuItemView* menu = bb_view_->GetMenu(); + views::MenuItemView* menu = bb_view_->GetMenu(); ASSERT_TRUE(menu != NULL); ASSERT_TRUE(menu->GetSubmenu()->IsShowing()); ASSERT_TRUE(menu->GetSubmenu()->GetMenuItemAt(0)->IsSelected()); diff --git a/chrome/browser/views/bookmark_bubble_view.cc b/chrome/browser/views/bookmark_bubble_view.cc index 7e0d0fc..103df07 100644 --- a/chrome/browser/views/bookmark_bubble_view.cc +++ b/chrome/browser/views/bookmark_bubble_view.cc @@ -22,13 +22,13 @@ #include "chrome/views/text_field.h" #include "generated_resources.h" -using ChromeViews::ComboBox; -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; -using ChromeViews::Label; -using ChromeViews::Link; -using ChromeViews::NativeButton; -using ChromeViews::View; +using views::ComboBox; +using views::ColumnSet; +using views::GridLayout; +using views::Label; +using views::Link; +using views::NativeButton; +using views::View; // Color of the title. static const SkColor kTitleColor = SkColorSetRGB(6, 45, 117); @@ -137,17 +137,17 @@ void BookmarkBubbleView::DidChangeBounds(const gfx::Rect& previous, void BookmarkBubbleView::BubbleShown() { DCHECK(GetContainer()); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainer()->GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainer()->GetHWND()); focus_manager->RegisterAccelerator( - ChromeViews::Accelerator(VK_RETURN, false, false, false), this); + views::Accelerator(VK_RETURN, false, false, false), this); title_tf_->RequestFocus(); title_tf_->SelectAll(); } bool BookmarkBubbleView::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { + const views::Accelerator& accelerator) { if (accelerator.GetKeyCode() != VK_RETURN) return false; if (edit_button_->HasFocus()) @@ -239,7 +239,7 @@ void BookmarkBubbleView::Init() { layout->StartRow(0, 2); layout->AddView( new Label(l10n_util::GetString(IDS_BOOMARK_BUBBLE_TITLE_TEXT))); - title_tf_ = new ChromeViews::TextField(); + title_tf_ = new views::TextField(); title_tf_->SetText(GetTitle()); layout->AddView(title_tf_); @@ -266,7 +266,7 @@ std::wstring BookmarkBubbleView::GetTitle() { return std::wstring(); } -void BookmarkBubbleView::ButtonPressed(ChromeViews::NativeButton* sender) { +void BookmarkBubbleView::ButtonPressed(views::NativeButton* sender) { if (sender == edit_button_) { UserMetrics::RecordAction(L"BookmarkBubble_Edit", profile_); ShowEditor(); diff --git a/chrome/browser/views/bookmark_bubble_view.h b/chrome/browser/views/bookmark_bubble_view.h index 89594a1..0e5cefe 100644 --- a/chrome/browser/views/bookmark_bubble_view.h +++ b/chrome/browser/views/bookmark_bubble_view.h @@ -18,7 +18,7 @@ class Profile; class BookmarkModel; class BookmarkNode; -namespace ChromeViews { +namespace views { class CheckBox; class TextField; } @@ -27,10 +27,10 @@ class TextField; // InfoBubble. BookmarkBubbleView provides views for unstarring and editting // the bookmark it is created with. Don't create a BookmarkBubbleView directly, // instead use the static Show method. -class BookmarkBubbleView : public ChromeViews::View, - public ChromeViews::LinkController, - public ChromeViews::NativeButton::Listener, - public ChromeViews::ComboBox::Listener, +class BookmarkBubbleView : public views::View, + public views::LinkController, + public views::NativeButton::Listener, + public views::ComboBox::Listener, public InfoBubbleDelegate { public: static void Show(HWND parent, @@ -50,19 +50,19 @@ class BookmarkBubbleView : public ChromeViews::View, virtual void BubbleShown(); // Override to close on return. - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); private: // 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 RecentlyUsedFoldersModel : public ChromeViews::ComboBox::Model { + class RecentlyUsedFoldersModel : public views::ComboBox::Model { public: RecentlyUsedFoldersModel(BookmarkModel* bb_model, BookmarkNode* node); // ComboBox::Model methods. Call through to nodes_. - virtual int GetItemCount(ChromeViews::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + virtual int GetItemCount(views::ComboBox* source); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); // Returns the node at the specified index. BookmarkNode* GetNodeAt(int index); @@ -95,13 +95,13 @@ class BookmarkBubbleView : public ChromeViews::View, // LinkController method, either unstars the item or shows the bookmark // editor (depending upon which link was clicked). - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); // ButtonListener method, closes the bubble or opens the edit dialog. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // ComboBox::Listener method. Changes the parent of the bookmark. - virtual void ItemChanged(ChromeViews::ComboBox* combo_box, + virtual void ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index); @@ -142,20 +142,20 @@ class BookmarkBubbleView : public ChromeViews::View, RecentlyUsedFoldersModel parent_model_; // Link for removing/unstarring the bookmark. - ChromeViews::Link* remove_link_; + views::Link* remove_link_; // Button to bring up the editor. - ChromeViews::NativeButton* edit_button_; + views::NativeButton* edit_button_; // Button to close the window. - ChromeViews::NativeButton* close_button_; + views::NativeButton* close_button_; // TextField showing the title of the bookmark. - ChromeViews::TextField* title_tf_; + views::TextField* title_tf_; // ComboBox showing a handful of folders the user can choose from, including // the current parent. - ChromeViews::ComboBox* parent_combobox_; + views::ComboBox* parent_combobox_; DISALLOW_EVIL_CONSTRUCTORS(BookmarkBubbleView); }; diff --git a/chrome/browser/views/bookmark_editor_view.cc b/chrome/browser/views/bookmark_editor_view.cc index 2c8a3cc..0aefa26 100644 --- a/chrome/browser/views/bookmark_editor_view.cc +++ b/chrome/browser/views/bookmark_editor_view.cc @@ -23,12 +23,12 @@ #include "chromium_strings.h" #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; -using ChromeViews::Label; -using ChromeViews::NativeButton; -using ChromeViews::TextField; -using ChromeViews::TreeNode; +using views::ColumnSet; +using views::GridLayout; +using views::Label; +using views::NativeButton; +using views::TextField; +using views::TreeNode; // Background color of text field when URL is invalid. static const SkColor kErrorColor = SkColorSetRGB(0xFF, 0xBC, 0xBC); @@ -98,7 +98,7 @@ bool BookmarkEditorView::AreAcceleratorsEnabled(DialogButton button) { return !tree_view_.GetEditingNode(); } -ChromeViews::View* BookmarkEditorView::GetContentsView() { +views::View* BookmarkEditorView::GetContentsView() { return this; } @@ -116,14 +116,14 @@ void BookmarkEditorView::Layout() { } gfx::Size BookmarkEditorView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_EDITBOOKMARK_DIALOG_WIDTH_CHARS, IDS_EDITBOOKMARK_DIALOG_HEIGHT_LINES)); } void BookmarkEditorView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (child == this) { // Add and remove the New Folder button from the ClientView's hierarchy. if (is_add) { @@ -135,11 +135,11 @@ void BookmarkEditorView::ViewHierarchyChanged(bool is_add, } void BookmarkEditorView::OnTreeViewSelectionChanged( - ChromeViews::TreeView* tree_view) { + views::TreeView* tree_view) { } -bool BookmarkEditorView::CanEdit(ChromeViews::TreeView* tree_view, - ChromeViews::TreeModelNode* node) { +bool BookmarkEditorView::CanEdit(views::TreeView* tree_view, + views::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()); @@ -177,7 +177,7 @@ bool BookmarkEditorView::IsCommandEnabled(int id) const { } void BookmarkEditorView::Show(HWND parent_hwnd) { - ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this); + views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this); UserInputChanged(); if (bb_model_->IsLoaded()) ExpandAndSelect(); diff --git a/chrome/browser/views/bookmark_editor_view.h b/chrome/browser/views/bookmark_editor_view.h index 51f3769..796f041 100644 --- a/chrome/browser/views/bookmark_editor_view.h +++ b/chrome/browser/views/bookmark_editor_view.h @@ -15,7 +15,7 @@ #include "chrome/views/text_field.h" #include "chrome/views/tree_node_model.h" -namespace ChromeViews { +namespace views { class Window; } @@ -31,12 +31,12 @@ class Profile; // // To use BookmarkEditorView invoke the static show method. -class BookmarkEditorView : public ChromeViews::View, - public ChromeViews::NativeButton::Listener, - public ChromeViews::TreeViewController, - public ChromeViews::DialogDelegate, - public ChromeViews::TextField::Controller, - public ChromeViews::ContextMenuController, +class BookmarkEditorView : public views::View, + public views::NativeButton::Listener, + public views::TreeViewController, + public views::DialogDelegate, + public views::TextField::Controller, + public views::ContextMenuController, public Menu::Delegate, public BookmarkModelObserver { FRIEND_TEST(BookmarkEditorViewTest, ChangeParent); @@ -67,28 +67,28 @@ class BookmarkEditorView : public ChromeViews::View, virtual std::wstring GetWindowTitle() const; virtual bool Accept(); virtual bool AreAcceleratorsEnabled(DialogButton button); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // View methods. virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, - ChromeViews::View* child); + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); // TreeViewObserver methods. - virtual void OnTreeViewSelectionChanged(ChromeViews::TreeView* tree_view); - virtual bool CanEdit(ChromeViews::TreeView* tree_view, - ChromeViews::TreeModelNode* node); + virtual void OnTreeViewSelectionChanged(views::TreeView* tree_view); + virtual bool CanEdit(views::TreeView* tree_view, + views::TreeModelNode* node); // TextField::Controller methods. - virtual void ContentsChanged(ChromeViews::TextField* sender, + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags) {} // NativeButton/CheckBox. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // Menu::Delegate method. virtual void ExecuteCommand(int id); @@ -112,16 +112,16 @@ class BookmarkEditorView : public ChromeViews::View, private: // Type of node in the tree. - typedef ChromeViews::TreeNodeWithValue<int> EditorNode; + typedef views::TreeNodeWithValue<int> EditorNode; // Model for the TreeView. Trivial subclass that doesn't allow titles with // empty strings. - class EditorTreeModel : public ChromeViews::TreeNodeModel<EditorNode> { + class EditorTreeModel : public views::TreeNodeModel<EditorNode> { public: explicit EditorTreeModel(EditorNode* root) : TreeNodeModel<EditorNode>(root) {} - virtual void SetTitle(ChromeViews::TreeModelNode* node, + virtual void SetTitle(views::TreeModelNode* node, const std::wstring& title) { if (!title.empty()) TreeNodeModel::SetTitle(node, title); @@ -222,16 +222,16 @@ class BookmarkEditorView : public ChromeViews::View, scoped_ptr<EditorTreeModel> tree_model_; // Displays star groups. - ChromeViews::TreeView tree_view_; + views::TreeView tree_view_; // Used to create a new group. - ChromeViews::NativeButton new_group_button_; + views::NativeButton new_group_button_; // Used for editing the URL. - ChromeViews::TextField url_tf_; + views::TextField url_tf_; // Used for editing the title. - ChromeViews::TextField title_tf_; + views::TextField title_tf_; // Initial parent to select. Is only used if node_ is NULL. BookmarkNode* parent_; diff --git a/chrome/browser/views/bug_report_view.cc b/chrome/browser/views/bug_report_view.cc index 0cdd34f..d53924b 100644 --- a/chrome/browser/views/bug_report_view.cc +++ b/chrome/browser/views/bug_report_view.cc @@ -30,8 +30,8 @@ #include "chromium_strings.h" #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; // Report a bug data version static const int kBugReportVersion = 1; @@ -43,7 +43,7 @@ static const int kDescriptionLines = 5; static const char kReportPhishingUrl[] = "http://www.google.com/safebrowsing/report_phish/"; -class BugReportComboBoxModel : public ChromeViews::ComboBox::Model { +class BugReportComboBoxModel : public views::ComboBox::Model { public: BugReportComboBoxModel() {} @@ -58,12 +58,12 @@ class BugReportComboBoxModel : public ChromeViews::ComboBox::Model { OTHER_PROBLEM }; - // ChromeViews::ComboBox::Model interface. - virtual int GetItemCount(ChromeViews::ComboBox* source) { + // views::ComboBox::Model interface. + virtual int GetItemCount(views::ComboBox* source) { return OTHER_PROBLEM + 1; } - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index) { + virtual std::wstring GetItemAt(views::ComboBox* source, int index) { return GetItemAtIndex(index); } @@ -148,30 +148,30 @@ void BugReportView::SetupControl() { bug_type_model_.reset(new BugReportComboBoxModel); // Adds all controls. - bug_type_label_ = new ChromeViews::Label( + bug_type_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_BUG_TYPE)); - bug_type_combo_ = new ChromeViews::ComboBox(bug_type_model_.get()); + bug_type_combo_ = new views::ComboBox(bug_type_model_.get()); bug_type_combo_->SetListener(this); - page_title_label_ = new ChromeViews::Label( + page_title_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_REPORT_PAGE_TITLE)); - page_title_text_ = new ChromeViews::Label(tab_->GetTitle()); - page_url_label_ = new ChromeViews::Label( + page_title_text_ = new views::Label(tab_->GetTitle()); + page_url_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_REPORT_URL_LABEL)); // page_url_text_'s text (if any) is filled in after dialog creation - page_url_text_ = new ChromeViews::TextField; + page_url_text_ = new views::TextField; page_url_text_->SetController(this); - description_label_ = new ChromeViews::Label( + description_label_ = new views::Label( l10n_util::GetString(IDS_BUGREPORT_DESCRIPTION_LABEL)); description_text_ = - new ChromeViews::TextField(ChromeViews::TextField::STYLE_MULTILINE); + new views::TextField(views::TextField::STYLE_MULTILINE); description_text_->SetHeightInLines(kDescriptionLines); - include_page_source_checkbox_ = new ChromeViews::CheckBox( + include_page_source_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_SOURCE_CHKBOX)); include_page_source_checkbox_->SetIsSelected(true); - include_page_image_checkbox_ = new ChromeViews::CheckBox( + include_page_image_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_BUGREPORT_INCLUDE_PAGE_IMAGE_CHKBOX)); include_page_image_checkbox_->SetIsSelected(true); @@ -226,12 +226,12 @@ void BugReportView::SetupControl() { } gfx::Size BugReportView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_BUGREPORT_DIALOG_WIDTH_CHARS, IDS_BUGREPORT_DIALOG_HEIGHT_LINES)); } -void BugReportView::ItemChanged(ChromeViews::ComboBox* combo_box, +void BugReportView::ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index) { if (new_index == prev_index) @@ -257,11 +257,11 @@ void BugReportView::ItemChanged(ChromeViews::ComboBox* combo_box, GetDialogClientView()->UpdateDialogButtons(); } -void BugReportView::ContentsChanged(ChromeViews::TextField* sender, +void BugReportView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { } -void BugReportView::HandleKeystroke(ChromeViews::TextField* sender, +void BugReportView::HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags) { } @@ -315,7 +315,7 @@ bool BugReportView::Accept() { return true; } -ChromeViews::View* BugReportView::GetContentsView() { +views::View* BugReportView::GetContentsView() { return this; } diff --git a/chrome/browser/views/bug_report_view.h b/chrome/browser/views/bug_report_view.h index 7391349..82582c3 100644 --- a/chrome/browser/views/bug_report_view.h +++ b/chrome/browser/views/bug_report_view.h @@ -12,13 +12,11 @@ #include "chrome/views/text_field.h" #include "chrome/views/view.h" -namespace ChromeViews { - +namespace views { class CheckBox; class Label; class Throbber; class Window; - } class Profile; @@ -34,10 +32,10 @@ class BugReportComboBoxModel; // // Note: The UI team hasn't defined yet how the bug report UI will look like. // So now use dialog as a placeholder. -class BugReportView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::ComboBox::Listener, - public ChromeViews::TextField::Controller { +class BugReportView : public views::View, + public views::DialogDelegate, + public views::ComboBox::Listener, + public views::TextField::Controller { public: explicit BugReportView(Profile* profile, TabContents* tab); virtual ~BugReportView(); @@ -48,21 +46,21 @@ class BugReportView : public ChromeViews::View, png_data_.reset(png_data); }; - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); - // ChromeViews::TextField::Controller implementation: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // views::TextField::Controller implementation: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags); - // ChromeViews::ComboBox::Listener implementation: - virtual void ItemChanged(ChromeViews::ComboBox* combo_box, - int prev_index, int new_index); + // views::ComboBox::Listener implementation: + virtual void ItemChanged(views::ComboBox* combo_box, int prev_index, + int new_index); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual int GetDefaultDialogButton() const; virtual bool CanResize() const; @@ -72,7 +70,7 @@ class BugReportView : public ChromeViews::View, virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); void SetUrl(const GURL& url); @@ -92,16 +90,16 @@ class BugReportView : public ChromeViews::View, // Redirects the user to Google's phishing reporting page. void ReportPhishing(); - ChromeViews::Label* bug_type_label_; - ChromeViews::ComboBox* bug_type_combo_; - ChromeViews::Label* page_title_label_; - ChromeViews::Label* page_title_text_; - ChromeViews::Label* page_url_label_; - ChromeViews::TextField* page_url_text_; - ChromeViews::Label* description_label_; - ChromeViews::TextField* description_text_; - ChromeViews::CheckBox* include_page_source_checkbox_; - ChromeViews::CheckBox* include_page_image_checkbox_; + views::Label* bug_type_label_; + views::ComboBox* bug_type_combo_; + views::Label* page_title_label_; + views::Label* page_title_text_; + views::Label* page_url_label_; + views::TextField* page_url_text_; + views::Label* description_label_; + views::TextField* description_text_; + views::CheckBox* include_page_source_checkbox_; + views::CheckBox* include_page_image_checkbox_; scoped_ptr<BugReportComboBoxModel> bug_type_model_; diff --git a/chrome/browser/views/clear_browsing_data.cc b/chrome/browser/views/clear_browsing_data.cc index 30c331f..0b2b6f5 100644 --- a/chrome/browser/views/clear_browsing_data.cc +++ b/chrome/browser/views/clear_browsing_data.cc @@ -57,7 +57,7 @@ ClearBrowsingDataView::~ClearBrowsingDataView(void) { void ClearBrowsingDataView::Init() { // Views we will add to the *parent* of this dialog, since it will display // next to the buttons which we don't draw ourselves. - throbber_.reset(new ChromeViews::Throbber(50, true)); + throbber_.reset(new views::Throbber(50, true)); throbber_->SetParentOwned(false); throbber_->SetVisible(false); @@ -66,7 +66,7 @@ void ClearBrowsingDataView::Init() { status_label_.SetParentOwned(false); // Regular view controls we draw by ourself. First, we add the dialog label. - delete_all_label_ = new ChromeViews::Label( + delete_all_label_ = new views::Label( l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_LABEL)); AddChildView(delete_all_label_); @@ -92,20 +92,20 @@ void ClearBrowsingDataView::Init() { profile_->GetPrefs()->GetBoolean(prefs::kDeletePasswords)); // Add a label which appears before the combo box for the time period. - time_period_label_ = new ChromeViews::Label( - l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); + time_period_label_ = new views::Label( + l10n_util::GetString(IDS_CLEAR_BROWSING_DATA_TIME_LABEL)); AddChildView(time_period_label_); // Add the combo box showing how far back in time we want to delete. - time_period_combobox_ = new ChromeViews::ComboBox(this); + time_period_combobox_ = new views::ComboBox(this); AddChildView(time_period_combobox_); } //////////////////////////////////////////////////////////////////////////////// -// ClearBrowsingDataView, ChromeViews::View implementation: +// ClearBrowsingDataView, views::View implementation: gfx::Size ClearBrowsingDataView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_CLEARDATA_DIALOG_WIDTH_CHARS, IDS_CLEARDATA_DIALOG_HEIGHT_LINES)); } @@ -190,7 +190,7 @@ void ClearBrowsingDataView::Layout() { sz = status_label_.GetPreferredSize(); int status_label_x = throbber_->x() + throbber_->width() + kRelatedControlHorizontalSpacing; - status_label_.SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + status_label_.SetHorizontalAlignment(views::Label::ALIGN_LEFT); status_label_.SetBounds(status_label_x, throbber_topleft_y + 1, sz.width(), @@ -198,8 +198,8 @@ void ClearBrowsingDataView::Layout() { } void ClearBrowsingDataView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { // Since we want the some of the controls to show up in the same visual row // as the buttons, which are provided by the framework, we must add the // buttons to the non-client view, which is the parent of this view. @@ -217,7 +217,7 @@ void ClearBrowsingDataView::ViewHierarchyChanged(bool is_add, } //////////////////////////////////////////////////////////////////////////////// -// ClearBrowsingDataView, ChromeViews::DialogDelegate implementation: +// ClearBrowsingDataView, views::DialogDelegate implementation: std::wstring ClearBrowsingDataView::GetDialogButtonLabel( DialogButton button) const { @@ -276,19 +276,19 @@ bool ClearBrowsingDataView::Accept() { return false; // We close the dialog in OnBrowsingDataRemoverDone(). } -ChromeViews::View* ClearBrowsingDataView::GetContentsView() { +views::View* ClearBrowsingDataView::GetContentsView() { return this; } //////////////////////////////////////////////////////////////////////////////// -// ClearBrowsingDataView, ChromeViews::ComboBox::Model implementation: +// ClearBrowsingDataView, views::ComboBox::Model implementation: -int ClearBrowsingDataView::GetItemCount(ChromeViews::ComboBox* source) { +int ClearBrowsingDataView::GetItemCount(views::ComboBox* source) { DCHECK(source == time_period_combobox_); return 4; } -std::wstring ClearBrowsingDataView::GetItemAt(ChromeViews::ComboBox* source, +std::wstring ClearBrowsingDataView::GetItemAt(views::ComboBox* source, int index) { DCHECK(source == time_period_combobox_); switch (index) { @@ -302,9 +302,9 @@ std::wstring ClearBrowsingDataView::GetItemAt(ChromeViews::ComboBox* source, } //////////////////////////////////////////////////////////////////////////////// -// ClearBrowsingDataView, ChromeViews::ButtonListener implementation: +// ClearBrowsingDataView, views::ButtonListener implementation: -void ClearBrowsingDataView::ButtonPressed(ChromeViews::NativeButton* sender) { +void ClearBrowsingDataView::ButtonPressed(views::NativeButton* sender) { if (sender == del_history_checkbox_) profile_->GetPrefs()->SetBoolean(prefs::kDeleteBrowsingHistory, del_history_checkbox_->IsSelected() ? true : false); @@ -329,9 +329,9 @@ void ClearBrowsingDataView::ButtonPressed(ChromeViews::NativeButton* sender) { //////////////////////////////////////////////////////////////////////////////// // ClearBrowsingDataView, private: -ChromeViews::CheckBox* ClearBrowsingDataView::AddCheckbox( - const std::wstring& text, bool checked) { - ChromeViews::CheckBox* checkbox = new ChromeViews::CheckBox(text); +views::CheckBox* ClearBrowsingDataView::AddCheckbox(const std::wstring& text, + bool checked) { + views::CheckBox* checkbox = new views::CheckBox(text); checkbox->SetIsSelected(checked); checkbox->SetListener(this); AddChildView(checkbox); @@ -361,7 +361,7 @@ void ClearBrowsingDataView::UpdateControlEnabledState() { // Convenience method that returns true if the supplied checkbox is selected // and enabled. -static bool IsCheckBoxEnabledAndSelected(ChromeViews::CheckBox* cb) { +static bool IsCheckBoxEnabledAndSelected(views::CheckBox* cb) { return (cb->IsEnabled() && cb->IsSelected()); } diff --git a/chrome/browser/views/clear_browsing_data.h b/chrome/browser/views/clear_browsing_data.h index a1eac38..9b000fb 100644 --- a/chrome/browser/views/clear_browsing_data.h +++ b/chrome/browser/views/clear_browsing_data.h @@ -13,11 +13,11 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { - class CheckBox; - class Label; - class Throbber; - class Window; +namespace views { +class CheckBox; +class Label; +class Throbber; +class Window; } class Profile; @@ -30,10 +30,10 @@ class MessageLoop; // etc). // //////////////////////////////////////////////////////////////////////////////// -class ClearBrowsingDataView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::ComboBox::Model, - public ChromeViews::NativeButton::Listener, +class ClearBrowsingDataView : public views::View, + public views::DialogDelegate, + public views::ComboBox::Model, + public views::NativeButton::Listener, public BrowsingDataRemover::Observer { public: explicit ClearBrowsingDataView(Profile* profile); @@ -42,14 +42,14 @@ class ClearBrowsingDataView : public ChromeViews::View, // Initialize the controls on the dialog. void Init(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); virtual void Layout(); void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool IsDialogButtonEnabled(DialogButton button) const; virtual bool CanResize() const; @@ -59,18 +59,18 @@ class ClearBrowsingDataView : public ChromeViews::View, virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::ComboBox::Model: - virtual int GetItemCount(ChromeViews::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + // Overridden from views::ComboBox::Model: + virtual int GetItemCount(views::ComboBox* source); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); - // Overridden from ChromeViews::NativeButton::Listener: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden from views::NativeButton::Listener: + virtual void ButtonPressed(views::NativeButton* sender); private: // Adds a new check-box as a child to the view. - ChromeViews::CheckBox* AddCheckbox(const std::wstring& text, bool checked); + views::CheckBox* AddCheckbox(const std::wstring& text, bool checked); // Sets the controls on the UI to be enabled/disabled depending on whether we // have a delete operation in progress or not. @@ -84,17 +84,17 @@ class ClearBrowsingDataView : public ChromeViews::View, virtual void OnBrowsingDataRemoverDone(); // UI elements we add to the parent view. - scoped_ptr<ChromeViews::Throbber> throbber_; - ChromeViews::Label status_label_; + scoped_ptr<views::Throbber> throbber_; + views::Label status_label_; // Other UI elements. - ChromeViews::Label* delete_all_label_; - ChromeViews::CheckBox* del_history_checkbox_; - ChromeViews::CheckBox* del_downloads_checkbox_; - ChromeViews::CheckBox* del_cache_checkbox_; - ChromeViews::CheckBox* del_cookies_checkbox_; - ChromeViews::CheckBox* del_passwords_checkbox_; - ChromeViews::Label* time_period_label_; - ChromeViews::ComboBox* time_period_combobox_; + views::Label* delete_all_label_; + views::CheckBox* del_history_checkbox_; + views::CheckBox* del_downloads_checkbox_; + views::CheckBox* del_cache_checkbox_; + views::CheckBox* del_cookies_checkbox_; + views::CheckBox* del_passwords_checkbox_; + views::Label* time_period_label_; + views::ComboBox* time_period_combobox_; // Used to signal enabled/disabled state for controls in the UI. bool delete_in_progress_; diff --git a/chrome/browser/views/constrained_window_impl.cc b/chrome/browser/views/constrained_window_impl.cc index 9cbd04f..3f5664d 100644 --- a/chrome/browser/views/constrained_window_impl.cc +++ b/chrome/browser/views/constrained_window_impl.cc @@ -37,7 +37,7 @@ #include "chromium_strings.h" #include "generated_resources.h" -namespace ChromeViews { +namespace views { class ClientView; } @@ -80,14 +80,14 @@ static const int kOTRFramePartIDs[] = { IDR_WINDOW_TOP_LEFT_CORNER_OTR, IDR_WINDOW_TOP_RIGHT_CORNER_OTR, IDR_CLOSE_SA, IDR_CLOSE_SA_H, IDR_CLOSE_SA_P, 0 }; -class XPWindowResources : public WindowResources { +class XPWindowResources : public views::WindowResources { public: XPWindowResources() { InitClass(); } virtual ~XPWindowResources() {} - virtual SkBitmap* GetPartBitmap(FramePartBitmap part_id) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part_id) const { return bitmaps_[part_id]; } @@ -110,14 +110,14 @@ class XPWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(XPWindowResources); }; -class VistaWindowResources : public WindowResources { +class VistaWindowResources : public views::WindowResources { public: VistaWindowResources() { InitClass(); } virtual ~VistaWindowResources() {} - virtual SkBitmap* GetPartBitmap(FramePartBitmap part_id) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part_id) const { return bitmaps_[part_id]; } @@ -140,14 +140,14 @@ class VistaWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(VistaWindowResources); }; -class OTRWindowResources : public WindowResources { +class OTRWindowResources : public views::WindowResources { public: OTRWindowResources() { InitClass(); } virtual ~OTRWindowResources() {} - virtual SkBitmap* GetPartBitmap(FramePartBitmap part_id) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part_id) const { return bitmaps_[part_id]; } @@ -178,8 +178,8 @@ SkBitmap* OTRWindowResources::bitmaps_[]; // ConstrainedWindowNonClientView class ConstrainedWindowNonClientView - : public ChromeViews::NonClientView, - public ChromeViews::BaseButton::ButtonListener, + : public views::NonClientView, + public views::BaseButton::ButtonListener, public LocationBarView::Delegate { public: ConstrainedWindowNonClientView(ConstrainedWindowImpl* container, @@ -197,7 +197,7 @@ class ConstrainedWindowNonClientView bool with_url_field) const; void UpdateWindowTitle(); - void set_window_delegate(ChromeViews::WindowDelegate* window_delegate) { + void set_window_delegate(views::WindowDelegate* window_delegate) { window_delegate_ = window_delegate; } @@ -205,7 +205,7 @@ class ConstrainedWindowNonClientView // forces a repaint of the titlebar. void SetShowThrobber(bool show_throbber); - // Overridden from ChromeViews::NonClientView: + // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; @@ -214,14 +214,14 @@ class ConstrainedWindowNonClientView virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); - // Overridden from ChromeViews::BaseButton::ButtonListener: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // Overridden from views::BaseButton::ButtonListener: + virtual void ButtonPressed(views::BaseButton* sender); // Overridden from LocationBarView::Delegate: virtual TabContents* GetTabContents(); @@ -254,15 +254,15 @@ class ConstrainedWindowNonClientView } ConstrainedWindowImpl* container_; - ChromeViews::WindowDelegate* window_delegate_; + views::WindowDelegate* window_delegate_; - scoped_ptr<WindowResources> resources_; + scoped_ptr<views::WindowResources> resources_; gfx::Rect title_bounds_; gfx::Rect icon_bounds_; gfx::Rect client_bounds_; - ChromeViews::Button* close_button_; + views::Button* close_button_; LocationBarView* location_bar_; @@ -348,7 +348,7 @@ ConstrainedWindowNonClientView::ConstrainedWindowNonClientView( : NonClientView(), container_(container), window_delegate_(NULL), - close_button_(new ChromeViews::Button), + close_button_(new views::Button), location_bar_(NULL), show_throbber_(false), current_throbber_frame_(-1), @@ -364,14 +364,14 @@ ConstrainedWindowNonClientView::ConstrainedWindowNonClientView( } } - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, + close_button_->SetImage(views::Button::BS_NORMAL, resources_->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON)); - close_button_->SetImage(ChromeViews::Button::BS_HOT, + close_button_->SetImage(views::Button::BS_HOT, resources_->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_H)); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, + close_button_->SetImage(views::Button::BS_PUSHED, resources_->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_P)); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_CENTER, - ChromeViews::Button::ALIGN_MIDDLE); + close_button_->SetImageAlignment(views::Button::ALIGN_CENTER, + views::Button::ALIGN_MIDDLE); close_button_->SetListener(this, 0); AddChildView(close_button_); @@ -469,7 +469,7 @@ void ConstrainedWindowNonClientView::SetShowThrobber(bool show_throbber) { } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowNonClientView, ChromeViews::NonClientView implementation: +// ConstrainedWindowNonClientView, views::NonClientView implementation: gfx::Rect ConstrainedWindowNonClientView::CalculateClientAreaBounds( int width, @@ -553,7 +553,7 @@ void ConstrainedWindowNonClientView::EnableClose(bool enable) { } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowNonClientView, ChromeViews::View implementation: +// ConstrainedWindowNonClientView, views::View implementation: void ConstrainedWindowNonClientView::Paint(ChromeCanvas* canvas) { PaintFrameBorder(canvas); @@ -638,11 +638,10 @@ void ConstrainedWindowNonClientView::ViewHierarchyChanged(bool is_add, } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowNonClientView, ChromeViews::BaseButton::Button +// ConstrainedWindowNonClientView, views::BaseButton::Button // implementation: -void ConstrainedWindowNonClientView::ButtonPressed( - ChromeViews::BaseButton* sender) { +void ConstrainedWindowNonClientView::ButtonPressed(views::BaseButton* sender) { if (sender == close_button_) container_->ExecuteSystemMenuCommand(SC_CLOSE); } @@ -776,19 +775,18 @@ void ConstrainedWindowNonClientView::InitClass() { //////////////////////////////////////////////////////////////////////////////// // ConstrainedTabContentsWindowDelegate -class ConstrainedTabContentsWindowDelegate - : public ChromeViews::WindowDelegate { +class ConstrainedTabContentsWindowDelegate : public views::WindowDelegate { public: explicit ConstrainedTabContentsWindowDelegate(TabContents* contents) : contents_(contents), contents_view_(NULL) { } - void set_contents_view(ChromeViews::View* contents_view) { + void set_contents_view(views::View* contents_view) { contents_view_ = contents_view; } - // ChromeViews::WindowDelegate implementation: + // views::WindowDelegate implementation: virtual bool CanResize() const { return true; } @@ -801,13 +799,13 @@ class ConstrainedTabContentsWindowDelegate virtual SkBitmap GetWindowIcon() { return contents_->GetFavIcon(); } - virtual ChromeViews::View* GetContentsView() { + virtual views::View* GetContentsView() { return contents_view_; } private: TabContents* contents_; - ChromeViews::View* contents_view_; + views::View* contents_view_; DISALLOW_EVIL_CONSTRUCTORS(ConstrainedTabContentsWindowDelegate); }; @@ -844,8 +842,8 @@ void ConstrainedWindowImpl::ActivateConstrainedWindow() { // Store the focus of our parent focus manager so we can restore it when we // close. - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetHWND()); DCHECK(focus_manager); focus_manager = focus_manager->GetParentFocusManager(); if (focus_manager) { @@ -1043,7 +1041,7 @@ void ConstrainedWindowImpl::ToolbarSizeChanged(TabContents* source, ConstrainedWindowImpl::ConstrainedWindowImpl( TabContents* owner, - ChromeViews::WindowDelegate* window_delegate, + views::WindowDelegate* window_delegate, TabContents* constrained_contents) : CustomFrameWindow(window_delegate, new ConstrainedWindowNonClientView(this, owner)), @@ -1055,7 +1053,7 @@ ConstrainedWindowImpl::ConstrainedWindowImpl( ConstrainedWindowImpl::ConstrainedWindowImpl( TabContents* owner, - ChromeViews::WindowDelegate* window_delegate) + views::WindowDelegate* window_delegate) : CustomFrameWindow(window_delegate, new ConstrainedWindowNonClientView(this, owner)), constrained_contents_(NULL) { @@ -1124,7 +1122,7 @@ void ConstrainedWindowImpl::InitWindowForContents( ConstrainedTabContentsWindowDelegate* delegate) { constrained_contents_ = constrained_contents; constrained_contents_->set_delegate(this); - contents_container_ = new ChromeViews::HWNDView; + contents_container_ = new views::HWNDView; delegate->set_contents_view(contents_container_); non_client_view()->set_window_delegate(contents_window_delegate_.get()); } @@ -1240,7 +1238,7 @@ void ConstrainedWindowImpl::UpdateUI(unsigned int changed_flags) { } //////////////////////////////////////////////////////////////////////////////// -// ConstrainedWindowImpl, ChromeViews::ContainerWin overrides: +// ConstrainedWindowImpl, views::ContainerWin overrides: void ConstrainedWindowImpl::OnDestroy() { // We do this here, rather than |Close|, since the window may be destroyed in @@ -1251,8 +1249,8 @@ void ConstrainedWindowImpl::OnDestroy() { // ConstrainedWindow has already been destroyed (by the processing of // WM_DESTROY in FocusManager). So the FocusManager we retrieve here is the // parent one (the one from the top window). - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetHWND()); if (focus_manager) { // We may not have a focus manager if: // - we are hidden when closed (the TabContent would be detached). @@ -1346,8 +1344,8 @@ void ConstrainedWindowImpl::OnWindowPosChanged(WINDOWPOS* window_pos) { ConstrainedWindow* ConstrainedWindow::CreateConstrainedDialog( TabContents* parent, const gfx::Rect& initial_bounds, - ChromeViews::View* contents_view, - ChromeViews::WindowDelegate* window_delegate) { + views::View* contents_view, + views::WindowDelegate* window_delegate) { ConstrainedWindowImpl* window = new ConstrainedWindowImpl(parent, window_delegate); window->InitAsDialog(initial_bounds); diff --git a/chrome/browser/views/constrained_window_impl.h b/chrome/browser/views/constrained_window_impl.h index 90c2db3..d28e9d3 100644 --- a/chrome/browser/views/constrained_window_impl.h +++ b/chrome/browser/views/constrained_window_impl.h @@ -13,7 +13,7 @@ class ConstrainedTabContentsWindowDelegate; class ConstrainedWindowAnimation; class ConstrainedWindowNonClientView; -namespace ChromeViews { +namespace views { class HWNDView; class WindowDelegate; } @@ -25,7 +25,7 @@ class WindowDelegate; // a child HWND with a custom window frame. // class ConstrainedWindowImpl : public ConstrainedWindow, - public ChromeViews::CustomFrameWindow, + public views::CustomFrameWindow, public TabContentsDelegate { public: virtual ~ConstrainedWindowImpl(); @@ -109,10 +109,10 @@ class ConstrainedWindowImpl : public ConstrainedWindow, // Use the static factory methods on ConstrainedWindow to construct a // ConstrainedWindow. ConstrainedWindowImpl(TabContents* owner, - ChromeViews::WindowDelegate* window_delegate, + views::WindowDelegate* window_delegate, TabContents* constrained_contents); ConstrainedWindowImpl(TabContents* owner, - ChromeViews::WindowDelegate* window_delegate); + views::WindowDelegate* window_delegate); void Init(TabContents* owner); // Called after changing either the anchor point or titlebar @@ -128,7 +128,7 @@ class ConstrainedWindowImpl : public ConstrainedWindow, void ResizeConstrainedWindow(int width, int height); // Initialize the Constrained Window as a Constrained Dialog containing a - // ChromeViews::View client area. + // views::View client area. void InitAsDialog(const gfx::Rect& initial_bounds); // Builds the underlying HWND and window delegates for a newly @@ -172,14 +172,14 @@ class ConstrainedWindowImpl : public ConstrainedWindow, // when this window is destroyed. bool focus_restoration_disabled_; - // A default ChromeViews::WindowDelegate implementation for this window when + // A default views::WindowDelegate implementation for this window when // a TabContents is being constrained. (For the Constrained Dialog case, the // caller is required to provide the WindowDelegate). - scoped_ptr<ChromeViews::WindowDelegate> contents_window_delegate_; + scoped_ptr<views::WindowDelegate> contents_window_delegate_; // We keep a reference on the HWNDView so we can properly detach the tab // contents when detaching. - ChromeViews::HWNDView* contents_container_; + views::HWNDView* contents_container_; // true if this window is really a constrained dialog. This is set by // InitAsDialog(). diff --git a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc index 69834c8..3dc184f 100644 --- a/chrome/browser/views/constrained_window_impl_interactive_uitest.cc +++ b/chrome/browser/views/constrained_window_impl_interactive_uitest.cc @@ -51,7 +51,7 @@ TEST_F(InteractiveConstrainedWindowTest, TestOpenAndResizeTo) { // isn't what we want to test. POINT link_point(tab_view_bounds.CenterPoint().ToPOINT()); ASSERT_TRUE(window->SimulateOSClick(link_point, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); ASSERT_TRUE(automation()->WaitForWindowCountToBecome(2, 1000)); @@ -75,7 +75,7 @@ TEST_F(InteractiveConstrainedWindowTest, TestOpenAndResizeTo) { &tab_view_bounds, true)); POINT popup_link_point(tab_view_bounds.CenterPoint().ToPOINT()); ASSERT_TRUE(popup_window->SimulateOSClick( - popup_link_point, ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + popup_link_point, views::Event::EF_LEFT_BUTTON_DOWN)); // No idea how to wait here other then sleeping. This timeout used to be // lower, then we started hitting it before it was done. :( @@ -128,7 +128,7 @@ TEST_F(InteractiveConstrainedWindowTest, ClickingXClosesConstrained) { // Click that X. POINT click_point(constrained_close_button.ToPOINT()); ASSERT_TRUE(window->SimulateOSClick(click_point, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN)); + views::Event::EF_LEFT_BUTTON_DOWN)); // Check that there is only one constrained window. (There would have been // two pre-click). diff --git a/chrome/browser/views/delay_view.cc b/chrome/browser/views/delay_view.cc index a841580..4b8e871 100644 --- a/chrome/browser/views/delay_view.cc +++ b/chrome/browser/views/delay_view.cc @@ -21,18 +21,17 @@ DelayView::DelayView(const std::wstring& text, CommandController* controller, cancel_button_(NULL) { DCHECK(controller); - label_ = new ChromeViews::Label(text); + label_ = new views::Label(text); AddChildView(label_); if (show_cancel) { - cancel_button_ = - new ChromeViews::NativeButton(l10n_util::GetString(IDS_CANCEL)); + cancel_button_ = new views::NativeButton(l10n_util::GetString(IDS_CANCEL)); cancel_button_->SetID(ID_CANCEL); cancel_button_->SetListener(this); AddChildView(cancel_button_); } - throbber_ = new ChromeViews::Throbber(50, true); + throbber_ = new views::Throbber(50, true); AddChildView(throbber_); throbber_->Start(); } @@ -40,7 +39,7 @@ DelayView::DelayView(const std::wstring& text, CommandController* controller, DelayView::~DelayView() { } -void DelayView::ButtonPressed(ChromeViews::NativeButton *sender) { +void DelayView::ButtonPressed(views::NativeButton *sender) { if (sender->GetID() == ID_CANCEL) { controller_->ExecuteCommand(IDCANCEL); } diff --git a/chrome/browser/views/delay_view.h b/chrome/browser/views/delay_view.h index 8d3c767..86ac7cc 100644 --- a/chrome/browser/views/delay_view.h +++ b/chrome/browser/views/delay_view.h @@ -14,8 +14,8 @@ #include "chrome/views/native_button.h" #include "chrome/views/throbber.h" -class DelayView : public ChromeViews::View, - public ChromeViews::NativeButton::Listener { +class DelayView : public views::View, + public views::NativeButton::Listener { public: // |text| explains the delay // |controller| receives notifications when the "cancel" button is pressed @@ -29,18 +29,18 @@ class DelayView : public ChromeViews::View, ID_CANCEL = 10000, }; - // Overridden from ChromeViews::View + // Overridden from views::View virtual void Layout(); - // Implemented from ChromeViews::NativeButton::Listener - virtual void ButtonPressed(ChromeViews::NativeButton *sender); + // Implemented from views::NativeButton::Listener + virtual void ButtonPressed(views::NativeButton *sender); private: CommandController* controller_; - ChromeViews::Label* label_; - ChromeViews::NativeButton* cancel_button_; - ChromeViews::Throbber* throbber_; + views::Label* label_; + views::NativeButton* cancel_button_; + views::Throbber* throbber_; DISALLOW_EVIL_CONSTRUCTORS(DelayView); }; diff --git a/chrome/browser/views/dom_view.cc b/chrome/browser/views/dom_view.cc index 24f6f5b..5ea720e 100644 --- a/chrome/browser/views/dom_view.cc +++ b/chrome/browser/views/dom_view.cc @@ -33,7 +33,7 @@ bool DOMView::Init(Profile* profile, SiteInstance* instance) { host_ = tab_contents->AsDOMUIHost(); DCHECK(host_); - ChromeViews::HWNDView::Attach(host_->GetContainerHWND()); + views::HWNDView::Attach(host_->GetContainerHWND()); host_->SetupController(profile); host_->controller()->LoadURL(contents_, PageTransition::START_PAGE); return true; diff --git a/chrome/browser/views/dom_view.h b/chrome/browser/views/dom_view.h index 902426f4..24ae966 100644 --- a/chrome/browser/views/dom_view.h +++ b/chrome/browser/views/dom_view.h @@ -15,7 +15,7 @@ class DOMUIHost; class Profile; class SiteInstance; -class DOMView : public ChromeViews::HWNDView { +class DOMView : public views::HWNDView { public: // Construct a DOMView to display the given data: URL. explicit DOMView(const GURL& contents); diff --git a/chrome/browser/views/download_item_view.cc b/chrome/browser/views/download_item_view.cc index ec88049..8c4ea06 100644 --- a/chrome/browser/views/download_item_view.cc +++ b/chrome/browser/views/download_item_view.cc @@ -188,11 +188,11 @@ DownloadItemView::DownloadItemView(DownloadItem* download, drop_down_state_ = DANGEROUS; warning_icon_ = rb.GetBitmapNamed(IDR_WARNING); - save_button_ = new ChromeViews::NativeButton( + save_button_ = new views::NativeButton( l10n_util::GetString(IDS_SAVE_DOWNLOAD)); save_button_->set_enforce_dlu_min_size(false); save_button_->SetListener(this); - discard_button_ = new ChromeViews::NativeButton( + discard_button_ = new views::NativeButton( l10n_util::GetString(IDS_DISCARD_DOWNLOAD)); discard_button_->SetListener(this); discard_button_->set_enforce_dlu_min_size(false); @@ -201,11 +201,11 @@ DownloadItemView::DownloadItemView(DownloadItem* download, std::wstring file_name = download->original_name(); // Ensure the file name is not too long. ElideString(file_name, kFileNameMaxLength, &file_name); - dangerous_download_label_ = new ChromeViews::Label( + dangerous_download_label_ = new views::Label( l10n_util::GetStringF(IDS_PROMPT_DANGEROUS_DOWNLOAD, file_name)); dangerous_download_label_->SetMultiLine(true); dangerous_download_label_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); + views::Label::ALIGN_LEFT); dangerous_download_label_->SetColor(kFileNameColor); AddChildView(dangerous_download_label_); } @@ -311,7 +311,7 @@ void DownloadItemView::Layout() { } } -void DownloadItemView::ButtonPressed(ChromeViews::NativeButton* sender) { +void DownloadItemView::ButtonPressed(views::NativeButton* sender) { if (sender == discard_button_) { if (download_->state() == DownloadItem::IN_PROGRESS) download_->Cancel(true); @@ -570,7 +570,7 @@ gfx::Size DownloadItemView::GetPreferredSize() { return gfx::Size(width, height); } -void DownloadItemView::OnMouseExited(const ChromeViews::MouseEvent& event) { +void DownloadItemView::OnMouseExited(const views::MouseEvent& event) { // Mouse should not activate us in dangerous mode. if (IsDangerousMode()) return; @@ -581,7 +581,7 @@ void DownloadItemView::OnMouseExited(const ChromeViews::MouseEvent& event) { } // Display the context menu for this item. -bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { +bool DownloadItemView::OnMousePressed(const views::MouseEvent& event) { // Mouse should not activate us in dangerous mode. if (IsDangerousMode()) return true; @@ -623,7 +623,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { point.set_x(drop_down_x_); } - ChromeViews::View::ConvertPointToScreen(this, &point); + views::View::ConvertPointToScreen(this, &point); download_util::DownloadShelfContextMenu menu(download_, GetContainer()->GetHWND(), model_.get(), @@ -635,7 +635,7 @@ bool DownloadItemView::OnMousePressed(const ChromeViews::MouseEvent& event) { return true; } -void DownloadItemView::OnMouseMoved(const ChromeViews::MouseEvent& event) { +void DownloadItemView::OnMouseMoved(const views::MouseEvent& event) { // Mouse should not activate us in dangerous mode. if (IsDangerousMode()) return; @@ -651,7 +651,7 @@ void DownloadItemView::OnMouseMoved(const ChromeViews::MouseEvent& event) { } } -void DownloadItemView::OnMouseReleased(const ChromeViews::MouseEvent& event, +void DownloadItemView::OnMouseReleased(const views::MouseEvent& event, bool canceled) { // Mouse should not activate us in dangerous mode. if (IsDangerousMode()) @@ -670,7 +670,7 @@ void DownloadItemView::OnMouseReleased(const ChromeViews::MouseEvent& event, } // Handle drag (file copy) operations. -bool DownloadItemView::OnMouseDragged(const ChromeViews::MouseEvent& event) { +bool DownloadItemView::OnMouseDragged(const views::MouseEvent& event) { // Mouse should not activate us in dangerous mode. if (IsDangerousMode()) return true; diff --git a/chrome/browser/views/download_item_view.h b/chrome/browser/views/download_item_view.h index 0fefcea..a785705 100644 --- a/chrome/browser/views/download_item_view.h +++ b/chrome/browser/views/download_item_view.h @@ -29,14 +29,14 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { - class Label; +namespace views { +class Label; } class DownloadShelfView; class SkBitmap; -class DownloadItemView : public ChromeViews::NativeButton::Listener, - public ChromeViews::View, +class DownloadItemView : public views::NativeButton::Listener, + public views::View, public DownloadItem::Observer, public AnimationDelegate { public: @@ -63,15 +63,14 @@ class DownloadItemView : public ChromeViews::NativeButton::Listener, virtual void Layout(); virtual void Paint(ChromeCanvas* canvas); virtual gfx::Size GetPreferredSize(); - virtual void OnMouseExited(const ChromeViews::MouseEvent& event); - virtual void OnMouseMoved(const ChromeViews::MouseEvent& event); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& event, - bool canceled); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); + virtual void OnMouseExited(const views::MouseEvent& event); + virtual void OnMouseMoved(const views::MouseEvent& event); + virtual bool OnMousePressed(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); + virtual bool OnMouseDragged(const views::MouseEvent& event); // NativeButton::Listener implementation. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // AnimationDelegate implementation. virtual void AnimationProgressed(const Animation* animation); @@ -217,11 +216,11 @@ class DownloadItemView : public ChromeViews::NativeButton::Listener, base::RepeatingTimer<DownloadItemView> progress_timer_; // Dangerous mode buttons. - ChromeViews::NativeButton* save_button_; - ChromeViews::NativeButton* discard_button_; + views::NativeButton* save_button_; + views::NativeButton* discard_button_; // Dangerous mode label. - ChromeViews::Label* dangerous_download_label_; + views::Label* dangerous_download_label_; // Whether the dangerous mode label has been sized yet. bool dangerous_download_label_sized_; diff --git a/chrome/browser/views/download_shelf_view.cc b/chrome/browser/views/download_shelf_view.cc index 70b4634..a857314 100644 --- a/chrome/browser/views/download_shelf_view.cc +++ b/chrome/browser/views/download_shelf_view.cc @@ -63,7 +63,7 @@ namespace { // Sets size->width() to view's preferred width + size->width().s // Sets size->height() to the max of the view's preferred height and // size->height(); -void AdjustSize(ChromeViews::View* view, gfx::Size* size) { +void AdjustSize(views::View* view, gfx::Size* size) { gfx::Size view_preferred = view->GetPreferredSize(); size->Enlarge(view_preferred.width(), 0); size->set_height(std::max(view_preferred.height(), size->height())); @@ -82,26 +82,25 @@ DownloadShelfView::DownloadShelfView(TabContents* tab_contents) void DownloadShelfView::Init() { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - arrow_image_ = new ChromeViews::ImageView(); + arrow_image_ = new views::ImageView(); arrow_image_->SetImage(rb.GetBitmapNamed(IDR_DOWNLOADS_FAVICON)); AddChildView(arrow_image_); show_all_view_ = - new ChromeViews::Link(l10n_util::GetString(IDS_SHOW_ALL_DOWNLOADS)); + new views::Link(l10n_util::GetString(IDS_SHOW_ALL_DOWNLOADS)); show_all_view_->SetController(this); AddChildView(show_all_view_); - close_button_ = new ChromeViews::Button(); - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, + close_button_ = new views::Button(); + close_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_CLOSE_BAR)); - close_button_->SetImage(ChromeViews::Button::BS_HOT, + close_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, + close_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); close_button_->SetListener(this, 0); AddChildView(close_button_); - SetBackground( - ChromeViews::Background::CreateSolidBackground(kBackgroundColor)); + SetBackground(views::Background::CreateSolidBackground(kBackgroundColor)); new_item_animation_.reset(new SlideAnimation(this)); new_item_animation_->SetSlideDuration(kNewItemAnimationDurationMs); @@ -259,8 +258,7 @@ void DownloadShelfView::Layout() { } // Open the download page. -void DownloadShelfView::LinkActivated(ChromeViews::Link* source, - int event_flags) { +void DownloadShelfView::LinkActivated(views::Link* source, int event_flags) { int index; NavigationController* controller = tab_contents_->controller(); Browser* browser = Browser::GetBrowserForController(controller, &index); @@ -268,6 +266,6 @@ void DownloadShelfView::LinkActivated(ChromeViews::Link* source, browser->ShowNativeUI(DownloadTabUI::GetURL()); } -void DownloadShelfView::ButtonPressed(ChromeViews::BaseButton* button) { +void DownloadShelfView::ButtonPressed(views::BaseButton* button) { shelf_animation_->Hide(); } diff --git a/chrome/browser/views/download_shelf_view.h b/chrome/browser/views/download_shelf_view.h index 35e5b2c..35213a8 100644 --- a/chrome/browser/views/download_shelf_view.h +++ b/chrome/browser/views/download_shelf_view.h @@ -9,8 +9,8 @@ #include "chrome/views/button.h" #include "chrome/views/link.h" -namespace ChromeViews { - class ImageView; +namespace views { +class ImageView; } class DownloadItem; @@ -26,9 +26,9 @@ class DownloadAnimation; // DownloadShelfView does not hold an infinite number of download views, rather // it'll automatically remove views once a certain point is reached. As such, // the remove method is private. -class DownloadShelfView : public ChromeViews::View, - public ChromeViews::BaseButton::ButtonListener, - public ChromeViews::LinkController, +class DownloadShelfView : public views::View, + public views::BaseButton::ButtonListener, + public views::LinkController, public AnimationDelegate { public: DownloadShelfView(TabContents* tab_contents); @@ -49,20 +49,20 @@ class DownloadShelfView : public ChromeViews::View, virtual void AnimationEnded(const Animation* animation); // Invoked when the user clicks the 'show all downloads' link button. - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); // Invoked when the user clicks the close button. Asks the browser to // hide the download shelf. - virtual void ButtonPressed(ChromeViews::BaseButton* button); + virtual void ButtonPressed(views::BaseButton* button); // Removes a specified download view. The supplied view is deleted after // it's removed. - void RemoveDownloadView(ChromeViews::View* view); + void RemoveDownloadView(views::View* view); // Adds a View representing a download to this DownloadShelfView. // DownloadShelfView takes ownership of the View, and will delete it as // necessary. - void AddDownloadView(ChromeViews::View* view); + void AddDownloadView(views::View* view); // Invoked when the download shelf is migrated from one tab contents to a new // one. @@ -79,9 +79,7 @@ class DownloadShelfView : public ChromeViews::View, void PaintSeparators(ChromeCanvas* canvas); // Paints the separator between the two views. - void PaintSeparator(ChromeCanvas* canvas, - ChromeViews::View* v1, - ChromeViews::View* v2); + void PaintSeparator(ChromeCanvas* canvas, views::View* v1, views::View* v2); TabContents* tab_contents_; @@ -96,15 +94,15 @@ class DownloadShelfView : public ChromeViews::View, std::vector<View*> download_views_; // An image displayed on the right of the "Show all downloads..." link. - ChromeViews::ImageView* arrow_image_; + views::ImageView* arrow_image_; // Link for showing all downloads. This is contained as a child, and deleted // by View. - ChromeViews::Link* show_all_view_; + views::Link* show_all_view_; // Button for closing the downloads. This is contained as a child, and // deleted by View. - ChromeViews::Button* close_button_; + views::Button* close_button_; DISALLOW_EVIL_CONSTRUCTORS(DownloadShelfView); }; diff --git a/chrome/browser/views/download_started_animation.cc b/chrome/browser/views/download_started_animation.cc index d3e04c6..e716317 100644 --- a/chrome/browser/views/download_started_animation.cc +++ b/chrome/browser/views/download_started_animation.cc @@ -44,7 +44,7 @@ DownloadStartedAnimation::DownloadStartedAnimation(TabContents* tab_contents) SetImage(kDownloadImage); gfx::Rect rc(0, 0, 0, 0); - popup_ = new ChromeViews::ContainerWin; + popup_ = new views::ContainerWin; popup_->set_window_style(WS_POPUP); popup_->set_window_ex_style(WS_EX_LAYERED | WS_EX_TOOLWINDOW | WS_EX_TRANSPARENT); diff --git a/chrome/browser/views/download_started_animation.h b/chrome/browser/views/download_started_animation.h index 6934fc5..9ad3528 100644 --- a/chrome/browser/views/download_started_animation.h +++ b/chrome/browser/views/download_started_animation.h @@ -10,7 +10,7 @@ #include "chrome/common/notification_service.h" #include "chrome/views/image_view.h" -namespace ChromeViews { +namespace views { class ContainerWin; }; class TabContents; @@ -22,7 +22,7 @@ class TabContents; // finishes animating. class DownloadStartedAnimation : public Animation, public NotificationObserver, - public ChromeViews::ImageView { + public views::ImageView { public: DownloadStartedAnimation(TabContents* tab_contents); @@ -42,7 +42,7 @@ class DownloadStartedAnimation : public Animation, const NotificationDetails& details); // We use a HWND for the popup so that it may float above any HWNDs in our UI. - ChromeViews::ContainerWin* popup_; + views::ContainerWin* popup_; // The content area holding us. TabContents* tab_contents_; diff --git a/chrome/browser/views/download_tab_view.cc b/chrome/browser/views/download_tab_view.cc index fb65c1f..fe3d692 100644 --- a/chrome/browser/views/download_tab_view.cc +++ b/chrome/browser/views/download_tab_view.cc @@ -99,44 +99,44 @@ DownloadItemTabView::DownloadItemTabView() is_floating_view_renderer_(false) { // Create our element views using empty strings for now, // set them based on the model's state in Layout(). - since_ = new ChromeViews::Label(L""); + since_ = new views::Label(L""); ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont font = rb.GetFont(ResourceBundle::WebFont); - since_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + since_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); since_->SetFont(font); AddChildView(since_); - date_ = new ChromeViews::Label(L""); + date_ = new views::Label(L""); date_->SetColor(kStatusColor); - date_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + date_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); date_->SetFont(font); AddChildView(date_); // file_name_ is enabled once the download has finished and we can open // it via ShellExecute. - file_name_ = new ChromeViews::Link(L""); - file_name_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + file_name_ = new views::Link(L""); + file_name_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); file_name_->SetController(this); file_name_->SetFont(font); AddChildView(file_name_); // dangerous_download_warning_ is enabled when a dangerous download has been // initiated. - dangerous_download_warning_ = new ChromeViews::Label(); + dangerous_download_warning_ = new views::Label(); dangerous_download_warning_ ->SetMultiLine(true); dangerous_download_warning_->SetColor(kWarningColor); dangerous_download_warning_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); + views::Label::ALIGN_LEFT); dangerous_download_warning_->SetFont(font); AddChildView(dangerous_download_warning_); // The save and discard buttons are shown to prompt the user when a dangerous // download was started. - save_button_ = new ChromeViews::NativeButton( + save_button_ = new views::NativeButton( l10n_util::GetString(IDS_SAVE_DOWNLOAD)); save_button_->set_enforce_dlu_min_size(false); save_button_->SetListener(this); - discard_button_ = new ChromeViews::NativeButton( + discard_button_ = new views::NativeButton( l10n_util::GetString(IDS_DISCARD_DOWNLOAD)); discard_button_->SetListener(this); discard_button_->set_enforce_dlu_min_size(false); @@ -144,40 +144,39 @@ DownloadItemTabView::DownloadItemTabView() AddChildView(discard_button_); // Set our URL name - download_url_ = new ChromeViews::Label(L""); + download_url_ = new views::Label(L""); download_url_->SetColor(kUrlColor); - download_url_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + download_url_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); download_url_->SetFont(font); AddChildView(download_url_); // Set our time remaining - time_remaining_ = new ChromeViews::Label(L""); + time_remaining_ = new views::Label(L""); time_remaining_->SetColor(kStatusColor); - time_remaining_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + time_remaining_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); time_remaining_->SetFont(font); AddChildView(time_remaining_); // Set our download progress - download_progress_ = new ChromeViews::Label(L""); + download_progress_ = new views::Label(L""); download_progress_->SetColor(kStatusColor); - download_progress_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + download_progress_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); download_progress_->SetFont(font); AddChildView(download_progress_); // Set our 'Pause', 'Cancel' and 'Show in folder' links using // actual strings, since these are constant - pause_ = new ChromeViews::Link(l10n_util::GetString(IDS_DOWNLOAD_LINK_PAUSE)); + pause_ = new views::Link(l10n_util::GetString(IDS_DOWNLOAD_LINK_PAUSE)); pause_->SetController(this); pause_->SetFont(font); AddChildView(pause_); - cancel_ = new ChromeViews::Link( - l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); + cancel_ = new views::Link(l10n_util::GetString(IDS_DOWNLOAD_LINK_CANCEL)); cancel_->SetController(this); cancel_->SetFont(font); AddChildView(cancel_); - show_ = new ChromeViews::Link(l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); + show_ = new views::Link(l10n_util::GetString(IDS_DOWNLOAD_LINK_SHOW)); show_->SetController(this); show_->SetFont(font); AddChildView(show_); @@ -386,7 +385,7 @@ void DownloadItemTabView::LayoutCancelled() { total_text.assign(total_text_localized); // Note that there is no need to adjust the new amount string for the - // locale direction as ChromeViews::Label does that for us. + // locale direction as views::Label does that for us. amount = l10n_util::GetStringF(IDS_DOWNLOAD_TAB_PROGRESS_SIZE, received_size, total_text); @@ -670,7 +669,7 @@ void DownloadItemTabView::PaintBackground(ChromeCanvas* canvas) { } } -bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { +bool DownloadItemTabView::OnMousePressed(const views::MouseEvent& event) { gfx::Point point(event.location()); // If the click is in the highlight region, then highlight this download. @@ -694,7 +693,7 @@ bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { // dangerous download. if (event.IsRightMouseButton() && model_->safety_state() != DownloadItem::DANGEROUS) { - ChromeViews::View::ConvertPointToScreen(this, &point); + views::View::ConvertPointToScreen(this, &point); download_util::DownloadDestinationContextMenu menu( model_, GetContainer()->GetHWND(), point.ToPOINT()); @@ -707,7 +706,7 @@ bool DownloadItemTabView::OnMousePressed(const ChromeViews::MouseEvent& event) { } // Handle drag (file copy) operations. -bool DownloadItemTabView::OnMouseDragged(const ChromeViews::MouseEvent& event) { +bool DownloadItemTabView::OnMouseDragged(const views::MouseEvent& event) { if (model_->state() != DownloadItem::COMPLETE || model_->safety_state() == DownloadItem::DANGEROUS) return false; @@ -734,11 +733,10 @@ bool DownloadItemTabView::OnMouseDragged(const ChromeViews::MouseEvent& event) { return true; } -void DownloadItemTabView::LinkActivated(ChromeViews::Link* source, - int event_flags) { +void DownloadItemTabView::LinkActivated(views::Link* source, int event_flags) { // There are several links in our view that could have been clicked: if (source == file_name_) { - ChromeViews::Container* container = this->GetContainer(); + views::Container* container = this->GetContainer(); HWND parent_window = container ? container->GetHWND() : NULL; model_->manager()->OpenDownloadInShell(model_, parent_window); } else if (source == pause_) { @@ -754,7 +752,7 @@ void DownloadItemTabView::LinkActivated(ChromeViews::Link* source, parent_->ItemBecameSelected(model_); } -void DownloadItemTabView::ButtonPressed(ChromeViews::NativeButton* sender) { +void DownloadItemTabView::ButtonPressed(views::NativeButton* sender) { if (sender == save_button_) { parent_->model()->DangerousDownloadValidated(model_); // Relayout and repaint to display the right mode (complete or in progress). @@ -841,7 +839,7 @@ void DownloadTabView::Layout() { // Paint our scrolled region void DownloadTabView::Paint(ChromeCanvas* canvas) { - ChromeViews::View::Paint(canvas); + views::View::Paint(canvas); if (download_util::kBigIconSize == 0 || downloads_.size() == 0) return; @@ -892,7 +890,7 @@ bool DownloadTabView::GetFloatingViewIDForPoint(int x, int y, int* id) { return false; } -ChromeViews::View* DownloadTabView::CreateFloatingViewForIndex(int index) { +views::View* DownloadTabView::CreateFloatingViewForIndex(int index) { if (index >= static_cast<int>(downloads_.size())) { // It's possible that the downloads have been cleared via the "Clear // Browsing Data" command, so this index is gone. @@ -913,14 +911,14 @@ ChromeViews::View* DownloadTabView::CreateFloatingViewForIndex(int index) { } bool DownloadTabView::EnumerateFloatingViews( - ChromeViews::View::FloatingViewPosition position, + views::View::FloatingViewPosition position, int starting_id, int* id) { DCHECK(id); return View::EnumerateFloatingViewsForInterval( 0, static_cast<int>(downloads_.size()), false, position, starting_id, id); } -ChromeViews::View* DownloadTabView::ValidateFloatingViewForID(int id) { +views::View* DownloadTabView::ValidateFloatingViewForID(int id) { return CreateFloatingViewForIndex(id); } @@ -1107,14 +1105,14 @@ bool DownloadTabView::ShouldDrawDateForDownload(DownloadItem* download) { } int DownloadTabView::GetPageScrollIncrement( - ChromeViews::ScrollView* scroll_view, bool is_horizontal, + views::ScrollView* scroll_view, bool is_horizontal, bool is_positive) { return scroll_helper_.GetPageScrollIncrement(scroll_view, is_horizontal, is_positive); } int DownloadTabView::GetLineScrollIncrement( - ChromeViews::ScrollView* scroll_view, bool is_horizontal, + views::ScrollView* scroll_view, bool is_horizontal, bool is_positive) { return scroll_helper_.GetLineScrollIncrement(scroll_view, is_horizontal, is_positive); @@ -1248,7 +1246,7 @@ const std::wstring DownloadTabUI::GetSearchButtonText() const { return l10n_util::GetString(IDS_DOWNLOAD_SEARCH_BUTTON); } -ChromeViews::View* DownloadTabUI::GetView() { +views::View* DownloadTabUI::GetView() { return &searchable_container_; } diff --git a/chrome/browser/views/download_tab_view.h b/chrome/browser/views/download_tab_view.h index 6152908..1ba7433 100644 --- a/chrome/browser/views/download_tab_view.h +++ b/chrome/browser/views/download_tab_view.h @@ -24,9 +24,9 @@ namespace base { class Timer; } -class DownloadItemTabView : public ChromeViews::View, - public ChromeViews::LinkController, - public ChromeViews::NativeButton::Listener { +class DownloadItemTabView : public views::View, + public views::LinkController, + public views::NativeButton::Listener { public: DownloadItemTabView(); virtual ~DownloadItemTabView(); @@ -36,8 +36,8 @@ class DownloadItemTabView : public ChromeViews::View, virtual void Paint(ChromeCanvas* canvas); void PaintBackground(ChromeCanvas* canvas); virtual gfx::Size GetPreferredSize(); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); + virtual bool OnMousePressed(const views::MouseEvent& event); + virtual bool OnMouseDragged(const views::MouseEvent& event); // Mode specific layouts void LayoutDate(); @@ -47,10 +47,10 @@ class DownloadItemTabView : public ChromeViews::View, void LayoutPromptDangerousDownload(); // LinkController overrides - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); // NativeButton Listener overrides. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // Used to set our model temporarily during layout and paint operations void SetModel(DownloadItem* model, DownloadTabView* parent); @@ -66,31 +66,31 @@ private: bool is_floating_view_renderer_; // Time display. - ChromeViews::Label* since_; - ChromeViews::Label* date_; + views::Label* since_; + views::Label* date_; // The name of the file. Clicking this link will open the download. - ChromeViews::Link* file_name_; + views::Link* file_name_; // The name of the downloaded URL. - ChromeViews::Label* download_url_; + views::Label* download_url_; // The current status of the download. - ChromeViews::Label* time_remaining_; - ChromeViews::Label* download_progress_; + views::Label* time_remaining_; + views::Label* download_progress_; // The message warning of a dangerous download. - ChromeViews::Label* dangerous_download_warning_; + views::Label* dangerous_download_warning_; // Actions that can be initiated. - ChromeViews::Link* pause_; - ChromeViews::Link* cancel_; - ChromeViews::Link* show_; + views::Link* pause_; + views::Link* cancel_; + views::Link* show_; // The buttons used to prompt the user when a dangerous download has been // initiated. - ChromeViews::NativeButton* save_button_; - ChromeViews::NativeButton* discard_button_; + views::NativeButton* save_button_; + views::NativeButton* discard_button_; DISALLOW_EVIL_CONSTRUCTORS(DownloadItemTabView); }; @@ -98,7 +98,7 @@ private: // A view that manages each of the individual download views // (DownloadItemTabView) in the destination tab. -class DownloadTabView : public ChromeViews::View, +class DownloadTabView : public views::View, public DownloadItem::Observer, public DownloadManager::Observer { public: @@ -114,9 +114,9 @@ class DownloadTabView : public ChromeViews::View, virtual void Paint(ChromeCanvas* canvas); virtual bool GetFloatingViewIDForPoint(int x, int y, int* id); virtual bool EnumerateFloatingViews( - ChromeViews::View::FloatingViewPosition position, + views::View::FloatingViewPosition position, int starting_id, int* id); - virtual ChromeViews::View* ValidateFloatingViewForID(int id); + virtual views::View* ValidateFloatingViewForID(int id); // DownloadItem::Observer interface virtual void OnDownloadUpdated(DownloadItem* download); @@ -142,9 +142,9 @@ class DownloadTabView : public ChromeViews::View, // Determine if we should draw the date beside a particular download bool ShouldDrawDateForDownload(DownloadItem* download); - virtual int GetPageScrollIncrement(ChromeViews::ScrollView* scroll_view, + virtual int GetPageScrollIncrement(views::ScrollView* scroll_view, bool is_horizontal, bool is_positive); - virtual int GetLineScrollIncrement(ChromeViews::ScrollView* scroll_view, + virtual int GetLineScrollIncrement(views::ScrollView* scroll_view, bool is_horizontal, bool is_positive); int start_angle() const { return start_angle_; } @@ -159,7 +159,7 @@ class DownloadTabView : public ChromeViews::View, private: // Creates and attaches to the view the floating view at |index|. - ChromeViews::View* CreateFloatingViewForIndex(int index); + views::View* CreateFloatingViewForIndex(int index); // Utility functions for operating on DownloadItemTabViews by index. void SchedulePaintForViewAtIndex(int index); @@ -203,7 +203,7 @@ class DownloadTabView : public ChromeViews::View, // Provide a start position for downloads with no known size. int start_angle_; - ChromeViews::FixedRowHeightScrollHelper scroll_helper_; + views::FixedRowHeightScrollHelper scroll_helper_; // Keep track of the currently selected view, so that we can inform it when // the user changes the selection. @@ -234,7 +234,7 @@ class DownloadTabUI : public NativeUI, virtual const int GetFavIconID() const; virtual const int GetSectionIconID() const; virtual const std::wstring GetSearchButtonText() const; - virtual ChromeViews::View* GetView(); + virtual views::View* GetView(); virtual void WillBecomeVisible(NativeUIContents* parent); virtual void WillBecomeInvisible(NativeUIContents* parent); virtual void Navigate(const PageState& state); diff --git a/chrome/browser/views/edit_keyword_controller.cc b/chrome/browser/views/edit_keyword_controller.cc index ba9fcbb..0ae528b 100644 --- a/chrome/browser/views/edit_keyword_controller.cc +++ b/chrome/browser/views/edit_keyword_controller.cc @@ -24,9 +24,9 @@ #include "generated_resources.h" -using ChromeViews::GridLayout; -using ChromeViews::ImageView; -using ChromeViews::TextField; +using views::GridLayout; +using views::ImageView; +using views::TextField; namespace { @@ -53,8 +53,8 @@ EditKeywordController::EditKeywordController( void EditKeywordController::Show() { // Window interprets an empty rectangle as needing to query the content for // the size as well as centering relative to the parent. - ChromeViews::Window::CreateChromeWindow(::IsWindow(parent_) ? parent_ : NULL, - gfx::Rect(), this); + views::Window::CreateChromeWindow(::IsWindow(parent_) ? parent_ : NULL, + gfx::Rect(), this); window()->Show(); GetDialogClientView()->UpdateDialogButtons(); title_tf_->SelectAll(); @@ -152,7 +152,7 @@ bool EditKeywordController::Accept() { return true; } -ChromeViews::View* EditKeywordController::GetContentsView() { +views::View* EditKeywordController::GetContentsView() { return view_; } @@ -171,7 +171,7 @@ void EditKeywordController::HandleKeystroke(TextField* sender, void EditKeywordController::Init() { // Create the views we'll need. - view_ = new ChromeViews::View(); + view_ = new views::View(); if (template_url_) { title_tf_ = CreateTextField(template_url_->short_name()); keyword_tf_ = CreateTextField(template_url_->keyword()); @@ -201,7 +201,7 @@ void EditKeywordController::Init() { // Define the structure of the layout. // For the buttons. - ChromeViews::ColumnSet* column_set = layout->AddColumnSet(0); + views::ColumnSet* column_set = layout->AddColumnSet(0); column_set->AddPaddingColumn(1, 0); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); @@ -264,17 +264,16 @@ void EditKeywordController::Init() { reversed_percent); } - ChromeViews::Label* description_label = new ChromeViews::Label(description); - description_label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Label* description_label = new views::Label(description); + description_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); layout->AddView(description_label); layout->AddPaddingRow(0, related_y); } -ChromeViews::Label* EditKeywordController::CreateLabel(int message_id) { - ChromeViews::Label* label = new ChromeViews::Label( - l10n_util::GetString(message_id)); - label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); +views::Label* EditKeywordController::CreateLabel(int message_id) { + views::Label* label = new views::Label(l10n_util::GetString(message_id)); + label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); return label; } diff --git a/chrome/browser/views/edit_keyword_controller.h b/chrome/browser/views/edit_keyword_controller.h index 70e9ed8..fa01a4f 100644 --- a/chrome/browser/views/edit_keyword_controller.h +++ b/chrome/browser/views/edit_keyword_controller.h @@ -15,10 +15,10 @@ #include "chrome/views/dialog_delegate.h" #include "chrome/views/text_field.h" -namespace ChromeViews { - class Label; - class ImageView; - class Window; +namespace views { +class Label; +class ImageView; +class Window; } class KeywordEditorView; @@ -26,8 +26,8 @@ class Profile; class TemplateURL; class TemplateURLModel; -class EditKeywordController : public ChromeViews::TextField::Controller, - public ChromeViews::DialogDelegate { +class EditKeywordController : public views::TextField::Controller, + public views::DialogDelegate { public: // The template_url and/or keyword_editor_view may be NULL. EditKeywordController(HWND parent, @@ -49,14 +49,14 @@ class EditKeywordController : public ChromeViews::TextField::Controller, virtual void WindowClosing(); virtual bool Cancel(); virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::TextField::Controller overrides. Updates whether the user can + // views::TextField::Controller overrides. Updates whether the user can // accept the dialog as well as updating image views showing whether value is // valid. - virtual void ContentsChanged(ChromeViews::TextField* sender, + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, @@ -66,10 +66,10 @@ class EditKeywordController : public ChromeViews::TextField::Controller, void Init(); // Create a Label containing the text with the specified message id. - ChromeViews::Label* CreateLabel(int message_id); + views::Label* CreateLabel(int message_id); // Creates a text field with the specified text. - ChromeViews::TextField* CreateTextField(const std::wstring& text); + views::TextField* CreateTextField(const std::wstring& text); // Returns true if the currently input URL is valid. The URL is valid if it // contains no search terms and is a valid url, or if it contains a search @@ -92,7 +92,7 @@ class EditKeywordController : public ChromeViews::TextField::Controller, // Updates the tooltip and image of the image view based on is_valid. If // is_valid is false the tooltip of the image view is set to the message with // id invalid_message_id, otherwise the tooltip is set to the empty text. - void UpdateImageView(ChromeViews::ImageView* image_view, + void UpdateImageView(views::ImageView* image_view, bool is_valid, int invalid_message_id); @@ -109,7 +109,7 @@ class EditKeywordController : public ChromeViews::TextField::Controller, HWND parent_; // View containing the buttons, text fields ... - ChromeViews::View* view_; + views::View* view_; // We may have been created by this, in which case we will call back to it on // success to add/modify the entry. May be NULL. @@ -119,14 +119,14 @@ class EditKeywordController : public ChromeViews::TextField::Controller, Profile* profile_; // Text fields. - ChromeViews::TextField* title_tf_; - ChromeViews::TextField* keyword_tf_; - ChromeViews::TextField* url_tf_; + views::TextField* title_tf_; + views::TextField* keyword_tf_; + views::TextField* url_tf_; // Shows error images. - ChromeViews::ImageView* title_iv_; - ChromeViews::ImageView* keyword_iv_; - ChromeViews::ImageView* url_iv_; + views::ImageView* title_iv_; + views::ImageView* keyword_iv_; + views::ImageView* url_iv_; DISALLOW_EVIL_CONSTRUCTORS(EditKeywordController); }; diff --git a/chrome/browser/views/event_utils.cc b/chrome/browser/views/event_utils.cc index b12aa910..82dfd29 100644 --- a/chrome/browser/views/event_utils.cc +++ b/chrome/browser/views/event_utils.cc @@ -6,7 +6,7 @@ #include "chrome/views/event.h" -using ChromeViews::Event; +using views::Event; namespace event_utils { @@ -24,7 +24,7 @@ WindowOpenDisposition DispositionFromEventFlags(int event_flags) { return false /*event.IsAltDown()*/ ? SAVE_TO_DISK : CURRENT_TAB; } -bool IsPossibleDispositionEvent(const ChromeViews::MouseEvent& event) { +bool IsPossibleDispositionEvent(const views::MouseEvent& event) { return event.IsLeftMouseButton() || event.IsMiddleMouseButton(); } diff --git a/chrome/browser/views/event_utils.h b/chrome/browser/views/event_utils.h index 01f4f55..233cf4b 100644 --- a/chrome/browser/views/event_utils.h +++ b/chrome/browser/views/event_utils.h @@ -7,7 +7,7 @@ #include "webkit/glue/window_open_disposition.h" -namespace ChromeViews { +namespace views { class MouseEvent; } @@ -15,12 +15,12 @@ namespace event_utils { // Translates event flags into what kind of disposition they represents. // For example, a middle click would mean to open a background tab. -// event_flags are the flags as understood by ChromeViews::MouseEvent. +// event_flags are the flags as understood by views::MouseEvent. WindowOpenDisposition DispositionFromEventFlags(int event_flags); // Returns true if the specified mouse event may have a // WindowOptionDisposition. -bool IsPossibleDispositionEvent(const ChromeViews::MouseEvent& event); +bool IsPossibleDispositionEvent(const views::MouseEvent& event); } diff --git a/chrome/browser/views/external_protocol_dialog.cc b/chrome/browser/views/external_protocol_dialog.cc index cc85b0e..aa9308d 100644 --- a/chrome/browser/views/external_protocol_dialog.cc +++ b/chrome/browser/views/external_protocol_dialog.cc @@ -41,7 +41,7 @@ ExternalProtocolDialog::~ExternalProtocolDialog() { } ////////////////////////////////////////////////////////////////////////////// -// ExternalProtocolDialog, ChromeViews::DialogDelegate implementation: +// ExternalProtocolDialog, views::DialogDelegate implementation: int ExternalProtocolDialog::GetDialogButtons() const { return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; @@ -82,7 +82,7 @@ bool ExternalProtocolDialog::Accept() { return true; } -ChromeViews::View* ExternalProtocolDialog::GetContentsView() { +views::View* ExternalProtocolDialog::GetContentsView() { return message_box_view_; } @@ -116,7 +116,7 @@ ExternalProtocolDialog::ExternalProtocolDialog(TabContents* tab_contents, root_hwnd = NULL; } - ChromeViews::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this)->Show(); + views::Window::CreateChromeWindow(root_hwnd, gfx::Rect(), this)->Show(); } /* static */ diff --git a/chrome/browser/views/external_protocol_dialog.h b/chrome/browser/views/external_protocol_dialog.h index 0c48e34..2247765 100644 --- a/chrome/browser/views/external_protocol_dialog.h +++ b/chrome/browser/views/external_protocol_dialog.h @@ -11,7 +11,7 @@ class MessageBoxView; class TabContents; -class ExternalProtocolDialog : public ChromeViews::DialogDelegate { +class ExternalProtocolDialog : public views::DialogDelegate { public: // Creates and runs a External Protocol dialog box. // |url| - The url of the request. @@ -34,16 +34,16 @@ class ExternalProtocolDialog : public ChromeViews::DialogDelegate { virtual ~ExternalProtocolDialog(); - // ChromeViews::DialogDelegate Methods: + // views::DialogDelegate Methods: virtual int GetDialogButtons() const; virtual int GetDefaultDialogButton() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::WindowDelegate Methods: + // views::WindowDelegate Methods: virtual bool IsAlwaysOnTop() const { return false; } virtual bool IsModal() const { return false; } diff --git a/chrome/browser/views/first_run_bubble.cc b/chrome/browser/views/first_run_bubble.cc index 1032a07..1b3e101 100644 --- a/chrome/browser/views/first_run_bubble.cc +++ b/chrome/browser/views/first_run_bubble.cc @@ -45,8 +45,8 @@ std::wstring GetDefaultSearchEngineName() { // Implements the client view inside the first run bubble. It is kind of a // dialog-ish view, but is not a true dialog. -class FirstRunBubbleView : public ChromeViews::View, - public ChromeViews::NativeButton::Listener { +class FirstRunBubbleView : public views::View, + public views::NativeButton::Listener { public: explicit FirstRunBubbleView(FirstRunBubble* bubble_window) : bubble_window_(bubble_window), @@ -58,45 +58,44 @@ class FirstRunBubbleView : public ChromeViews::View, ChromeFont& font = ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont); - label1_ = new ChromeViews::Label(l10n_util::GetString(IDS_FR_BUBBLE_TITLE)); + label1_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_TITLE)); label1_->SetFont(font.DeriveFont(3, ChromeFont::BOLD)); - label1_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label1_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(label1_); gfx::Size ps = GetPreferredSize(); - label2_ = - new ChromeViews::Label(l10n_util::GetString(IDS_FR_BUBBLE_SUBTEXT)); + label2_ = new views::Label(l10n_util::GetString(IDS_FR_BUBBLE_SUBTEXT)); label2_->SetMultiLine(true); label2_->SetFont(font); - label2_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label2_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); label2_->SizeToFit(ps.width() - kBubblePadding * 2); AddChildView(label2_); std::wstring question_str = l10n_util::GetStringF(IDS_FR_BUBBLE_QUESTION, GetDefaultSearchEngineName()); - label3_ = new ChromeViews::Label(question_str); + label3_ = new views::Label(question_str); label3_->SetMultiLine(true); label3_->SetFont(font); - label3_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label3_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); label3_->SizeToFit(ps.width() - kBubblePadding * 2); AddChildView(label3_); std::wstring keep_str = l10n_util::GetStringF(IDS_FR_BUBBLE_OK, GetDefaultSearchEngineName()); - keep_button_ = new ChromeViews::NativeButton(keep_str, true); + keep_button_ = new views::NativeButton(keep_str, true); keep_button_->SetListener(this); AddChildView(keep_button_); std::wstring change_str = l10n_util::GetString(IDS_FR_BUBBLE_CHANGE); - change_button_ = new ChromeViews::NativeButton(change_str); + change_button_ = new views::NativeButton(change_str); change_button_->SetListener(this); AddChildView(change_button_); } // Overridden from NativeButton::Listener. - virtual void ButtonPressed(ChromeViews::NativeButton* sender) { + virtual void ButtonPressed(views::NativeButton* sender) { bubble_window_->Close(); if (change_button_ == sender) { Browser* browser = BrowserList::GetLastActive(); @@ -107,7 +106,7 @@ class FirstRunBubbleView : public ChromeViews::View, } } - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual void Layout() { gfx::Size canvas = GetPreferredSize(); @@ -154,20 +153,20 @@ class FirstRunBubbleView : public ChromeViews::View, keep_button_->RequestFocus(); } - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual gfx::Size GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_FIRSTRUNBUBBLE_DIALOG_WIDTH_CHARS, IDS_FIRSTRUNBUBBLE_DIALOG_HEIGHT_LINES)); } private: FirstRunBubble* bubble_window_; - ChromeViews::Label* label1_; - ChromeViews::Label* label2_; - ChromeViews::Label* label3_; - ChromeViews::NativeButton* change_button_; - ChromeViews::NativeButton* keep_button_; + views::Label* label1_; + views::Label* label2_; + views::Label* label3_; + views::NativeButton* change_button_; + views::NativeButton* keep_button_; DISALLOW_EVIL_CONSTRUCTORS(FirstRunBubbleView); }; @@ -204,7 +203,7 @@ void FirstRunBubble::InfoBubbleClosing(InfoBubble* info_bubble) { FirstRunBubble* FirstRunBubble::Show(HWND parent_hwnd, const gfx::Rect& position_relative_to) { FirstRunBubble* window = new FirstRunBubble(); - ChromeViews::View* view = new FirstRunBubbleView(window); + views::View* view = new FirstRunBubbleView(window); window->SetDelegate(window); window->Init(parent_hwnd, position_relative_to, view); BrowserWindow* frame = window->GetHostingWindow(); diff --git a/chrome/browser/views/first_run_customize_view.cc b/chrome/browser/views/first_run_customize_view.cc index 4a89b5b..7ff1b7d 100644 --- a/chrome/browser/views/first_run_customize_view.cc +++ b/chrome/browser/views/first_run_customize_view.cc @@ -48,17 +48,16 @@ FirstRunCustomizeView::FirstRunCustomizeView(Profile* profile, FirstRunCustomizeView::~FirstRunCustomizeView() { } -ChromeViews::CheckBox* FirstRunCustomizeView::MakeCheckBox(int label_id) { - ChromeViews::CheckBox* cbox = - new ChromeViews::CheckBox(l10n_util::GetString(label_id)); +views::CheckBox* FirstRunCustomizeView::MakeCheckBox(int label_id) { + views::CheckBox* cbox = new views::CheckBox(l10n_util::GetString(label_id)); cbox->SetListener(this); AddChildView(cbox); return cbox; } void FirstRunCustomizeView::SetupControls() { - using ChromeViews::Label; - using ChromeViews::CheckBox; + using views::Label; + using views::CheckBox; main_label_ = new Label(l10n_util::GetString(IDS_FR_CUSTOMIZE_DLG_TEXT)); main_label_->SetMultiLine(true); @@ -67,7 +66,7 @@ void FirstRunCustomizeView::SetupControls() { import_cbox_ = MakeCheckBox(IDS_FR_CUSTOMIZE_IMPORT); - import_from_combo_ = new ChromeViews::ComboBox(this); + import_from_combo_ = new views::ComboBox(this); AddChildView(import_from_combo_); shortcuts_label_ = @@ -84,7 +83,7 @@ void FirstRunCustomizeView::SetupControls() { } gfx::Size FirstRunCustomizeView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_FIRSTRUNCUSTOMIZE_DIALOG_WIDTH_CHARS, IDS_FIRSTRUNCUSTOMIZE_DIALOG_HEIGHT_LINES)); } @@ -155,18 +154,18 @@ void FirstRunCustomizeView::Layout() { AdjustDialogWidth(quick_shortcut_cbox_); } -void FirstRunCustomizeView::ButtonPressed(ChromeViews::NativeButton* sender) { +void FirstRunCustomizeView::ButtonPressed(views::NativeButton* sender) { if (import_cbox_ == sender) { // Disable the import combobox if the user unchecks the checkbox. import_from_combo_->SetEnabled(import_cbox_->IsSelected()); } } -int FirstRunCustomizeView::GetItemCount(ChromeViews::ComboBox* source) { +int FirstRunCustomizeView::GetItemCount(views::ComboBox* source) { return importer_host_->GetAvailableProfileCount(); } -std::wstring FirstRunCustomizeView::GetItemAt(ChromeViews::ComboBox* source, +std::wstring FirstRunCustomizeView::GetItemAt(views::ComboBox* source, int index) { return importer_host_->GetSourceProfileNameAt(index); } @@ -175,7 +174,7 @@ std::wstring FirstRunCustomizeView::GetWindowTitle() const { return l10n_util::GetString(IDS_FR_CUSTOMIZE_DLG_TITLE); } -ChromeViews::View* FirstRunCustomizeView::GetContentsView() { +views::View* FirstRunCustomizeView::GetContentsView() { return this; } diff --git a/chrome/browser/views/first_run_customize_view.h b/chrome/browser/views/first_run_customize_view.h index 8d17187..6a20a14 100644 --- a/chrome/browser/views/first_run_customize_view.h +++ b/chrome/browser/views/first_run_customize_view.h @@ -11,7 +11,7 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class Window; class ImageView; @@ -24,8 +24,8 @@ class Profile; // FirstRunCustomizeView implements the dialog that allows the user to do // some simple customizations during the first run. class FirstRunCustomizeView : public FirstRunViewBase, - public ChromeViews::NativeButton::Listener, - public ChromeViews::ComboBox::Model { + public views::NativeButton::Listener, + public views::ComboBox::Model { public: class CustomizeViewObserver { public: @@ -41,24 +41,24 @@ class FirstRunCustomizeView : public FirstRunViewBase, bool default_browser_checked); virtual ~FirstRunCustomizeView(); - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual gfx::Size GetPreferredSize(); virtual void Layout(); - // Overridden from ChromeViews::DialogDelegate. + // Overridden from views::DialogDelegate. virtual bool Accept(); virtual bool Cancel(); - // Overridden form ChromeViews::NativeButton::Listener. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden form views::NativeButton::Listener. + virtual void ButtonPressed(views::NativeButton* sender); - // Overridden form ChromeViews::ComboBox::Model. - virtual int GetItemCount(ChromeViews::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + // Overridden form views::ComboBox::Model. + virtual int GetItemCount(views::ComboBox* source); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); - // Overridden from ChromeViews::WindowDelegate. + // Overridden from views::WindowDelegate. virtual std::wstring GetWindowTitle() const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // Yes, we're modal. // NOTE: if you change this you'll need to make sure it isn't possible to // close the window while importing. @@ -68,14 +68,14 @@ class FirstRunCustomizeView : public FirstRunViewBase, // Initializes the controls on the dialog. void SetupControls(); - ChromeViews::CheckBox* MakeCheckBox(int resource_id); + views::CheckBox* MakeCheckBox(int resource_id); - ChromeViews::Label* main_label_; - ChromeViews::CheckBox* import_cbox_; - ChromeViews::ComboBox* import_from_combo_; - ChromeViews::Label* shortcuts_label_; - ChromeViews::CheckBox* desktop_shortcut_cbox_; - ChromeViews::CheckBox* quick_shortcut_cbox_; + views::Label* main_label_; + views::CheckBox* import_cbox_; + views::ComboBox* import_from_combo_; + views::Label* shortcuts_label_; + views::CheckBox* desktop_shortcut_cbox_; + views::CheckBox* quick_shortcut_cbox_; CustomizeViewObserver* customize_observer_; diff --git a/chrome/browser/views/first_run_view.cc b/chrome/browser/views/first_run_view.cc index 72ed29a..ee1c715 100644 --- a/chrome/browser/views/first_run_view.cc +++ b/chrome/browser/views/first_run_view.cc @@ -53,8 +53,8 @@ FirstRunView::~FirstRunView() { } void FirstRunView::SetupControls() { - using ChromeViews::Label; - using ChromeViews::Link; + using views::Label; + using views::Link; default_browser_->SetIsSelected(true); @@ -95,7 +95,7 @@ void FirstRunView::SetupControls() { } gfx::Size FirstRunView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_FIRSTRUN_DIALOG_WIDTH_CHARS, IDS_FIRSTRUN_DIALOG_HEIGHT_LINES)); } @@ -150,7 +150,7 @@ void FirstRunView::Layout() { void FirstRunView::OpenCustomizeDialog() { // The customize dialog now owns the importer host object. - ChromeViews::Window::CreateChromeWindow( + views::Window::CreateChromeWindow( window()->GetHWND(), gfx::Rect(), new FirstRunCustomizeView(profile_, @@ -159,7 +159,7 @@ void FirstRunView::OpenCustomizeDialog() { default_browser_->IsSelected()))->Show(); } -void FirstRunView::LinkActivated(ChromeViews::Link* source, int event_flags) { +void FirstRunView::LinkActivated(views::Link* source, int event_flags) { OpenCustomizeDialog(); } @@ -167,7 +167,7 @@ std::wstring FirstRunView::GetWindowTitle() const { return l10n_util::GetString(IDS_FIRSTRUN_DLG_TITLE); } -ChromeViews::View* FirstRunView::GetContentsView() { +views::View* FirstRunView::GetContentsView() { return this; } diff --git a/chrome/browser/views/first_run_view.h b/chrome/browser/views/first_run_view.h index 45e576a..5565b9a 100644 --- a/chrome/browser/views/first_run_view.h +++ b/chrome/browser/views/first_run_view.h @@ -11,7 +11,7 @@ #include "chrome/views/link.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class Window; } @@ -22,26 +22,26 @@ class ImporterHost; // FirstRunView implements the dialog that welcomes to user to Chrome after // a fresh install. class FirstRunView : public FirstRunViewBase, - public ChromeViews::LinkController, + public views::LinkController, public FirstRunCustomizeView::CustomizeViewObserver { public: explicit FirstRunView(Profile* profile); virtual ~FirstRunView(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); virtual void Layout(); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual bool Accept(); virtual bool Cancel(); - // Overridden from ChromeViews::WindowDelegate: + // Overridden from views::WindowDelegate: virtual std::wstring GetWindowTitle() const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::LinkActivated: - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + // Overridden from views::LinkActivated: + virtual void LinkActivated(views::Link* source, int event_flags); // Overridden from FirstRunCustomizeView: virtual void CustomizeAccepted(); @@ -54,11 +54,11 @@ class FirstRunView : public FirstRunViewBase, // Creates the dialog that allows the user to customize work items. void OpenCustomizeDialog(); - ChromeViews::Label* welcome_label_; - ChromeViews::Label* actions_label_; - ChromeViews::Label* actions_import_; - ChromeViews::Label* actions_shorcuts_; - ChromeViews::Link* customize_link_; + views::Label* welcome_label_; + views::Label* actions_label_; + views::Label* actions_import_; + views::Label* actions_shorcuts_; + views::Link* customize_link_; bool customize_selected_; DISALLOW_COPY_AND_ASSIGN(FirstRunView); diff --git a/chrome/browser/views/first_run_view_base.cc b/chrome/browser/views/first_run_view_base.cc index 3f5e869..1fa049b 100644 --- a/chrome/browser/views/first_run_view_base.cc +++ b/chrome/browser/views/first_run_view_base.cc @@ -60,12 +60,12 @@ FirstRunViewBase::~FirstRunViewBase() { } void FirstRunViewBase::SetupControls() { - using ChromeViews::Label; - using ChromeViews::ImageView; - using ChromeViews::Background; + using views::Label; + using views::ImageView; + using views::Background; ResourceBundle& rb = ResourceBundle::GetSharedInstance(); - background_image_ = new ChromeViews::ImageView(); + background_image_ = new views::ImageView(); background_image_->SetImage(rb.GetBitmapNamed(IDR_WIZARD_ICON)); background_image_->SetHorizontalAlignment(ImageView::TRAILING); @@ -93,21 +93,21 @@ void FirstRunViewBase::SetupControls() { AddChildView(background_image_); // The first separator marks the end of the image. - separator_1_ = new ChromeViews::Separator; + separator_1_ = new views::Separator; AddChildView(separator_1_); // The "make us default browser" check box. - default_browser_ = new ChromeViews::CheckBox( + default_browser_ = new views::CheckBox( l10n_util::GetString(IDS_FR_CUSTOMIZE_DEFAULT_BROWSER)); default_browser_->SetMultiLine(true); AddChildView(default_browser_); // The second separator marks the start of buttons. - separator_2_ = new ChromeViews::Separator; + separator_2_ = new views::Separator; AddChildView(separator_2_); } -void FirstRunViewBase::AdjustDialogWidth(const ChromeViews::View* sub_view) { +void FirstRunViewBase::AdjustDialogWidth(const views::View* sub_view) { gfx::Rect sub_view_bounds = sub_view->bounds(); preferred_width_ = std::max(preferred_width_, @@ -179,7 +179,7 @@ int FirstRunViewBase::GetDefaultImportItems() const { void FirstRunViewBase::DisableButtons() { window()->EnableClose(false); - ChromeViews::DialogClientView* dcv = GetDialogClientView(); + views::DialogClientView* dcv = GetDialogClientView(); dcv->ok_button()->SetEnabled(false); dcv->cancel_button()->SetEnabled(false); default_browser_->SetEnabled(false); diff --git a/chrome/browser/views/first_run_view_base.h b/chrome/browser/views/first_run_view_base.h index 1d1d9a5..6a93524 100644 --- a/chrome/browser/views/first_run_view_base.h +++ b/chrome/browser/views/first_run_view_base.h @@ -9,7 +9,7 @@ #include "chrome/views/dialog_delegate.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class CheckBox; class Window; class ImageView; @@ -23,22 +23,22 @@ class ImporterHost; // This class abstracts the code that creates the dialog look for the two // first-run dialogs. This amounts to the bitmap, the two separators, the // progress throbber and some common resize code. -class FirstRunViewBase : public ChromeViews::View, - public ChromeViews::DialogDelegate { +class FirstRunViewBase : public views::View, + public views::DialogDelegate { public: explicit FirstRunViewBase(Profile* profile); virtual ~FirstRunViewBase(); - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual void Layout(); - // Overridden from ChromeViews::WindowDelegate. + // Overridden from views::WindowDelegate. virtual bool CanResize() const; virtual bool CanMaximize() const; virtual bool IsAlwaysOnTop() const; virtual bool HasAlwaysOnTopMenu() const; - // Overridden from ChromeViews::DialogDelegate. + // Overridden from views::DialogDelegate. std::wstring GetDialogButtonLabel(DialogButton button) const; protected: @@ -60,13 +60,13 @@ class FirstRunViewBase : public ChromeViews::View, // Disables the standard buttons of the dialog. Useful when importing. void DisableButtons(); // Computes a tight dialog width given a contained UI element. - void AdjustDialogWidth(const ChromeViews::View* sub_view); + void AdjustDialogWidth(const views::View* sub_view); // Sets a minimum dialog size. void SetMinimumDialogWidth(int width); // Returns the background image. It is useful for getting the metrics. - const ChromeViews::ImageView* background_image() const { + const views::ImageView* background_image() const { return background_image_; } // Returns the computed preferred width of the dialog. This value can change @@ -77,14 +77,14 @@ class FirstRunViewBase : public ChromeViews::View, scoped_refptr<ImporterHost> importer_host_; Profile* profile_; - ChromeViews::CheckBox* default_browser_; + views::CheckBox* default_browser_; private: // Initializes the controls on the dialog. void SetupControls(); - ChromeViews::ImageView* background_image_; - ChromeViews::Separator* separator_1_; - ChromeViews::Separator* separator_2_; + views::ImageView* background_image_; + views::Separator* separator_1_; + views::Separator* separator_2_; int preferred_width_; DISALLOW_COPY_AND_ASSIGN(FirstRunViewBase); diff --git a/chrome/browser/views/frame/aero_glass_frame.cc b/chrome/browser/views/frame/aero_glass_frame.cc index 7810cac..f38735a 100644 --- a/chrome/browser/views/frame/aero_glass_frame.cc +++ b/chrome/browser/views/frame/aero_glass_frame.cc @@ -86,12 +86,12 @@ void AeroGlassFrame::UpdateThrobber(bool running) { } } -ChromeViews::Window* AeroGlassFrame::GetWindow() { +views::Window* AeroGlassFrame::GetWindow() { return this; } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::ContainerWin implementation: +// AeroGlassFrame, views::ContainerWin implementation: void AeroGlassFrame::OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu) { @@ -183,15 +183,14 @@ LRESULT AeroGlassFrame::OnNCHitTest(const CPoint& pt) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassFrame, ChromeViews::ContainerWin overrides: +// AeroGlassFrame, views::ContainerWin overrides: -bool AeroGlassFrame::AcceleratorPressed( - ChromeViews::Accelerator* accelerator) { +bool AeroGlassFrame::AcceleratorPressed(views::Accelerator* accelerator) { return browser_view_->AcceleratorPressed(*accelerator); } bool AeroGlassFrame::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { + views::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/views/frame/aero_glass_frame.h b/chrome/browser/views/frame/aero_glass_frame.h index ccdec53..09e391a 100644 --- a/chrome/browser/views/frame/aero_glass_frame.h +++ b/chrome/browser/views/frame/aero_glass_frame.h @@ -19,7 +19,7 @@ class BrowserView2; // areas are drawn by the system. // class AeroGlassFrame : public BrowserFrame, - public ChromeViews::Window { + public views::Window { public: explicit AeroGlassFrame(BrowserView2* browser_view); virtual ~AeroGlassFrame(); @@ -36,15 +36,14 @@ class AeroGlassFrame : public BrowserFrame, virtual void SizeToContents(const gfx::Rect& contents_bounds) {} virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); - virtual ChromeViews::Window* GetWindow(); + virtual views::Window* GetWindow(); - // Overridden from ChromeViews::ContainerWin: - virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + // Overridden from views::ContainerWin: + virtual bool AcceleratorPressed(views::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); protected: - // Overridden from ChromeViews::ContainerWin: + // Overridden from views::ContainerWin: virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnExitMenuLoop(bool is_track_popup_menu); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.cc b/chrome/browser/views/frame/aero_glass_non_client_view.cc index 65b9f9d..e48214e 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.cc +++ b/chrome/browser/views/frame/aero_glass_non_client_view.cc @@ -37,7 +37,7 @@ class AeroGlassWindowResources { AeroGlassWindowResources() { InitClass(); } virtual ~AeroGlassWindowResources() { } - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -156,7 +156,7 @@ gfx::Rect AeroGlassNonClientView::GetBoundsForTabStrip(TabStrip* tabstrip) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassNonClientView, ChromeViews::NonClientView implementation: +// AeroGlassNonClientView, views::NonClientView implementation: gfx::Rect AeroGlassNonClientView::CalculateClientAreaBounds(int win_width, int win_height) const { @@ -225,7 +225,7 @@ void AeroGlassNonClientView::EnableClose(bool enable) { } /////////////////////////////////////////////////////////////////////////////// -// AeroGlassNonClientView, ChromeViews::View overrides: +// AeroGlassNonClientView, views::View overrides: void AeroGlassNonClientView::Paint(ChromeCanvas* canvas) { PaintOTRAvatar(canvas); @@ -251,8 +251,8 @@ gfx::Size AeroGlassNonClientView::GetPreferredSize() { } void AeroGlassNonClientView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) { DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); diff --git a/chrome/browser/views/frame/aero_glass_non_client_view.h b/chrome/browser/views/frame/aero_glass_non_client_view.h index 2814918..f78d8c1 100644 --- a/chrome/browser/views/frame/aero_glass_non_client_view.h +++ b/chrome/browser/views/frame/aero_glass_non_client_view.h @@ -12,7 +12,7 @@ class BrowserView2; class AeroGlassWindowResources; -class AeroGlassNonClientView : public ChromeViews::NonClientView { +class AeroGlassNonClientView : public views::NonClientView { public: // Constructs a non-client view for an AeroGlassFrame. AeroGlassNonClientView(AeroGlassFrame* frame, BrowserView2* browser_view); @@ -21,7 +21,7 @@ class AeroGlassNonClientView : public ChromeViews::NonClientView { gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip); protected: - // Overridden from ChromeViews::NonClientView: + // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; @@ -30,13 +30,13 @@ class AeroGlassNonClientView : public ChromeViews::NonClientView { virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Returns the height of the non-client area at the top of the window (the diff --git a/chrome/browser/views/frame/browser_frame.h b/chrome/browser/views/frame/browser_frame.h index 5292a59..e7f2d4f 100644 --- a/chrome/browser/views/frame/browser_frame.h +++ b/chrome/browser/views/frame/browser_frame.h @@ -6,7 +6,7 @@ #define CHROME_BROWSER_VIEWS_FRAME_BROWSER_FRAME_H_ class BrowserView2; -namespace ChromeViews { +namespace views { class Window; } namespace gfx { @@ -41,8 +41,8 @@ class BrowserFrame { // |running| is whether or not the throbber should be running. virtual void UpdateThrobber(bool running) = 0; - // Returns the ChromeViews::Window associated with this frame. - virtual ChromeViews::Window* GetWindow() = 0; + // Returns the views::Window associated with this frame. + virtual views::Window* GetWindow() = 0; enum FrameType { FRAMETYPE_OPAQUE, diff --git a/chrome/browser/views/frame/browser_view.cc b/chrome/browser/views/frame/browser_view.cc index 7e8303d..038b26c 100644 --- a/chrome/browser/views/frame/browser_view.cc +++ b/chrome/browser/views/frame/browser_view.cc @@ -29,8 +29,8 @@ static const int kStatusBubbleOffset = 2; BrowserView::BrowserView(BrowserWindow* frame, Browser* browser, - ChromeViews::Window* window, - ChromeViews::View* contents_view) + views::Window* window, + views::View* contents_view) : frame_(frame), browser_(browser), initialized_(false) @@ -123,7 +123,7 @@ void BrowserView::SizeToContents(const gfx::Rect& contents_bounds) { } void BrowserView::SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table) { + std::map<views::Accelerator, int>* accelerator_table) { frame_->SetAcceleratorTable(accelerator_table); } @@ -201,7 +201,7 @@ bool BrowserView::IsBookmarkBarVisible() const { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView, ChromeViews::ClientView overrides: +// BrowserView, views::ClientView overrides: /* bool BrowserView::CanClose() const { @@ -214,15 +214,15 @@ int BrowserView::NonClientHitTest(const gfx::Point& point) { */ /////////////////////////////////////////////////////////////////////////////// -// BrowserView, ChromeViews::View overrides: +// BrowserView, views::View overrides: void BrowserView::Layout() { toolbar_->SetBounds(0, 0, width(), height()); } void BrowserView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this && GetContainer() && !initialized_) { Init(); // Make sure not to call Init() twice if we get inserted into a different diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h index 704d6a7..5d81317 100644 --- a/chrome/browser/views/frame/browser_view.h +++ b/chrome/browser/views/frame/browser_view.h @@ -21,13 +21,13 @@ class BrowserToolbarView; // including the TabStrip, toolbars, download shelves, the content area etc. // class BrowserView : public BrowserWindow, -/* public ChromeViews::ClientView */ - public ChromeViews::View { +/* public views::ClientView */ + public views::View { public: BrowserView(BrowserWindow* frame, Browser* browser, - ChromeViews::Window* window, - ChromeViews::View* contents_view); + views::Window* window, + views::View* contents_view); virtual ~BrowserView(); // TODO(beng): remove this once all layout is done inside this object. @@ -53,7 +53,7 @@ class BrowserView : public BrowserWindow, int frame_component); virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); + std::map<views::Accelerator, int>* accelerator_table); virtual void ValidateThrobber(); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); @@ -72,16 +72,16 @@ class BrowserView : public BrowserWindow, virtual bool IsBookmarkBarVisible() const; /* - // Overridden from ChromeViews::ClientView: + // Overridden from views::ClientView: virtual bool CanClose() const; virtual int NonClientHitTest(const gfx::Point& point); */ - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Layout(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // The Browser object we are associated with. diff --git a/chrome/browser/views/frame/browser_view2.cc b/chrome/browser/views/frame/browser_view2.cc index c1e3588..afa5f3c 100644 --- a/chrome/browser/views/frame/browser_view2.cc +++ b/chrome/browser/views/frame/browser_view2.cc @@ -151,10 +151,9 @@ bool BrowserView2::ShouldShowOffTheRecordAvatar() const { browser_->GetType() == BrowserType::TABBED_BROWSER; } -bool BrowserView2::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { +bool BrowserView2::AcceleratorPressed(const views::Accelerator& accelerator) { DCHECK(accelerator_table_.get()); - std::map<ChromeViews::Accelerator, int>::const_iterator iter = + std::map<views::Accelerator, int>::const_iterator iter = accelerator_table_->find(accelerator); DCHECK(iter != accelerator_table_->end()); @@ -168,8 +167,8 @@ bool BrowserView2::AcceleratorPressed( } bool BrowserView2::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { - std::map<ChromeViews::Accelerator, int>::iterator it = + views::Accelerator* accelerator) { + std::map<views::Accelerator, int>::iterator it = accelerator_table_->begin(); for (; it != accelerator_table_->end(); ++it) { if (it->second == cmd_id) { @@ -192,7 +191,7 @@ bool BrowserView2::SystemCommandReceived(UINT notification_code, return handled; } -void BrowserView2::AddViewToDropList(ChromeViews::View* view) { +void BrowserView2::AddViewToDropList(views::View* view) { dropable_views_.insert(view); } @@ -392,7 +391,7 @@ void BrowserView2::SizeToContents(const gfx::Rect& contents_bounds) { } void BrowserView2::SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table) { + std::map<views::Accelerator, int>* accelerator_table) { accelerator_table_.reset(accelerator_table); } @@ -547,7 +546,7 @@ void BrowserView2::TabStripEmpty() { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::WindowDelegate implementation: +// BrowserView2, views::WindowDelegate implementation: bool BrowserView2::CanResize() const { return true; @@ -565,7 +564,7 @@ std::wstring BrowserView2::GetWindowTitle() const { return browser_->GetCurrentPageTitle(); } -ChromeViews::View* BrowserView2::GetInitiallyFocusedView() const { +views::View* BrowserView2::GetInitiallyFocusedView() const { return GetLocationBarView(); } @@ -658,18 +657,17 @@ bool BrowserView2::RestoreWindowPosition(CRect* bounds, void BrowserView2::WindowClosing() { } -ChromeViews::View* BrowserView2::GetContentsView() { +views::View* BrowserView2::GetContentsView() { return contents_container_; } -ChromeViews::ClientView* BrowserView2::CreateClientView( - ChromeViews::Window* window) { +views::ClientView* BrowserView2::CreateClientView(views::Window* window) { set_window(window); return this; } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::ClientView overrides: +// BrowserView2, views::ClientView overrides: bool BrowserView2::CanClose() const { // You cannot close a frame for which there is an active originating drag @@ -708,7 +706,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { // might be a popup window without a TabStrip, or the TabStrip could be // animating. if (IsTabStripVisible() && tabstrip_->CanProcessInputEvents()) { - ChromeViews::Window* window = frame_->GetWindow(); + views::Window* window = frame_->GetWindow(); gfx::Point point_in_view_coords(point); View::ConvertPointToView(GetParent(), this, &point_in_view_coords); @@ -762,7 +760,7 @@ int BrowserView2::NonClientHitTest(const gfx::Point& point) { } /////////////////////////////////////////////////////////////////////////////// -// BrowserView2, ChromeViews::View overrides: +// BrowserView2, views::View overrides: void BrowserView2::Layout() { int top = LayoutTabStrip(); @@ -783,8 +781,8 @@ void BrowserView2::Layout() { } void BrowserView2::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this && GetContainer() && !initialized_) { Init(); initialized_ = true; @@ -799,19 +797,19 @@ bool BrowserView2::CanDrop(const OSExchangeData& data) { return can_drop_; } -void BrowserView2::OnDragEntered(const ChromeViews::DropTargetEvent& event) { +void BrowserView2::OnDragEntered(const views::DropTargetEvent& event) { if (can_drop_ && ShouldForwardToTabStrip(event)) { forwarding_to_tab_strip_ = true; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); tabstrip_->OnDragEntered(*mapped_event.get()); } } -int BrowserView2::OnDragUpdated(const ChromeViews::DropTargetEvent& event) { +int BrowserView2::OnDragUpdated(const views::DropTargetEvent& event) { if (can_drop_) { if (ShouldForwardToTabStrip(event)) { - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); if (!forwarding_to_tab_strip_) { tabstrip_->OnDragEntered(*mapped_event.get()); @@ -833,10 +831,10 @@ void BrowserView2::OnDragExited() { } } -int BrowserView2::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { +int BrowserView2::OnPerformDrop(const views::DropTargetEvent& event) { if (forwarding_to_tab_strip_) { forwarding_to_tab_strip_ = false; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); return tabstrip_->OnPerformDrop(*mapped_event.get()); } @@ -848,7 +846,7 @@ int BrowserView2::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { // BrowserView2, private: bool BrowserView2::ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event) { + const views::DropTargetEvent& event) { if (!tabstrip_->IsVisible()) return false; @@ -863,18 +861,18 @@ bool BrowserView2::ShouldForwardToTabStrip( // Mouse isn't over the tab strip. Only forward if the mouse isn't over // another view on the tab strip or is over a view we were told the user can // drop on. - ChromeViews::View* view_over_mouse = GetViewForPoint(event.location()); + views::View* view_over_mouse = GetViewForPoint(event.location()); return (view_over_mouse == this || view_over_mouse == tabstrip_ || dropable_views_.find(view_over_mouse) != dropable_views_.end()); } -ChromeViews::DropTargetEvent* BrowserView2::MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event) { +views::DropTargetEvent* BrowserView2::MapEventToTabStrip( + const views::DropTargetEvent& event) { gfx::Point tab_strip_loc(event.location()); ConvertPointToView(this, tabstrip_, &tab_strip_loc); - return new ChromeViews::DropTargetEvent(event.GetData(), tab_strip_loc.x(), - tab_strip_loc.y(), - event.GetSourceOperations()); + return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(), + tab_strip_loc.y(), + event.GetSourceOperations()); } int BrowserView2::LayoutTabStrip() { @@ -972,7 +970,7 @@ void BrowserView2::LayoutStatusBubble(int top) { } bool BrowserView2::MaybeShowBookmarkBar(TabContents* contents) { - ChromeViews::View* new_bookmark_bar_view = NULL; + views::View* new_bookmark_bar_view = NULL; if (SupportsWindowFeature(FEATURE_BOOKMARKBAR) && contents) { new_bookmark_bar_view = GetBookmarkBarView(); if (!show_bookmark_bar_pref_.GetValue() && @@ -985,7 +983,7 @@ bool BrowserView2::MaybeShowBookmarkBar(TabContents* contents) { } bool BrowserView2::MaybeShowInfoBar(TabContents* contents) { - ChromeViews::View* new_info_bar = NULL; + views::View* new_info_bar = NULL; if (contents && contents->AsWebContents() && contents->AsWebContents()->view()->IsInfoBarVisible()) new_info_bar = contents->AsWebContents()->view()->GetInfoBarView(); @@ -993,7 +991,7 @@ bool BrowserView2::MaybeShowInfoBar(TabContents* contents) { } bool BrowserView2::MaybeShowDownloadShelf(TabContents* contents) { - ChromeViews::View* new_shelf = NULL; + views::View* new_shelf = NULL; if (contents && contents->IsDownloadShelfVisible()) new_shelf = contents->GetDownloadShelfView(); return UpdateChildViewAndLayout(new_shelf, &active_download_shelf_); @@ -1007,8 +1005,8 @@ void BrowserView2::UpdateUIForContents(TabContents* contents) { Layout(); } -bool BrowserView2::UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** old_view) { +bool BrowserView2::UpdateChildViewAndLayout(views::View* new_view, + views::View** old_view) { DCHECK(old_view); if (*old_view == new_view) { // The views haven't changed, if the views pref changed schedule a layout. @@ -1067,18 +1065,18 @@ void BrowserView2::LoadAccelerators() { ACCEL* accelerators = static_cast<ACCEL*>(malloc(sizeof(ACCEL) * count)); CopyAcceleratorTable(accelerator_table, accelerators, count); - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetContainer()->GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetContainer()->GetHWND()); DCHECK(focus_manager); // Let's build our own accelerator table. - accelerator_table_.reset(new std::map<ChromeViews::Accelerator, int>); + accelerator_table_.reset(new std::map<views::Accelerator, int>); for (int i = 0; i < count; ++i) { bool alt_down = (accelerators[i].fVirt & FALT) == FALT; bool ctrl_down = (accelerators[i].fVirt & FCONTROL) == FCONTROL; bool shift_down = (accelerators[i].fVirt & FSHIFT) == FSHIFT; - ChromeViews::Accelerator accelerator(accelerators[i].key, - shift_down, ctrl_down, alt_down); + views::Accelerator accelerator(accelerators[i].key, shift_down, ctrl_down, + alt_down); (*accelerator_table_)[accelerator] = accelerators[i].cmd; // Also register with the focus manager. diff --git a/chrome/browser/views/frame/browser_view2.h b/chrome/browser/views/frame/browser_view2.h index dbe4f5d..5dd812d 100644 --- a/chrome/browser/views/frame/browser_view2.h +++ b/chrome/browser/views/frame/browser_view2.h @@ -33,8 +33,8 @@ class TabContentsContainerView; class BrowserView2 : public BrowserWindow, public NotificationObserver, public TabStripModelObserver, - public ChromeViews::WindowDelegate, - public ChromeViews::ClientView { + public views::WindowDelegate, + public views::ClientView { public: explicit BrowserView2(Browser* browser); virtual ~BrowserView2(); @@ -72,13 +72,13 @@ class BrowserView2 : public BrowserWindow, bool ShouldShowOffTheRecordAvatar() const; // Handle the specified |accelerator| being pressed. - bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + bool AcceleratorPressed(const views::Accelerator& accelerator); // Provides the containing frame with the accelerator for the specified // 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, ChromeViews::Accelerator* accelerator); + bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); // Handles incoming system messages. Returns true if the message was // handled. @@ -87,7 +87,7 @@ class BrowserView2 : public BrowserWindow, // Adds view to the set of views that drops are allowed to occur on. You only // need invoke this for views whose y-coordinate extends above the tab strip // and you want to allow drops on. - void AddViewToDropList(ChromeViews::View* view); + void AddViewToDropList(views::View* view); // 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 @@ -150,7 +150,7 @@ class BrowserView2 : public BrowserWindow, int frame_component); virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); + std::map<views::Accelerator, int>* accelerator_table); virtual void ValidateThrobber(); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); @@ -180,12 +180,12 @@ class BrowserView2 : public BrowserWindow, bool user_gesture); virtual void TabStripEmpty(); - // Overridden from ChromeViews::WindowDelegate: + // Overridden from views::WindowDelegate: virtual bool CanResize() const; virtual bool CanMaximize() const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; - virtual ChromeViews::View* GetInitiallyFocusedView() const; + virtual views::View* GetInitiallyFocusedView() const; virtual bool ShouldShowWindowTitle() const; virtual SkBitmap GetWindowIcon(); virtual bool ShouldShowWindowIcon() const; @@ -197,11 +197,10 @@ class BrowserView2 : public BrowserWindow, bool* maximized, bool* always_on_top); virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); - virtual ChromeViews::ClientView* CreateClientView( - ChromeViews::Window* window); + virtual views::View* GetContentsView(); + virtual views::ClientView* CreateClientView(views::Window* window); - // Overridden from ChromeViews::ClientView: + // Overridden from views::ClientView: virtual bool CanClose() const; virtual int NonClientHitTest(const gfx::Point& point); @@ -219,30 +218,29 @@ class BrowserView2 : public BrowserWindow, protected: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Layout(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); // As long as ShouldForwardToTabStrip returns true, drag and drop methods // are forwarded to the tab strip. virtual bool CanDrop(const OSExchangeData& data); - virtual void OnDragEntered(const ChromeViews::DropTargetEvent& event); - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event); + virtual void OnDragEntered(const views::DropTargetEvent& event); + virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event); + virtual int OnPerformDrop(const views::DropTargetEvent& event); private: // Returns true if the event should be forwarded to the TabStrip. This // returns true if y coordinate is less than the bottom of the tab strip, and // is not over another child view. - virtual bool ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event); + virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); // Creates and returns a new DropTargetEvent in the coordinates of the // TabStrip. - ChromeViews::DropTargetEvent* MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event); + views::DropTargetEvent* MapEventToTabStrip( + const views::DropTargetEvent& event); // Layout the TabStrip, returns the coordinate of the bottom of the TabStrip, // for laying out subsequent controls. @@ -291,8 +289,7 @@ class BrowserView2 : public BrowserWindow, // the new_view is added. This is intended to be used when swapping in/out // child views that are referenced via a field. // Returns true if anything was changed, and a re-Layout is now required. - bool UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** old_view); + bool UpdateChildViewAndLayout(views::View* new_view, views::View** old_view); // Copy the accelerator table from the app resources into something we can // use. @@ -314,9 +311,9 @@ class BrowserView2 : public BrowserWindow, scoped_ptr<Browser> browser_; // Tool/Info bars that we are currently showing. Used for layout. - ChromeViews::View* active_bookmark_bar_; - ChromeViews::View* active_info_bar_; - ChromeViews::View* active_download_shelf_; + views::View* active_bookmark_bar_; + views::View* active_info_bar_; + views::View* active_download_shelf_; // The TabStrip. TabStrip* tabstrip_; @@ -334,7 +331,7 @@ class BrowserView2 : public BrowserWindow, scoped_ptr<StatusBubble> status_bubble_; // A mapping between accelerators and commands. - scoped_ptr<std::map<ChromeViews::Accelerator, int>> accelerator_table_; + scoped_ptr<std::map<views::Accelerator, int>> accelerator_table_; // A PrefMember to track the "always show bookmark bar" pref. BooleanPrefMember show_bookmark_bar_pref_; @@ -357,7 +354,7 @@ class BrowserView2 : public BrowserWindow, bool forwarding_to_tab_strip_; // Set of additional views drops are allowed on. We do NOT own these. - std::set<ChromeViews::View*> dropable_views_; + std::set<views::View*> dropable_views_; // The OTR avatar image. static SkBitmap otr_avatar_; diff --git a/chrome/browser/views/frame/opaque_frame.cc b/chrome/browser/views/frame/opaque_frame.cc index 9bf52a3..8187d08 100644 --- a/chrome/browser/views/frame/opaque_frame.cc +++ b/chrome/browser/views/frame/opaque_frame.cc @@ -50,12 +50,12 @@ void OpaqueFrame::UpdateThrobber(bool running) { GetOpaqueNonClientView()->UpdateWindowIcon(); } -ChromeViews::Window* OpaqueFrame::GetWindow() { +views::Window* OpaqueFrame::GetWindow() { return this; } /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, ChromeViews::CustomFrameWindow overrides: +// OpaqueFrame, views::CustomFrameWindow overrides: void OpaqueFrame::UpdateWindowIcon() { CustomFrameWindow::UpdateWindowIcon(); @@ -63,14 +63,13 @@ void OpaqueFrame::UpdateWindowIcon() { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueFrame, ChromeViews::ContainerWin overrides: +// OpaqueFrame, views::ContainerWin overrides: -bool OpaqueFrame::AcceleratorPressed(ChromeViews::Accelerator* accelerator) { +bool OpaqueFrame::AcceleratorPressed(views::Accelerator* accelerator) { return browser_view_->AcceleratorPressed(*accelerator); } -bool OpaqueFrame::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { +bool OpaqueFrame::GetAccelerator(int cmd_id, views::Accelerator* accelerator) { return browser_view_->GetAccelerator(cmd_id, accelerator); } diff --git a/chrome/browser/views/frame/opaque_frame.h b/chrome/browser/views/frame/opaque_frame.h index f40f1a8..fb531b0 100644 --- a/chrome/browser/views/frame/opaque_frame.h +++ b/chrome/browser/views/frame/opaque_frame.h @@ -9,7 +9,7 @@ #include "chrome/views/custom_frame_window.h" class BrowserView2; -namespace ChromeViews { +namespace views { class Window; } class OpaqueNonClientView; @@ -24,7 +24,7 @@ class TabStrip; // borders are provided with bitmaps. // class OpaqueFrame : public BrowserFrame, - public ChromeViews::CustomFrameWindow { + public views::CustomFrameWindow { public: explicit OpaqueFrame(BrowserView2* browser_view); virtual ~OpaqueFrame(); @@ -36,15 +36,14 @@ class OpaqueFrame : public BrowserFrame, virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const; virtual void UpdateThrobber(bool running); - virtual ChromeViews::Window* GetWindow(); + virtual views::Window* GetWindow(); - // Overridden from ChromeViews::CustomFrameWindow: + // Overridden from views::CustomFrameWindow: virtual void UpdateWindowIcon(); - // Overridden from ChromeViews::ContainerWin: - virtual bool AcceleratorPressed(ChromeViews::Accelerator* accelerator); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + // Overridden from views::ContainerWin: + virtual bool AcceleratorPressed(views::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); virtual void OnEndSession(BOOL ending, UINT logoff); virtual void OnExitMenuLoop(bool is_track_popup_menu); virtual void OnInitMenuPopup(HMENU menu, UINT position, BOOL is_system_menu); diff --git a/chrome/browser/views/frame/opaque_non_client_view.cc b/chrome/browser/views/frame/opaque_non_client_view.cc index ac29c56..9c2c174 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.cc +++ b/chrome/browser/views/frame/opaque_non_client_view.cc @@ -65,7 +65,7 @@ enum { FRAME_PART_BITMAP_COUNT // Must be last. }; -class ActiveWindowResources : public WindowResources { +class ActiveWindowResources : public views::WindowResources { public: ActiveWindowResources() { InitClass(); @@ -73,7 +73,7 @@ class ActiveWindowResources : public WindowResources { virtual ~ActiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -116,7 +116,7 @@ class ActiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(ActiveWindowResources); }; -class InactiveWindowResources : public WindowResources { +class InactiveWindowResources : public views::WindowResources { public: InactiveWindowResources() { InitClass(); @@ -124,7 +124,7 @@ class InactiveWindowResources : public WindowResources { virtual ~InactiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -167,7 +167,7 @@ class InactiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(InactiveWindowResources); }; -class OTRActiveWindowResources : public WindowResources { +class OTRActiveWindowResources : public views::WindowResources { public: OTRActiveWindowResources() { InitClass(); @@ -175,7 +175,7 @@ class OTRActiveWindowResources : public WindowResources { virtual ~OTRActiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -217,7 +217,7 @@ class OTRActiveWindowResources : public WindowResources { DISALLOW_EVIL_CONSTRUCTORS(OTRActiveWindowResources); }; -class OTRInactiveWindowResources : public WindowResources { +class OTRInactiveWindowResources : public views::WindowResources { public: OTRInactiveWindowResources() { InitClass(); @@ -225,7 +225,7 @@ class OTRInactiveWindowResources : public WindowResources { virtual ~OTRInactiveWindowResources() { } // WindowResources implementation: - virtual SkBitmap* GetPartBitmap(FramePartBitmap part) const { + virtual SkBitmap* GetPartBitmap(views::FramePartBitmap part) const { return standard_frame_bitmaps_[part]; } @@ -274,10 +274,10 @@ SkBitmap* InactiveWindowResources::standard_frame_bitmaps_[]; SkBitmap* OTRActiveWindowResources::standard_frame_bitmaps_[]; SkBitmap* OTRInactiveWindowResources::standard_frame_bitmaps_[]; -WindowResources* OpaqueNonClientView::active_resources_ = NULL; -WindowResources* OpaqueNonClientView::inactive_resources_ = NULL; -WindowResources* OpaqueNonClientView::active_otr_resources_ = NULL; -WindowResources* OpaqueNonClientView::inactive_otr_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::active_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::inactive_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::active_otr_resources_ = NULL; +views::WindowResources* OpaqueNonClientView::inactive_otr_resources_ = NULL; SkBitmap OpaqueNonClientView::distributor_logo_; SkBitmap OpaqueNonClientView::app_top_left_; SkBitmap OpaqueNonClientView::app_top_center_; @@ -357,10 +357,10 @@ static const int kNewTabIconWindowControlsSpacing = 10; OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, BrowserView2* browser_view) : NonClientView(), - minimize_button_(new ChromeViews::Button), - maximize_button_(new ChromeViews::Button), - restore_button_(new ChromeViews::Button), - close_button_(new ChromeViews::Button), + minimize_button_(new views::Button), + maximize_button_(new views::Button), + restore_button_(new views::Button), + close_button_(new views::Button), window_icon_(NULL), frame_(frame), browser_view_(browser_view) { @@ -378,15 +378,15 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, current_inactive_resources_ = inactive_resources_; } - WindowResources* resources = current_active_resources_; + views::WindowResources* resources = current_active_resources_; minimize_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON)); minimize_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON_H)); minimize_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_MINIMIZE_BUTTON_ICON_P)); minimize_button_->SetListener(this, -1); minimize_button_->SetAccessibleName( @@ -394,13 +394,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(minimize_button_); maximize_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON)); maximize_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON_H)); maximize_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_MAXIMIZE_BUTTON_ICON_P)); maximize_button_->SetListener(this, -1); maximize_button_->SetAccessibleName( @@ -408,13 +408,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(maximize_button_); restore_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON)); restore_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON_H)); restore_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_RESTORE_BUTTON_ICON_P)); restore_button_->SetListener(this, -1); restore_button_->SetAccessibleName( @@ -422,13 +422,13 @@ OpaqueNonClientView::OpaqueNonClientView(OpaqueFrame* frame, AddChildView(restore_button_); close_button_->SetImage( - ChromeViews::Button::BS_NORMAL, + views::Button::BS_NORMAL, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON)); close_button_->SetImage( - ChromeViews::Button::BS_HOT, + views::Button::BS_HOT, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_H)); close_button_->SetImage( - ChromeViews::Button::BS_PUSHED, + views::Button::BS_PUSHED, resources->GetPartBitmap(FRAME_CLOSE_BUTTON_ICON_P)); close_button_->SetListener(this, -1); close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE)); @@ -487,9 +487,9 @@ SkBitmap OpaqueNonClientView::GetFavIcon() { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::BaseButton::ButtonListener implementation: +// OpaqueNonClientView, views::BaseButton::ButtonListener implementation: -void OpaqueNonClientView::ButtonPressed(ChromeViews::BaseButton* sender) { +void OpaqueNonClientView::ButtonPressed(views::BaseButton* sender) { if (sender == minimize_button_) { frame_->ExecuteSystemMenuCommand(SC_MINIMIZE); } else if (sender == maximize_button_) { @@ -502,7 +502,7 @@ void OpaqueNonClientView::ButtonPressed(ChromeViews::BaseButton* sender) { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::NonClientView implementation: +// OpaqueNonClientView, views::NonClientView implementation: gfx::Rect OpaqueNonClientView::CalculateClientAreaBounds(int width, int height) const { @@ -593,7 +593,7 @@ void OpaqueNonClientView::EnableClose(bool enable) { } /////////////////////////////////////////////////////////////////////////////// -// OpaqueNonClientView, ChromeViews::View overrides: +// OpaqueNonClientView, views::View overrides: void OpaqueNonClientView::Paint(ChromeCanvas* canvas) { // Clip the content area out of the rendering. @@ -634,14 +634,13 @@ gfx::Size OpaqueNonClientView::GetPreferredSize() { return prefsize; } -ChromeViews::View* OpaqueNonClientView::GetViewForPoint( - const gfx::Point& point, - bool can_create_floating) { +views::View* OpaqueNonClientView::GetViewForPoint(const gfx::Point& point, + bool can_create_floating) { // We override this function because the ClientView can overlap the non - // client view, making it impossible to click on the window controls. We need // to ensure the window controls are checked _first_. - ChromeViews::View* views[] = { close_button_, restore_button_, - maximize_button_, minimize_button_ }; + views::View* views[] = { close_button_, restore_button_, maximize_button_, + minimize_button_ }; for (int i = 0; i < arraysize(views); ++i) { if (!views[i]->IsVisible()) continue; @@ -652,8 +651,8 @@ ChromeViews::View* OpaqueNonClientView::GetViewForPoint( } void OpaqueNonClientView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) { DCHECK(GetContainer()); DCHECK(frame_->client_view()->GetParent() != this); @@ -776,7 +775,7 @@ void OpaqueNonClientView::PaintDistributorLogo(ChromeCanvas* canvas) { void OpaqueNonClientView::PaintTitleBar(ChromeCanvas* canvas) { // The window icon is painted by the TabIconView. - ChromeViews::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->window_delegate(); if (d->ShouldShowWindowTitle()) { int title_x = MirroredLeftPointForRect(title_bounds_); canvas->DrawStringInt(d->GetWindowTitle(), title_font_, SK_ColorWHITE, @@ -879,50 +878,50 @@ void OpaqueNonClientView::LayoutWindowControls() { if (frame_->IsMaximized()) { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); close_button_->SetBounds( width() - ps.width() - kWindowControlsRightZoomedOffset, 0, ps.width() + kWindowControlsRightZoomedOffset, ps.height() + kWindowControlsTopZoomedOffset); ps = restore_button_->GetPreferredSize(); - restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + restore_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); restore_button_->SetBounds(close_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); minimize_button_->SetBounds(restore_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); } else if (frame_->IsMinimized()) { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); close_button_->SetBounds( width() - ps.width() - kWindowControlsRightZoomedOffset, 0, ps.width() + kWindowControlsRightZoomedOffset, ps.height() + kWindowControlsTopZoomedOffset); ps = restore_button_->GetPreferredSize(); - restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + restore_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); restore_button_->SetBounds(close_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); minimize_button_->SetBounds(restore_button_->x() - ps.width(), 0, ps.width(), ps.height() + kWindowControlsTopZoomedOffset); } else { ps = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); close_button_->SetBounds(width() - kWindowControlsRightOffset - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); @@ -931,15 +930,15 @@ void OpaqueNonClientView::LayoutWindowControls() { maximize_button_->SetVisible(true); ps = maximize_button_->GetPreferredSize(); - maximize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + maximize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); maximize_button_->SetBounds(close_button_->x() - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); ps = minimize_button_->GetPreferredSize(); - minimize_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + minimize_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); minimize_button_->SetBounds(maximize_button_->x() - ps.width(), kWindowControlsTopOffset, ps.width(), ps.height()); @@ -974,7 +973,7 @@ void OpaqueNonClientView::LayoutDistributorLogo() { void OpaqueNonClientView::LayoutTitleBar() { int top_offset = frame_->IsMaximized() ? kWindowTopMarginZoomed : 0; - ChromeViews::WindowDelegate* d = frame_->window_delegate(); + views::WindowDelegate* d = frame_->window_delegate(); // Size the window icon, even if it is hidden so we can size the title based // on its position. diff --git a/chrome/browser/views/frame/opaque_non_client_view.h b/chrome/browser/views/frame/opaque_non_client_view.h index 830ba76..3063b11 100644 --- a/chrome/browser/views/frame/opaque_non_client_view.h +++ b/chrome/browser/views/frame/opaque_non_client_view.h @@ -14,10 +14,12 @@ class BrowserView2; class OpaqueFrame; class TabContents; class TabStrip; +namespace views { class WindowResources; +} -class OpaqueNonClientView : public ChromeViews::NonClientView, - public ChromeViews::BaseButton::ButtonListener, +class OpaqueNonClientView : public views::NonClientView, + public views::BaseButton::ButtonListener, public TabIconView::TabContentsProvider { public: // Constructs a non-client view for an OpaqueFrame. |is_otr| specifies if the @@ -41,10 +43,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, virtual TabContents* GetCurrentTabContents(); virtual SkBitmap GetFavIcon(); - // Overridden from ChromeViews::BaseButton::ButtonListener: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // Overridden from views::BaseButton::ButtonListener: + virtual void ButtonPressed(views::BaseButton* sender); - // Overridden from ChromeViews::NonClientView: + // Overridden from views::NonClientView: virtual gfx::Rect CalculateClientAreaBounds(int width, int height) const; virtual gfx::Size CalculateWindowSizeForClientSize(int width, int height) const; @@ -53,15 +55,15 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, virtual void GetWindowMask(const gfx::Size& size, gfx::Path* window_mask); virtual void EnableClose(bool enable); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point, - bool can_create_floating); + virtual views::View* GetViewForPoint(const gfx::Point& point, + bool can_create_floating); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); virtual void SetAccessibleName(const std::wstring& name); @@ -91,7 +93,7 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, void LayoutClientView(); // Returns the set of resources to use to paint this view. - WindowResources* resources() const { + views::WindowResources* resources() const { return frame_->is_active() || paint_as_active() ? current_active_resources_ : current_inactive_resources_; } @@ -109,10 +111,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, gfx::Rect otr_avatar_bounds_; // Window controls. - ChromeViews::Button* minimize_button_; - ChromeViews::Button* maximize_button_; - ChromeViews::Button* restore_button_; - ChromeViews::Button* close_button_; + views::Button* minimize_button_; + views::Button* maximize_button_; + views::Button* restore_button_; + views::Button* close_button_; // The Window icon. TabIconView* window_icon_; @@ -124,8 +126,8 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, BrowserView2* browser_view_; // The resources currently used to paint this view. - WindowResources* current_active_resources_; - WindowResources* current_inactive_resources_; + views::WindowResources* current_active_resources_; + views::WindowResources* current_inactive_resources_; // The accessible name of this view. std::wstring accessible_name_; @@ -136,10 +138,10 @@ class OpaqueNonClientView : public ChromeViews::NonClientView, static SkBitmap app_top_left_; static SkBitmap app_top_center_; static SkBitmap app_top_right_; - static WindowResources* active_resources_; - static WindowResources* inactive_resources_; - static WindowResources* active_otr_resources_; - static WindowResources* inactive_otr_resources_; + static views::WindowResources* active_resources_; + static views::WindowResources* inactive_resources_; + static views::WindowResources* active_otr_resources_; + static views::WindowResources* inactive_otr_resources_; static ChromeFont title_font_; DISALLOW_EVIL_CONSTRUCTORS(OpaqueNonClientView); diff --git a/chrome/browser/views/go_button.cc b/chrome/browser/views/go_button.cc index 6d0e765..f9025fb 100644 --- a/chrome/browser/views/go_button.cc +++ b/chrome/browser/views/go_button.cc @@ -54,8 +54,8 @@ void GoButton::NotifyClick(int mouse_event_flags) { } } -void GoButton::OnMouseExited(const ChromeViews::MouseEvent& e) { - using namespace ChromeViews; +void GoButton::OnMouseExited(const views::MouseEvent& e) { + using namespace views; if (visible_mode_ != intended_mode_) ChangeMode(intended_mode_); diff --git a/chrome/browser/views/go_button.h b/chrome/browser/views/go_button.h index 3e4d9f9..1cfd107 100644 --- a/chrome/browser/views/go_button.h +++ b/chrome/browser/views/go_button.h @@ -23,7 +23,7 @@ class LocationBarView; // //////////////////////////////////////////////////////////////////////////////// -class GoButton : public ChromeViews::ToggleButton { +class GoButton : public views::ToggleButton { public: GoButton(LocationBarView* location_bar, CommandController* controller); virtual ~GoButton(); @@ -31,7 +31,7 @@ class GoButton : public ChromeViews::ToggleButton { typedef enum Mode { MODE_GO = 0, MODE_STOP }; virtual void NotifyClick(int mouse_event_flags); - virtual void OnMouseExited(const ChromeViews::MouseEvent& e); + virtual void OnMouseExited(const views::MouseEvent& e); // Force the button state void ChangeMode(Mode mode); diff --git a/chrome/browser/views/html_dialog_view.cc b/chrome/browser/views/html_dialog_view.cc index ac2380f..9bf42b7 100644 --- a/chrome/browser/views/html_dialog_view.cc +++ b/chrome/browser/views/html_dialog_view.cc @@ -26,7 +26,7 @@ HtmlDialogView::~HtmlDialogView() { } //////////////////////////////////////////////////////////////////////////////// -// HtmlDialogView, ChromeViews::View implementation: +// HtmlDialogView, views::View implementation: gfx::Size HtmlDialogView::GetPreferredSize() { CSize out; @@ -35,7 +35,7 @@ gfx::Size HtmlDialogView::GetPreferredSize() { } //////////////////////////////////////////////////////////////////////////////// -// HtmlDialogView, ChromeViews::WindowDelegate implementation: +// HtmlDialogView, views::WindowDelegate implementation: bool HtmlDialogView::CanResize() const { return true; @@ -57,7 +57,7 @@ void HtmlDialogView::WindowClosing() { OnDialogClosed(""); } -ChromeViews::View* HtmlDialogView::GetContentsView() { +views::View* HtmlDialogView::GetContentsView() { return this; } diff --git a/chrome/browser/views/html_dialog_view.h b/chrome/browser/views/html_dialog_view.h index b9dd1d1..e09c968 100644 --- a/chrome/browser/views/html_dialog_view.h +++ b/chrome/browser/views/html_dialog_view.h @@ -11,8 +11,8 @@ #include "chrome/browser/tab_contents_delegate.h" #include "chrome/browser/views/dom_view.h" -namespace ChromeViews { - class Window; +namespace views { +class Window; } //////////////////////////////////////////////////////////////////////////////// @@ -37,15 +37,15 @@ class HtmlDialogView // Initializes the contents of the dialog (the DOMView and the callbacks). void InitDialog(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); - // Overridden from ChromeViews::WindowDelegate: + // Overridden from views::WindowDelegate: virtual bool CanResize() const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // Overridden from HtmlDialogContentsDelegate: virtual GURL GetDialogContentURL() const; diff --git a/chrome/browser/views/hung_renderer_view.cc b/chrome/browser/views/hung_renderer_view.cc index 895c4dd..7202538 100644 --- a/chrome/browser/views/hung_renderer_view.cc +++ b/chrome/browser/views/hung_renderer_view.cc @@ -29,25 +29,25 @@ /////////////////////////////////////////////////////////////////////////////// // HungPagesTableModel -class HungPagesTableModel : public ChromeViews::GroupTableModel { +class HungPagesTableModel : public views::GroupTableModel { public: HungPagesTableModel(); virtual ~HungPagesTableModel(); void InitForWebContents(WebContents* hung_contents); - // Overridden from ChromeViews::GroupTableModel: + // Overridden from views::GroupTableModel: virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); virtual SkBitmap GetIcon(int row); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); - virtual void GetGroupRangeForItem(int item, ChromeViews::GroupRange* range); + virtual void SetObserver(views::TableModelObserver* observer); + virtual void GetGroupRangeForItem(int item, views::GroupRange* range); private: typedef std::vector<WebContents*> WebContentsVector; WebContentsVector webcontentses_; - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; DISALLOW_EVIL_CONSTRUCTORS(HungPagesTableModel); }; @@ -73,7 +73,7 @@ void HungPagesTableModel::InitForWebContents(WebContents* hung_contents) { } /////////////////////////////////////////////////////////////////////////////// -// HungPagesTableModel, ChromeViews::GroupTableModel implementation: +// HungPagesTableModel, views::GroupTableModel implementation: int HungPagesTableModel::RowCount() { return static_cast<int>(webcontentses_.size()); @@ -92,14 +92,12 @@ SkBitmap HungPagesTableModel::GetIcon(int row) { return webcontentses_.at(row)->GetFavIcon(); } -void HungPagesTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { +void HungPagesTableModel::SetObserver(views::TableModelObserver* observer) { observer_ = observer; } -void HungPagesTableModel::GetGroupRangeForItem( - int item, - ChromeViews::GroupRange* range) { +void HungPagesTableModel::GetGroupRangeForItem(int item, + views::GroupRange* range) { DCHECK(range); range->start = 0; range->length = RowCount(); @@ -108,9 +106,9 @@ void HungPagesTableModel::GetGroupRangeForItem( /////////////////////////////////////////////////////////////////////////////// // HungRendererWarningView -class HungRendererWarningView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::NativeButton::Listener { +class HungRendererWarningView : public views::View, + public views::DialogDelegate, + public views::NativeButton::Listener { public: HungRendererWarningView(); ~HungRendererWarningView(); @@ -118,24 +116,24 @@ class HungRendererWarningView : public ChromeViews::View, void ShowForWebContents(WebContents* contents); void EndForWebContents(WebContents* contents); - // ChromeViews::WindowDelegate overrides: + // views::WindowDelegate overrides: virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual int GetDialogButtons() const; virtual std::wstring GetDialogButtonLabel( - ChromeViews::DialogDelegate::DialogButton button) const; - virtual ChromeViews::View* GetExtraView(); + views::DialogDelegate::DialogButton button) const; + virtual views::View* GetExtraView(); virtual bool Accept(bool window_closing); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::NativeButton::Listener overrides: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener overrides: + virtual void ButtonPressed(views::NativeButton* sender); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Initialize the controls in this dialog. @@ -149,15 +147,15 @@ class HungRendererWarningView : public ChromeViews::View, static void InitClass(); // Controls within the dialog box. - ChromeViews::ImageView* frozen_icon_view_; - ChromeViews::Label* info_label_; - ChromeViews::GroupTableView* hung_pages_table_; + views::ImageView* frozen_icon_view_; + views::Label* info_label_; + views::GroupTableView* hung_pages_table_; // The button we insert into the ClientView to kill the errant process. This // is parented to a container view that uses a grid layout to align it // properly. - ChromeViews::NativeButton* kill_button_; - class ButtonContainer : public ChromeViews::View { + views::NativeButton* kill_button_; + class ButtonContainer : public views::View { public: ButtonContainer() {} virtual ~ButtonContainer() {} @@ -251,7 +249,7 @@ void HungRendererWarningView::EndForWebContents(WebContents* contents) { } /////////////////////////////////////////////////////////////////////////////// -// HungRendererWarningView, ChromeViews::DialogDelegate implementation: +// HungRendererWarningView, views::DialogDelegate implementation: std::wstring HungRendererWarningView::GetWindowTitle() const { return l10n_util::GetString(IDS_PRODUCT_NAME); @@ -273,13 +271,13 @@ int HungRendererWarningView::GetDialogButtons() const { } std::wstring HungRendererWarningView::GetDialogButtonLabel( - ChromeViews::DialogDelegate::DialogButton button) const { + views::DialogDelegate::DialogButton button) const { if (button == DIALOGBUTTON_OK) return l10n_util::GetString(IDS_BROWSER_HANGMONITOR_RENDERER_WAIT); return std::wstring(); } -ChromeViews::View* HungRendererWarningView::GetExtraView() { +views::View* HungRendererWarningView::GetExtraView() { return kill_button_container_; } @@ -295,15 +293,14 @@ bool HungRendererWarningView::Accept(bool window_closing) { return true; } -ChromeViews::View* HungRendererWarningView::GetContentsView() { +views::View* HungRendererWarningView::GetContentsView() { return this; } /////////////////////////////////////////////////////////////////////////////// -// HungRendererWarningView, ChromeViews::NativeButton::Listener implementation: +// HungRendererWarningView, views::NativeButton::Listener implementation: -void HungRendererWarningView::ButtonPressed( - ChromeViews::NativeButton* sender) { +void HungRendererWarningView::ButtonPressed(views::NativeButton* sender) { if (sender == kill_button_) { // Kill the process. HANDLE process = contents_->process()->process(); @@ -312,11 +309,11 @@ void HungRendererWarningView::ButtonPressed( } /////////////////////////////////////////////////////////////////////////////// -// HungRendererWarningView, ChromeViews::View overrides: +// HungRendererWarningView, views::View overrides: void HungRendererWarningView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (!initialized_ && is_add && child == this && GetContainer()) Init(); } @@ -325,27 +322,27 @@ void HungRendererWarningView::ViewHierarchyChanged(bool is_add, // HungRendererWarningView, private: void HungRendererWarningView::Init() { - frozen_icon_view_ = new ChromeViews::ImageView; + frozen_icon_view_ = new views::ImageView; frozen_icon_view_->SetImage(frozen_icon_); - info_label_ = new ChromeViews::Label( + info_label_ = new views::Label( l10n_util::GetString(IDS_BROWSER_HANGMONITOR_RENDERER)); info_label_->SetMultiLine(true); - info_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + info_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); hung_pages_table_model_.reset(new HungPagesTableModel); - std::vector<ChromeViews::TableColumn> columns; - columns.push_back(ChromeViews::TableColumn()); - hung_pages_table_ = new ChromeViews::GroupTableView( - hung_pages_table_model_.get(), columns, ChromeViews::ICON_AND_TEXT, true, + std::vector<views::TableColumn> columns; + columns.push_back(views::TableColumn()); + hung_pages_table_ = new views::GroupTableView( + hung_pages_table_model_.get(), columns, views::ICON_AND_TEXT, true, false, true); hung_pages_table_->set_preferred_size( gfx::Size(kTableViewWidth, kTableViewHeight)); CreateKillButtonView(); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -372,14 +369,14 @@ void HungRendererWarningView::Init() { } void HungRendererWarningView::CreateKillButtonView() { - kill_button_ = new ChromeViews::NativeButton( + kill_button_ = new views::NativeButton( l10n_util::GetString(IDS_BROWSER_HANGMONITOR_RENDERER_END)); kill_button_->SetListener(this); kill_button_container_ = new ButtonContainer; - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(kill_button_container_); kill_button_container_->SetLayoutManager(layout); @@ -429,7 +426,7 @@ HungRendererWarningView* HungRendererWarning::instance_ = NULL; static HungRendererWarningView* CreateHungRendererWarningView() { HungRendererWarningView* cv = new HungRendererWarningView; - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), cv); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), cv); return cv; } diff --git a/chrome/browser/views/hung_renderer_view.h b/chrome/browser/views/hung_renderer_view.h index 07fc9de..5ca5dea 100644 --- a/chrome/browser/views/hung_renderer_view.h +++ b/chrome/browser/views/hung_renderer_view.h @@ -8,7 +8,7 @@ #include "base/logging.h" class HungRendererWarningView; -namespace ChromeViews { +namespace views { class Window; } class WebContents; diff --git a/chrome/browser/views/hwnd_html_view.cc b/chrome/browser/views/hwnd_html_view.cc index 11a7225..1661624 100644 --- a/chrome/browser/views/hwnd_html_view.cc +++ b/chrome/browser/views/hwnd_html_view.cc @@ -35,7 +35,7 @@ void HWNDHtmlView::Init(HWND parent_hwnd) { // same z-order as constrained windows. HWND hwnd = view->Create(parent_hwnd); view->ShowWindow(SW_SHOW); - ChromeViews::HWNDView::Attach(hwnd); + views::HWNDView::Attach(hwnd); // Start up the renderer. if (allow_dom_ui_bindings_) diff --git a/chrome/browser/views/hwnd_html_view.h b/chrome/browser/views/hwnd_html_view.h index a91bb97..4405f2a 100644 --- a/chrome/browser/views/hwnd_html_view.h +++ b/chrome/browser/views/hwnd_html_view.h @@ -14,7 +14,7 @@ class RenderViewHostDelegate; // A simple view that wraps a RenderViewHost in an HWNDView to facilitate // rendering HTML as arbitrary browser views. // TODO(timsteele): (bug 1317303). This should replace DOMView. -class HWNDHtmlView : public ChromeViews::HWNDView { +class HWNDHtmlView : public views::HWNDView { public: HWNDHtmlView(const GURL& content_url, RenderViewHostDelegate* delegate, bool allow_dom_ui_bindings) diff --git a/chrome/browser/views/importer_lock_view.cc b/chrome/browser/views/importer_lock_view.cc index edb7e6e..f940ce4 100644 --- a/chrome/browser/views/importer_lock_view.cc +++ b/chrome/browser/views/importer_lock_view.cc @@ -14,8 +14,8 @@ #include "chromium_strings.h" #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; // Default size of the dialog window. static const int kDefaultWindowWidth = 320; @@ -24,10 +24,10 @@ static const int kDefaultWindowHeight = 100; ImporterLockView::ImporterLockView(ImporterHost* host) : description_label_(NULL), importer_host_(host) { - description_label_ = new ChromeViews::Label( + description_label_ = new views::Label( l10n_util::GetString(IDS_IMPORTER_LOCK_TEXT)); description_label_->SetMultiLine(true); - description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(description_label_); } @@ -35,7 +35,7 @@ ImporterLockView::~ImporterLockView() { } gfx::Size ImporterLockView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_IMPORTLOCK_DIALOG_WIDTH_CHARS, IDS_IMPORTLOCK_DIALOG_HEIGHT_LINES)); } @@ -76,7 +76,7 @@ bool ImporterLockView::Cancel() { return true; } -ChromeViews::View* ImporterLockView::GetContentsView() { +views::View* ImporterLockView::GetContentsView() { return this; } diff --git a/chrome/browser/views/importer_lock_view.h b/chrome/browser/views/importer_lock_view.h index 9070184..04926ae 100644 --- a/chrome/browser/views/importer_lock_view.h +++ b/chrome/browser/views/importer_lock_view.h @@ -8,37 +8,35 @@ #include "chrome/views/dialog_delegate.h" #include "chrome/views/view.h" -namespace ChromeViews { - +namespace views { class Label; class Window; - } class ImporterHost; // ImporterLockView draws the dialog, and asks the user to shut Firefox // down before starting the import. -class ImporterLockView : public ChromeViews::View, - public ChromeViews::DialogDelegate { +class ImporterLockView : public views::View, + public views::DialogDelegate { public: explicit ImporterLockView(ImporterHost* host); virtual ~ImporterLockView(); - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual gfx::Size GetPreferredSize(); virtual void Layout(); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Accept(); virtual bool Cancel(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: - ChromeViews::Label* description_label_; + views::Label* description_label_; ImporterHost* importer_host_; diff --git a/chrome/browser/views/importer_view.cc b/chrome/browser/views/importer_view.cc index 5349b90..eedce0b 100644 --- a/chrome/browser/views/importer_view.cc +++ b/chrome/browser/views/importer_view.cc @@ -15,8 +15,8 @@ #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; ImporterView::ImporterView(Profile* profile) : import_from_label_(NULL), @@ -38,12 +38,12 @@ ImporterView::~ImporterView() { void ImporterView::SetupControl() { // Adds all controls. import_from_label_ = - new ChromeViews::Label(l10n_util::GetString(IDS_IMPORT_FROM_LABEL)); + new views::Label(l10n_util::GetString(IDS_IMPORT_FROM_LABEL)); - profile_combobox_ = new ChromeViews::ComboBox(this); + profile_combobox_ = new views::ComboBox(this); import_items_label_ = - new ChromeViews::Label(l10n_util::GetString(IDS_IMPORT_ITEMS_LABEL)); + new views::Label(l10n_util::GetString(IDS_IMPORT_ITEMS_LABEL)); history_checkbox_ = InitCheckbox(l10n_util::GetString(IDS_IMPORT_HISTORY_CHKBOX), true); @@ -89,7 +89,7 @@ void ImporterView::SetupControl() { } gfx::Size ImporterView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_IMPORT_DIALOG_WIDTH_CHARS, IDS_IMPORT_DIALOG_HEIGHT_LINES)); } @@ -142,18 +142,17 @@ bool ImporterView::Accept() { return false; } -ChromeViews::View* ImporterView::GetContentsView() { +views::View* ImporterView::GetContentsView() { return this; } -int ImporterView::GetItemCount(ChromeViews::ComboBox* source) { +int ImporterView::GetItemCount(views::ComboBox* source) { DCHECK(source == profile_combobox_); DCHECK(importer_host_.get()); return importer_host_->GetAvailableProfileCount(); } -std::wstring ImporterView::GetItemAt(ChromeViews::ComboBox* source, - int index) { +std::wstring ImporterView::GetItemAt(views::ComboBox* source, int index) { DCHECK(source == profile_combobox_); DCHECK(importer_host_.get()); return importer_host_->GetSourceProfileNameAt(index); @@ -168,9 +167,9 @@ void ImporterView::ImportComplete() { window()->Close(); } -ChromeViews::CheckBox* ImporterView::InitCheckbox( - const std::wstring& text, bool checked) { - ChromeViews::CheckBox* checkbox = new ChromeViews::CheckBox(text); +views::CheckBox* ImporterView::InitCheckbox(const std::wstring& text, + bool checked) { + views::CheckBox* checkbox = new views::CheckBox(text); checkbox->SetIsSelected(checked); return checkbox; } diff --git a/chrome/browser/views/importer_view.h b/chrome/browser/views/importer_view.h index 6906fee..1f3002d 100644 --- a/chrome/browser/views/importer_view.h +++ b/chrome/browser/views/importer_view.h @@ -11,12 +11,10 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { - +namespace views { class CheckBox; class Label; class Window; - } class Profile; @@ -25,28 +23,28 @@ class Profile; // import from other browsers. // Note: The UI team hasn't defined yet how the import UI will look like. // So now use dialog as a placeholder. -class ImporterView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::ComboBox::Model, +class ImporterView : public views::View, + public views::DialogDelegate, + public views::ComboBox::Model, public ImportObserver { public: explicit ImporterView(Profile* profile); virtual ~ImporterView(); - // Overridden from ChromeViews::View. + // Overridden from views::View. virtual gfx::Size GetPreferredSize(); virtual void Layout(); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Accept(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::ComboBox::Model. - virtual int GetItemCount(ChromeViews::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + // Overridden from views::ComboBox::Model. + virtual int GetItemCount(views::ComboBox* source); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); // Overridden from ImportObserver: virtual void ImportCanceled(); @@ -57,15 +55,15 @@ class ImporterView : public ChromeViews::View, void SetupControl(); // Creates and initializes a new check-box. - ChromeViews::CheckBox* InitCheckbox(const std::wstring& text, bool checked); - - ChromeViews::Label* import_from_label_; - ChromeViews::ComboBox* profile_combobox_; - ChromeViews::Label* import_items_label_; - ChromeViews::CheckBox* history_checkbox_; - ChromeViews::CheckBox* favorites_checkbox_; - ChromeViews::CheckBox* passwords_checkbox_; - ChromeViews::CheckBox* search_engines_checkbox_; + views::CheckBox* InitCheckbox(const std::wstring& text, bool checked); + + views::Label* import_from_label_; + views::ComboBox* profile_combobox_; + views::Label* import_items_label_; + views::CheckBox* history_checkbox_; + views::CheckBox* favorites_checkbox_; + views::CheckBox* passwords_checkbox_; + views::CheckBox* search_engines_checkbox_; scoped_refptr<ImporterHost> importer_host_; diff --git a/chrome/browser/views/importing_progress_view.cc b/chrome/browser/views/importing_progress_view.cc index d580cfa..203cea2 100644 --- a/chrome/browser/views/importing_progress_view.cc +++ b/chrome/browser/views/importing_progress_view.cc @@ -23,22 +23,22 @@ ImportingProgressView::ImportingProgressView(const std::wstring& source_name, ImporterHost* coordinator, ImportObserver* observer, HWND parent_window) - : state_bookmarks_(new ChromeViews::CheckmarkThrobber), - state_searches_(new ChromeViews::CheckmarkThrobber), - state_passwords_(new ChromeViews::CheckmarkThrobber), - state_history_(new ChromeViews::CheckmarkThrobber), - state_cookies_(new ChromeViews::CheckmarkThrobber), - label_info_(new ChromeViews::Label(l10n_util::GetStringF( + : state_bookmarks_(new views::CheckmarkThrobber), + state_searches_(new views::CheckmarkThrobber), + state_passwords_(new views::CheckmarkThrobber), + state_history_(new views::CheckmarkThrobber), + state_cookies_(new views::CheckmarkThrobber), + label_info_(new views::Label(l10n_util::GetStringF( IDS_IMPORT_PROGRESS_INFO, source_name))), - label_bookmarks_(new ChromeViews::Label( + label_bookmarks_(new views::Label( l10n_util::GetString(IDS_IMPORT_PROGRESS_STATUS_BOOKMARKS))), - label_searches_(new ChromeViews::Label( + label_searches_(new views::Label( l10n_util::GetString(IDS_IMPORT_PROGRESS_STATUS_SEARCH))), - label_passwords_(new ChromeViews::Label( + label_passwords_(new views::Label( l10n_util::GetString(IDS_IMPORT_PROGRESS_STATUS_PASSWORDS))), - label_history_(new ChromeViews::Label( + label_history_(new views::Label( l10n_util::GetString(IDS_IMPORT_PROGRESS_STATUS_HISTORY))), - label_cookies_(new ChromeViews::Label( + label_cookies_(new views::Label( l10n_util::GetString(IDS_IMPORT_PROGRESS_STATUS_COOKIES))), parent_window_(parent_window), coordinator_(coordinator), @@ -47,12 +47,12 @@ ImportingProgressView::ImportingProgressView(const std::wstring& source_name, importing_(true) { coordinator_->SetObserver(this); label_info_->SetMultiLine(true); - label_info_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - label_bookmarks_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - label_searches_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - label_passwords_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - label_history_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - label_cookies_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label_info_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + label_bookmarks_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + label_searches_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + label_passwords_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + label_history_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + label_cookies_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); // These are scoped pointers, so we don't need the parent to delete them. state_bookmarks_->SetParentOwned(false); @@ -149,23 +149,23 @@ void ImportingProgressView::ImportEnded() { } //////////////////////////////////////////////////////////////////////////////// -// ImportingProgressView, ChromeViews::View overrides: +// ImportingProgressView, views::View overrides: gfx::Size ImportingProgressView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_IMPORTPROGRESS_DIALOG_WIDTH_CHARS, IDS_IMPORTPROGRESS_DIALOG_HEIGHT_LINES)); } void ImportingProgressView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) InitControlLayout(); } //////////////////////////////////////////////////////////////////////////////// -// ImportingProgressView, ChromeViews::DialogDelegate implementation: +// ImportingProgressView, views::DialogDelegate implementation: int ImportingProgressView::GetDialogButtons() const { return DIALOGBUTTON_CANCEL; @@ -199,7 +199,7 @@ bool ImportingProgressView::Cancel() { return false; } -ChromeViews::View* ImportingProgressView::GetContentsView() { +views::View* ImportingProgressView::GetContentsView() { return this; } @@ -207,8 +207,8 @@ ChromeViews::View* ImportingProgressView::GetContentsView() { // ImportingProgressView, private: void ImportingProgressView::InitControlLayout() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -278,8 +278,7 @@ void StartImportingWithUI(HWND parent_window, DCHECK(items != 0); ImportingProgressView* v = new ImportingProgressView( source_profile.description, items, coordinator, observer, parent_window); - ChromeViews::Window::CreateChromeWindow(parent_window, gfx::Rect(), - v)->Show(); + views::Window::CreateChromeWindow(parent_window, gfx::Rect(), v)->Show(); coordinator->StartImportSettings(source_profile, items, new ProfileWriter(target_profile), first_run); diff --git a/chrome/browser/views/importing_progress_view.h b/chrome/browser/views/importing_progress_view.h index 9637c05..c7f97c0 100644 --- a/chrome/browser/views/importing_progress_view.h +++ b/chrome/browser/views/importing_progress_view.h @@ -10,13 +10,13 @@ #include "chrome/views/view.h" #include "chrome/views/window.h" -namespace ChromeViews { +namespace views { class CheckmarkThrobber; class Label; } -class ImportingProgressView : public ChromeViews::View, - public ChromeViews::DialogDelegate, +class ImportingProgressView : public views::View, + public views::DialogDelegate, public ImporterHost::Observer { public: ImportingProgressView(const std::wstring& source_name, @@ -33,36 +33,36 @@ class ImportingProgressView : public ChromeViews::View, virtual void ImportStarted(); virtual void ImportEnded(); - // Overridden from ChromeViews::DialogDelegate: + // Overridden from views::DialogDelegate: virtual int GetDialogButtons() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool IsModal() const; virtual std::wstring GetWindowTitle() const; virtual bool Cancel(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual gfx::Size GetPreferredSize(); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Set up the control layout within this dialog. void InitControlLayout(); // Various dialog controls. - scoped_ptr<ChromeViews::CheckmarkThrobber> state_bookmarks_; - scoped_ptr<ChromeViews::CheckmarkThrobber> state_searches_; - scoped_ptr<ChromeViews::CheckmarkThrobber> state_passwords_; - scoped_ptr<ChromeViews::CheckmarkThrobber> state_history_; - scoped_ptr<ChromeViews::CheckmarkThrobber> state_cookies_; - ChromeViews::Label* label_info_; - scoped_ptr<ChromeViews::Label> label_bookmarks_; - scoped_ptr<ChromeViews::Label> label_searches_; - scoped_ptr<ChromeViews::Label> label_passwords_; - scoped_ptr<ChromeViews::Label> label_history_; - scoped_ptr<ChromeViews::Label> label_cookies_; + scoped_ptr<views::CheckmarkThrobber> state_bookmarks_; + scoped_ptr<views::CheckmarkThrobber> state_searches_; + scoped_ptr<views::CheckmarkThrobber> state_passwords_; + scoped_ptr<views::CheckmarkThrobber> state_history_; + scoped_ptr<views::CheckmarkThrobber> state_cookies_; + views::Label* label_info_; + scoped_ptr<views::Label> label_bookmarks_; + scoped_ptr<views::Label> label_searches_; + scoped_ptr<views::Label> label_passwords_; + scoped_ptr<views::Label> label_history_; + scoped_ptr<views::Label> label_cookies_; // The native window that we are parented to. Can be NULL. HWND parent_window_; diff --git a/chrome/browser/views/info_bar_alternate_nav_url_view.cc b/chrome/browser/views/info_bar_alternate_nav_url_view.cc index 24477f3..bb0d13f 100644 --- a/chrome/browser/views/info_bar_alternate_nav_url_view.cc +++ b/chrome/browser/views/info_bar_alternate_nav_url_view.cc @@ -26,19 +26,18 @@ InfoBarAlternateNavURLView::InfoBarAlternateNavURLView( ResourceBundle& rb = ResourceBundle::GetSharedInstance(); if (offset > 0) { - ChromeViews::Label* label_1 = - new ChromeViews::Label(label.substr(0, offset)); + views::Label* label_1 = new views::Label(label.substr(0, offset)); label_1->SetFont(rb.GetFont(ResourceBundle::MediumFont)); AddChildViewLeading(label_1, 0); } - ChromeViews::Link* link = new ChromeViews::Link(alternate_nav_url_); + views::Link* link = new views::Link(alternate_nav_url_); link->SetFont(rb.GetFont(ResourceBundle::MediumFont)); link->SetController(this); AddChildViewLeading(link, 0); if (offset < label.length()) { - ChromeViews::Label* label_2 = new ChromeViews::Label(label.substr(offset)); + views::Label* label_2 = new views::Label(label.substr(offset)); label_2->SetFont(rb.GetFont(ResourceBundle::MediumFont)); AddChildViewLeading(label_2, 0); } @@ -46,7 +45,7 @@ InfoBarAlternateNavURLView::InfoBarAlternateNavURLView( SetIcon(*rb.GetBitmapNamed(IDR_INFOBAR_ALT_NAV_URL)); } -void InfoBarAlternateNavURLView::LinkActivated(ChromeViews::Link* source, +void InfoBarAlternateNavURLView::LinkActivated(views::Link* source, int event_flags) { // Navigating may or may not automatically close the infobar, depending on // whether the desired disposition replaces the current tab. We always want diff --git a/chrome/browser/views/info_bar_alternate_nav_url_view.h b/chrome/browser/views/info_bar_alternate_nav_url_view.h index 26e1b31..f32697f 100644 --- a/chrome/browser/views/info_bar_alternate_nav_url_view.h +++ b/chrome/browser/views/info_bar_alternate_nav_url_view.h @@ -9,13 +9,13 @@ #include "chrome/views/link.h" class InfoBarAlternateNavURLView : public InfoBarItemView, - public ChromeViews::LinkController { + public views::LinkController { public: explicit InfoBarAlternateNavURLView(const std::wstring& alternate_nav_url); virtual ~InfoBarAlternateNavURLView() { } // LinkController - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + virtual void LinkActivated(views::Link* source, int event_flags); private: std::wstring alternate_nav_url_; diff --git a/chrome/browser/views/info_bar_confirm_view.cc b/chrome/browser/views/info_bar_confirm_view.cc index 57ffc53..6c6a15a 100644 --- a/chrome/browser/views/info_bar_confirm_view.cc +++ b/chrome/browser/views/info_bar_confirm_view.cc @@ -27,7 +27,7 @@ void InfoBarConfirmView::CancelButtonPressed() { BeginClose(); } -void InfoBarConfirmView::ButtonPressed(ChromeViews::NativeButton* sender) { +void InfoBarConfirmView::ButtonPressed(views::NativeButton* sender) { // If you close the bar from one of these functions, make sure to use // BeginClose() - Close() could delete us and cause the rest of the // function to go bananas. @@ -88,11 +88,10 @@ bool InfoBarConfirmView::GetAccessibleRole(VARIANT* role) { } void InfoBarConfirmView::Init() { - ok_button_ = new ChromeViews::NativeButton(l10n_util::GetString(IDS_OK)); + ok_button_ = new views::NativeButton(l10n_util::GetString(IDS_OK)); ok_button_->SetListener(this); - cancel_button_ = - new ChromeViews::NativeButton(l10n_util::GetString(IDS_CANCEL)); + cancel_button_ = new views::NativeButton(l10n_util::GetString(IDS_CANCEL)); cancel_button_->SetListener(this); AddChildViewTrailing(cancel_button_, kRelatedButtonHSpacing); AddChildViewTrailing(ok_button_); diff --git a/chrome/browser/views/info_bar_confirm_view.h b/chrome/browser/views/info_bar_confirm_view.h index cfcd483..586e734 100644 --- a/chrome/browser/views/info_bar_confirm_view.h +++ b/chrome/browser/views/info_bar_confirm_view.h @@ -12,7 +12,7 @@ // default), and a close button. Can be inherited to override the behavior // of button presses. class InfoBarConfirmView : public InfoBarMessageView, - public ChromeViews::NativeButton::Listener { + public views::NativeButton::Listener { public: explicit InfoBarConfirmView(const std::wstring& message); @@ -27,7 +27,7 @@ class InfoBarConfirmView : public InfoBarMessageView, // ButtonListener Method: // Invokes OKButtonPressed or CancelButtonPressed() when their // respective buttons are pressed. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // Sets the label on the OK button, if it exists. void SetOKButtonLabel(const std::wstring& label); @@ -54,9 +54,9 @@ class InfoBarConfirmView : public InfoBarMessageView, // then call AddAllChildViews. void Init(); - ChromeViews::NativeButton* ok_button_; + views::NativeButton* ok_button_; - ChromeViews::NativeButton* cancel_button_; + views::NativeButton* cancel_button_; DISALLOW_EVIL_CONSTRUCTORS(InfoBarConfirmView); }; diff --git a/chrome/browser/views/info_bar_item_view.cc b/chrome/browser/views/info_bar_item_view.cc index 71b5c4e..78c4179 100644 --- a/chrome/browser/views/info_bar_item_view.cc +++ b/chrome/browser/views/info_bar_item_view.cc @@ -16,7 +16,7 @@ namespace { -class HorizontalSpacer : public ChromeViews::View { +class HorizontalSpacer : public views::View { public: explicit HorizontalSpacer(int width) : width_(width) {} @@ -143,7 +143,7 @@ void InfoBarItemView::BeginClose() { } void InfoBarItemView::Close() { - ChromeViews::View* parent = GetParent(); + views::View* parent = GetParent(); parent->RemoveChildView(this); if (focus_tracker_.get() != NULL) focus_tracker_->FocusLastFocusedExternalView(); @@ -155,27 +155,27 @@ void InfoBarItemView::CloseButtonPressed() { BeginClose(); } -void InfoBarItemView::AddChildViewTrailing(ChromeViews::View* view, +void InfoBarItemView::AddChildViewTrailing(views::View* view, int leading_padding) { - ChromeViews::View::AddChildView(insert_index_, view); + views::View::AddChildView(insert_index_, view); View* padding = new HorizontalSpacer(leading_padding); - ChromeViews::View::AddChildView(insert_index_, padding); + views::View::AddChildView(insert_index_, padding); } -void InfoBarItemView::AddChildViewTrailing(ChromeViews::View* view) { +void InfoBarItemView::AddChildViewTrailing(views::View* view) { AddChildViewTrailing(view, kUnrelatedControlHorizontalSpacing); } -void InfoBarItemView::AddChildViewLeading(ChromeViews::View* view, +void InfoBarItemView::AddChildViewLeading(views::View* view, int trailing_padding) { - ChromeViews::View::AddChildView(insert_index_, view); + views::View::AddChildView(insert_index_, view); insert_index_++; View* padding = new HorizontalSpacer(trailing_padding); - ChromeViews::View::AddChildView(insert_index_, padding); + views::View::AddChildView(insert_index_, padding); insert_index_++; } -void InfoBarItemView::AddChildViewLeading(ChromeViews::View* view) { +void InfoBarItemView::AddChildViewLeading(views::View* view) { AddChildViewLeading(view, kRelatedControlSmallHorizontalSpacing); } @@ -183,10 +183,10 @@ void InfoBarItemView::SetIcon(const SkBitmap& icon) { if (icon_ == NULL) { // Add the icon and its padding to the far left of the info bar, and adjust // the insert index accordingly. - icon_ = new ChromeViews::ImageView(); + icon_ = new views::ImageView(); View* padding = new HorizontalSpacer(kRelatedControlHorizontalSpacing); - ChromeViews::View::AddChildView(0, padding); - ChromeViews::View::AddChildView(0, icon_); + views::View::AddChildView(0, padding); + views::View::AddChildView(0, icon_); insert_index_ += 2; } icon_->SetImage(icon); @@ -206,8 +206,8 @@ void InfoBarItemView::ViewHierarchyChanged(bool is_add, root_hwnd = root_view->GetContainer()->GetHWND(); if (root_hwnd) { - focus_tracker_.reset(new ChromeViews::ExternalFocusTracker( - this, ChromeViews::FocusManager::GetFocusManager(root_hwnd))); + focus_tracker_.reset(new views::ExternalFocusTracker( + this, views::FocusManager::GetFocusManager(root_hwnd))); } } else { // When we're removed from the hierarchy our focus manager is no longer @@ -218,26 +218,26 @@ void InfoBarItemView::ViewHierarchyChanged(bool is_add, } } -void InfoBarItemView::AddChildView(ChromeViews::View* view) { +void InfoBarItemView::AddChildView(views::View* view) { AddChildViewTrailing(view, kUnrelatedControlHorizontalSpacing); } -void InfoBarItemView::AddChildView(int index, ChromeViews::View* view) { +void InfoBarItemView::AddChildView(int index, views::View* view) { if (index < insert_index_) AddChildViewLeading(view); else AddChildViewTrailing(view); } -void InfoBarItemView::RemoveChildView(ChromeViews::View* view) { +void InfoBarItemView::RemoveChildView(views::View* view) { int index = GetChildIndex(view); if (index >= 0) { if (index < insert_index_) { // We're removing a leading view. So the view at index + 1 (immediately // trailing) is the corresponding spacer view. View* spacer_view = GetChildViewAt(index + 1); - ChromeViews::View::RemoveChildView(view); - ChromeViews::View::RemoveChildView(spacer_view); + views::View::RemoveChildView(view); + views::View::RemoveChildView(spacer_view); delete spacer_view; // Need to change the insert_index_ so it is still pointing at the // "middle" index between left and right aligned views. @@ -246,14 +246,14 @@ void InfoBarItemView::RemoveChildView(ChromeViews::View* view) { // We're removing a trailing view. So the view at index - 1 (immediately // leading) is the corresponding spacer view. View* spacer_view = GetChildViewAt(index - 1); - ChromeViews::View::RemoveChildView(view); - ChromeViews::View::RemoveChildView(spacer_view); + views::View::RemoveChildView(view); + views::View::RemoveChildView(spacer_view); delete spacer_view; } } } -void InfoBarItemView::ButtonPressed(ChromeViews::BaseButton* button) { +void InfoBarItemView::ButtonPressed(views::BaseButton* button) { if (button == close_button_) CloseButtonPressed(); } @@ -271,12 +271,12 @@ void InfoBarItemView::AnimationEnded(const Animation* animation) { void InfoBarItemView::Init() { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - close_button_ = new ChromeViews::Button(); - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, + close_button_ = new views::Button(); + close_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_CLOSE_BAR)); - close_button_->SetImage(ChromeViews::Button::BS_HOT, + close_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_CLOSE_BAR_H)); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, + close_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_BAR_P)); close_button_->SetListener(this, 0); close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE)); diff --git a/chrome/browser/views/info_bar_item_view.h b/chrome/browser/views/info_bar_item_view.h index 4e38e7c..7c42478 100644 --- a/chrome/browser/views/info_bar_item_view.h +++ b/chrome/browser/views/info_bar_item_view.h @@ -9,9 +9,9 @@ #include "chrome/common/slide_animation.h" #include "chrome/views/button.h" -namespace ChromeViews { - class ExternalFocusTracker; - class ImageView; +namespace views { +class ExternalFocusTracker; +class ImageView; } // Note: An InfoBarItemView must be added as a child of InfoBarView to be // displayed correctly. @@ -33,8 +33,8 @@ namespace ChromeViews { // you add a view. For example, if you add a view to the left with a padding of // 6 specified, it will be placed in the leftmost position, and the next view // added to the left will be 6 pixels to the right of the previously added view. -class InfoBarItemView : public ChromeViews::View, - public ChromeViews::BaseButton::ButtonListener, +class InfoBarItemView : public views::View, + public views::BaseButton::ButtonListener, public AnimationDelegate { public: InfoBarItemView(); @@ -59,25 +59,25 @@ class InfoBarItemView : public ChromeViews::View, // ButtonListener Method // Calls CloseButtonPressed() when the close button is pressed - virtual void ButtonPressed(ChromeViews::BaseButton* button); + virtual void ButtonPressed(views::BaseButton* button); // Adds |view| to the info bar, directly leading the last trailing view // added, according to that views specified padding. The next trailing view // added will in turn be leading this view by |leading_padding| pixels. // Specify 0 for |leading_padding| if the views should be flush. - void AddChildViewTrailing(ChromeViews::View* view, int leading_padding); + void AddChildViewTrailing(views::View* view, int leading_padding); // Calls AddChildViewTrailing with a default amount of padding. - void AddChildViewTrailing(ChromeViews::View* view); + void AddChildViewTrailing(views::View* view); // Adds |view| to the info bar, directly trailing the last leading view // added, according to that views specified padding. The next leading view // added will in turn be trailing this view by |trailing_padding| pixels. // Specify 0 for |trailing_padding| if the views should be flush. - void AddChildViewLeading(ChromeViews::View* view, int trailing_padding); + void AddChildViewLeading(views::View* view, int trailing_padding); // Calls AddChildViewLeading with a default amount of padding. - void AddChildViewLeading(ChromeViews::View* view); + void AddChildViewLeading(views::View* view); // Sets the icon to be displayed leading all other views in the info bar. // The icon will be displayed at its images height and width by default. @@ -92,16 +92,16 @@ class InfoBarItemView : public ChromeViews::View, // Overridden from the basic Views AddChildView. Calls // AddChildViewTrailing(view) - virtual void AddChildView(ChromeViews::View* view); + virtual void AddChildView(views::View* view); // Overridden from basic View. Adds the view to the same side as the view // at index. Does *not* insert at the specified index, or even neccesarily // close to it. - virtual void AddChildView(int index, ChromeViews::View* view); + virtual void AddChildView(int index, views::View* view); // Overridden from the basic Views AddChildView, removes the specified view // as well as its padding. - virtual void RemoveChildView(ChromeViews::View* view); + virtual void RemoveChildView(views::View* view); // Invoked whenever the close button is pressed. Closes infobar by default. virtual void CloseButtonPressed(); @@ -123,15 +123,15 @@ class InfoBarItemView : public ChromeViews::View, int insert_index_; // Dismisses the info bar by default. - ChromeViews::Button* close_button_; + views::Button* close_button_; // Optional icon to be displayed at the far left of the infobar. - ChromeViews::ImageView* icon_; + views::ImageView* icon_; // Tracks and stores the last focused view which is not the InfoBarItemView or // any of its children. Used to restore focus once the InfoBarItemView is // closed. - scoped_ptr<ChromeViews::ExternalFocusTracker> focus_tracker_; + scoped_ptr<views::ExternalFocusTracker> focus_tracker_; DISALLOW_EVIL_CONSTRUCTORS(InfoBarItemView); }; diff --git a/chrome/browser/views/info_bar_message_view.cc b/chrome/browser/views/info_bar_message_view.cc index 07098c7..7c9cfbb 100644 --- a/chrome/browser/views/info_bar_message_view.cc +++ b/chrome/browser/views/info_bar_message_view.cc @@ -12,7 +12,7 @@ InfoBarMessageView::InfoBarMessageView(const std::wstring& message) Init(); } -InfoBarMessageView::InfoBarMessageView(ChromeViews::Label* message) +InfoBarMessageView::InfoBarMessageView(views::Label* message) : message_string_(), message_label_(message) { Init(); @@ -31,7 +31,7 @@ std::wstring InfoBarMessageView::GetMessageText() { void InfoBarMessageView::Init() { if (message_label_ == NULL) { - message_label_ = new ChromeViews::Label(message_string_); + message_label_ = new views::Label(message_string_); message_label_->SetFont( ResourceBundle::GetSharedInstance().GetFont(ResourceBundle::MediumFont)); } else { diff --git a/chrome/browser/views/info_bar_message_view.h b/chrome/browser/views/info_bar_message_view.h index 4d76914..67be918 100644 --- a/chrome/browser/views/info_bar_message_view.h +++ b/chrome/browser/views/info_bar_message_view.h @@ -16,7 +16,7 @@ class InfoBarMessageView : public InfoBarItemView { public: explicit InfoBarMessageView(const std::wstring& message); - explicit InfoBarMessageView(ChromeViews::Label* message); + explicit InfoBarMessageView(views::Label* message); virtual ~InfoBarMessageView(); @@ -30,7 +30,7 @@ class InfoBarMessageView : public InfoBarItemView { std::wstring message_string_; - ChromeViews::Label* message_label_; + views::Label* message_label_; DISALLOW_EVIL_CONSTRUCTORS(InfoBarMessageView); }; diff --git a/chrome/browser/views/info_bar_view.cc b/chrome/browser/views/info_bar_view.cc index 3d69eaa..255e528 100644 --- a/chrome/browser/views/info_bar_view.cc +++ b/chrome/browser/views/info_bar_view.cc @@ -44,7 +44,7 @@ InfoBarView::~InfoBarView() { Source<NavigationController>(web_contents_->controller())); } -void InfoBarView::AppendInfoBarItem(ChromeViews::View* view, bool auto_expire) { +void InfoBarView::AppendInfoBarItem(views::View* view, bool auto_expire) { // AddChildView adds an entry to expire_map_ for view. AddChildView(view); if (auto_expire) @@ -132,7 +132,7 @@ void InfoBarView::ViewHierarchyChanged(bool is_add, View *parent, void InfoBarView::Init() { SetBackground( - ChromeViews::Background::CreateVerticalGradientBackground( + views::Background::CreateVerticalGradientBackground( kBackgroundColorTop, kBackgroundColorBottom)); } @@ -158,9 +158,9 @@ void InfoBarView::PaintBorder(ChromeCanvas* canvas) { } void InfoBarView::PaintSeparators(ChromeCanvas* canvas) { - ChromeViews::View* last_view = NULL; + views::View* last_view = NULL; for (int i = GetChildViewCount() - 1; i >= 0; i--) { - ChromeViews::View* view = GetChildViewAt(i); + views::View* view = GetChildViewAt(i); if (last_view != NULL) { if (view->IsVisible()) { PaintSeparator(canvas, last_view, view); @@ -174,8 +174,8 @@ void InfoBarView::PaintSeparators(ChromeCanvas* canvas) { } void InfoBarView::PaintSeparator(ChromeCanvas* canvas, - ChromeViews::View* v1, - ChromeViews::View* v2) { + views::View* v1, + views::View* v2) { canvas->FillRectInt(kSeparatorColor, 0, v2->y() - kSeparatorHeight, @@ -201,7 +201,7 @@ void InfoBarView::Observe(NotificationType type, return; // Determine the views to remove first. - std::vector<ChromeViews::View*> to_remove; + std::vector<views::View*> to_remove; for (std::map<View*,int>::iterator i = expire_map_.begin(); i != expire_map_.end(); ++i) { if (PageTransition::StripQualifier(details.entry->transition_type()) == @@ -214,7 +214,7 @@ void InfoBarView::Observe(NotificationType type, return; // Remove the views. - for (std::vector<ChromeViews::View*>::iterator i = to_remove.begin(); + for (std::vector<views::View*>::iterator i = to_remove.begin(); i != to_remove.end(); ++i) { // RemoveChildView takes care of removing from expire_map for us. RemoveChildView(*i); diff --git a/chrome/browser/views/info_bar_view.h b/chrome/browser/views/info_bar_view.h index 6091867..52a761d 100644 --- a/chrome/browser/views/info_bar_view.h +++ b/chrome/browser/views/info_bar_view.h @@ -17,7 +17,7 @@ class WebContents; // // It will paint all of its children vertically, with the most recently // added child displayed at the top of the info bar. -class InfoBarView : public ChromeViews::View, +class InfoBarView : public views::View, public NotificationObserver { public: explicit InfoBarView(WebContents* web_contents); @@ -28,7 +28,7 @@ class InfoBarView : public ChromeViews::View, // removed after 1 navigation, which is also the behavior if you set // |auto_expire| to true here. You mainly need this function if you want to // add an infobar that should not expire. - void AppendInfoBarItem(ChromeViews::View* view, bool auto_expire); + void AppendInfoBarItem(views::View* view, bool auto_expire); virtual gfx::Size GetPreferredSize(); @@ -65,8 +65,8 @@ class InfoBarView : public ChromeViews::View, // Paints the separator between views. void PaintSeparator(ChromeCanvas* canvas, - ChromeViews::View* v1, - ChromeViews::View* v2); + views::View* v1, + views::View* v2); // NotificationObserver implementation. virtual void Observe(NotificationType type, diff --git a/chrome/browser/views/info_bubble.cc b/chrome/browser/views/info_bubble.cc index d059af4..f2b9b27 100644 --- a/chrome/browser/views/info_bubble.cc +++ b/chrome/browser/views/info_bubble.cc @@ -14,7 +14,7 @@ #include "chrome/common/win_util.h" #include "chrome/views/root_view.h" -using ChromeViews::View; +using views::View; // All sizes are in pixels. @@ -67,7 +67,7 @@ static const int kMinimumAlpha = 72; // static InfoBubble* InfoBubble::Show(HWND parent_hwnd, const gfx::Rect& position_relative_to, - ChromeViews::View* content, + views::View* content, InfoBubbleDelegate* delegate) { InfoBubble* window = new InfoBubble(); window->Init(parent_hwnd, position_relative_to, content); @@ -87,7 +87,7 @@ InfoBubble::~InfoBubble() { void InfoBubble::Init(HWND parent_hwnd, const gfx::Rect& position_relative_to, - ChromeViews::View* content) { + views::View* content) { if (kInfoBubbleCornerTopLeft == NULL) { kInfoBubbleCornerTopLeft = ResourceBundle::GetSharedInstance() .GetBitmapNamed(IDR_INFO_BUBBLE_CORNER_TOP_LEFT); @@ -128,11 +128,10 @@ void InfoBubble::Init(HWND parent_hwnd, } // Register the Escape accelerator for closing. - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetHWND()); - focus_manager->RegisterAccelerator(ChromeViews::Accelerator(VK_ESCAPE, - false, false, - false), + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetHWND()); + focus_manager->RegisterAccelerator(views::Accelerator(VK_ESCAPE, false, + false, false), this); fade_animation_.reset(new SlideAnimation(this)); @@ -161,8 +160,7 @@ void InfoBubble::AnimationProgressed(const Animation* animation) { content_view_->SchedulePaint(); } -bool InfoBubble::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { +bool InfoBubble::AcceleratorPressed(const views::Accelerator& accelerator) { DCHECK(accelerator.GetKeyCode() == VK_ESCAPE); if (!delegate_ || delegate_->CloseOnEscape()) { Close(); @@ -203,8 +201,7 @@ BrowserWindow* InfoBubble::GetHostingWindow() { // ContentView ---------------------------------------------------------------- -InfoBubble::ContentView::ContentView(ChromeViews::View* content, - InfoBubble* host) +InfoBubble::ContentView::ContentView(views::View* content, InfoBubble* host) : host_(host) { if (UILayoutIsRightToLeft()) { arrow_edge_ = TOP_RIGHT; diff --git a/chrome/browser/views/info_bubble.h b/chrome/browser/views/info_bubble.h index 1c49a8d..64c8ec3 100644 --- a/chrome/browser/views/info_bubble.h +++ b/chrome/browser/views/info_bubble.h @@ -30,7 +30,7 @@ class InfoBubbleDelegate { virtual bool CloseOnEscape() = 0; }; -class InfoBubble : public ChromeViews::ContainerWin, +class InfoBubble : public views::ContainerWin, public AnimationDelegate { public: // Shows the InfoBubble. The InfoBubble is parented to parent_hwnd, contains @@ -43,7 +43,7 @@ class InfoBubble : public ChromeViews::ContainerWin, // behavior if there is no delegate). static InfoBubble* Show(HWND parent_hwnd, const gfx::Rect& position_relative_to, - ChromeViews::View* content, + views::View* content, InfoBubbleDelegate* delegate); InfoBubble(); @@ -52,7 +52,7 @@ class InfoBubble : public ChromeViews::ContainerWin, // Creates the InfoBubble. void Init(HWND parent_hwnd, const gfx::Rect& position_relative_to, - ChromeViews::View* content); + views::View* content); // Sets the delegate for that InfoBubble. void SetDelegate(InfoBubbleDelegate* delegate) { delegate_ = delegate; } @@ -67,7 +67,7 @@ class InfoBubble : public ChromeViews::ContainerWin, virtual void Close(); // AcceleratorTarget method: - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); // AnimationDelegate Implementation virtual void AnimationProgressed(const Animation* animation); @@ -77,7 +77,7 @@ class InfoBubble : public ChromeViews::ContainerWin, // InfoBubble::CreateContentView() creates one of these. ContentView houses // the supplied content as its only child view, renders the arrow/border of // the bubble and sizes the content. - class ContentView : public ChromeViews::View { + class ContentView : public views::View { public: // Possible edges the arrow is aligned along. enum ArrowEdge { @@ -89,7 +89,7 @@ class InfoBubble : public ChromeViews::ContainerWin, // Creates the ContentView. The supplied view is added as the only child of // the ContentView. - ContentView(ChromeViews::View* content, InfoBubble* host); + ContentView(views::View* content, InfoBubble* host); virtual ~ContentView() {} @@ -143,7 +143,7 @@ class InfoBubble : public ChromeViews::ContainerWin, }; // Creates and return a new ContentView containing content. - virtual ContentView* CreateContentView(ChromeViews::View* content); + virtual ContentView* CreateContentView(views::View* content); // Returns the BrowserWindow that owns this InfoBubble. BrowserWindow* GetHostingWindow(); diff --git a/chrome/browser/views/input_window.cc b/chrome/browser/views/input_window.cc index 77d7901..7eafd04 100644 --- a/chrome/browser/views/input_window.cc +++ b/chrome/browser/views/input_window.cc @@ -20,9 +20,9 @@ static const int kTextFieldWidth = 200; // ContentView, as the name implies, is the content view for the InputWindow. // It registers accelerators that accept/cancel the input. -class ContentView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::TextField::Controller { +class ContentView : public views::View, + public views::DialogDelegate, + public views::TextField::Controller { public: explicit ContentView(InputWindowDelegate* delegate) : delegate_(delegate), @@ -30,25 +30,24 @@ class ContentView : public ChromeViews::View, DCHECK(delegate_); } - // ChromeViews::DialogDelegate overrides: + // views::DialogDelegate overrides: virtual bool IsDialogButtonEnabled(DialogButton button) const; virtual bool Accept(); virtual bool Cancel(); virtual void WindowClosing(); virtual std::wstring GetWindowTitle() const; virtual bool IsModal() const { return true; } - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::TextField::Controller overrides: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // views::TextField::Controller overrides: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField*, UINT, TCHAR, UINT, - UINT) {} + virtual void HandleKeystroke(views::TextField*, UINT, TCHAR, UINT, UINT) {} protected: - // ChromeViews::View overrides: - virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, - ChromeViews::View* child); + // views::View overrides: + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); private: // Set up dialog controls and layout. @@ -58,7 +57,7 @@ class ContentView : public ChromeViews::View, void FocusFirstFocusableControl(); // The TextField that the user can type into. - ChromeViews::TextField* text_field_; + views::TextField* text_field_; // The delegate that the ContentView uses to communicate changes to the // caller. @@ -71,7 +70,7 @@ class ContentView : public ChromeViews::View, }; /////////////////////////////////////////////////////////////////////////////// -// ContentView, ChromeViews::DialogDelegate implementation: +// ContentView, views::DialogDelegate implementation: bool ContentView::IsDialogButtonEnabled(DialogButton button) const { if (button == DIALOGBUTTON_OK && !delegate_->IsValid(text_field_->GetText())) @@ -97,14 +96,14 @@ std::wstring ContentView::GetWindowTitle() const { return delegate_->GetWindowTitle(); } -ChromeViews::View* ContentView::GetContentsView() { +views::View* ContentView::GetContentsView() { return this; } /////////////////////////////////////////////////////////////////////////////// -// ContentView, ChromeViews::TextField::Controller implementation: +// ContentView, views::TextField::Controller implementation: -void ContentView::ContentsChanged(ChromeViews::TextField* sender, +void ContentView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { GetDialogClientView()->UpdateDialogButtons(); } @@ -113,8 +112,8 @@ void ContentView::ContentsChanged(ChromeViews::TextField* sender, // ContentView, protected: void ContentView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) InitControlLayout(); } @@ -123,12 +122,12 @@ void ContentView::ViewHierarchyChanged(bool is_add, // ContentView, private: void ContentView::InitControlLayout() { - text_field_ = new ChromeViews::TextField; + text_field_ = new views::TextField; text_field_->SetText(delegate_->GetTextFieldContents()); text_field_->SetController(this); - using ChromeViews::ColumnSet; - using ChromeViews::GridLayout; + using views::ColumnSet; + using views::GridLayout; // TODO(sky): Vertical alignment should be baseline. GridLayout* layout = CreatePanelGridLayout(this); @@ -142,8 +141,7 @@ void ContentView::InitControlLayout() { GridLayout::USE_PREF, kTextFieldWidth, kTextFieldWidth); layout->StartRow(0, 0); - ChromeViews::Label* label = - new ChromeViews::Label(delegate_->GetTextFieldLabel()); + views::Label* label = new views::Label(delegate_->GetTextFieldLabel()); layout->AddView(label); layout->AddView(text_field_); @@ -157,10 +155,10 @@ void ContentView::FocusFirstFocusableControl() { text_field_->RequestFocus(); } -ChromeViews::Window* CreateInputWindow(HWND parent_hwnd, - InputWindowDelegate* delegate) { - ChromeViews::Window* window = - ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), +views::Window* CreateInputWindow(HWND parent_hwnd, + InputWindowDelegate* delegate) { + views::Window* window = + views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), new ContentView(delegate)); window->client_view()->AsDialogClientView()->UpdateDialogButtons(); return window; diff --git a/chrome/browser/views/input_window.h b/chrome/browser/views/input_window.h index 0a0825f..e9cd7e9 100644 --- a/chrome/browser/views/input_window.h +++ b/chrome/browser/views/input_window.h @@ -9,7 +9,7 @@ // InputWindowDelegate -------------------------------------------------------- -class InputWindowDelegate : public ChromeViews::DialogDelegate { +class InputWindowDelegate : public views::DialogDelegate { public: // Returns the text displayed on the label preceding the text field. virtual std::wstring GetTextFieldLabel() = 0; @@ -33,12 +33,12 @@ class InputWindowDelegate : public ChromeViews::DialogDelegate { }; -namespace ChromeViews { +namespace views { class Window; }; -ChromeViews::Window* CreateInputWindow(HWND parent_hwnd, - InputWindowDelegate* delegate); +views::Window* CreateInputWindow(HWND parent_hwnd, + InputWindowDelegate* delegate); #endif // CHROME_BROWSER_VIEWS_INPUT_WINDOW_H__ diff --git a/chrome/browser/views/keyword_editor_view.cc b/chrome/browser/views/keyword_editor_view.cc index 043a9c6..c5b4dd5 100644 --- a/chrome/browser/views/keyword_editor_view.cc +++ b/chrome/browser/views/keyword_editor_view.cc @@ -33,9 +33,9 @@ #include "generated_resources.h" -using ChromeViews::GridLayout; -using ChromeViews::NativeButton; -using ChromeViews::TableColumn; +using views::GridLayout; +using views::NativeButton; +using views::TableColumn; // Group IDs used by TemplateURLTableModel. static const int kMainGroupID = 0; @@ -212,8 +212,7 @@ SkBitmap TemplateURLTableModel::GetIcon(int row) { return entries_[row]->GetIcon(); } -void TemplateURLTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { +void TemplateURLTableModel::SetObserver(views::TableModelObserver* observer) { observer_ = observer; } @@ -315,7 +314,7 @@ void TemplateURLTableModel::FavIconAvailable(ModelEntry* entry) { // If non-null, there is an open editor and this is the window it is contained // in. -static ChromeViews::Window* open_window = NULL; +static views::Window* open_window = NULL; // static void KeywordEditorView::RegisterUserPrefs(PrefService* prefs) { @@ -336,8 +335,8 @@ void KeywordEditorView::Show(Profile* profile) { // Initialize the UI. By passing in an empty rect KeywordEditorView is // queried for its preferred size. - open_window = ChromeViews::Window::CreateChromeWindow( - NULL, gfx::Rect(), keyword_editor); + open_window = views::Window::CreateChromeWindow(NULL, gfx::Rect(), + keyword_editor); open_window->Show(); } @@ -422,7 +421,7 @@ void KeywordEditorView::ModifyTemplateURL(const TemplateURL* template_url, } gfx::Size KeywordEditorView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_SEARCHENGINES_DIALOG_WIDTH_CHARS, IDS_SEARCHENGINES_DIALOG_HEIGHT_LINES)); } @@ -449,7 +448,7 @@ bool KeywordEditorView::Cancel() { return true; } -ChromeViews::View* KeywordEditorView::GetContentsView() { +views::View* KeywordEditorView::GetContentsView() { return this; } @@ -470,37 +469,36 @@ void KeywordEditorView::Init() { TableColumn(IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN, TableColumn::LEFT, -1, .25)); columns.back().sortable = true; - table_view_ = new ChromeViews::TableView(table_model_.get(), columns, - ChromeViews::ICON_AND_TEXT, false, true, true); + table_view_ = new views::TableView(table_model_.get(), columns, + views::ICON_AND_TEXT, false, true, true); table_view_->SetObserver(this); // Make the table initially sorted by name. - ChromeViews::TableView::SortDescriptors sort; - sort.push_back( - ChromeViews::TableView::SortDescriptor( - IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN, true)); + views::TableView::SortDescriptors sort; + sort.push_back(views::TableView::SortDescriptor( + IDS_SEARCH_ENGINES_EDITOR_DESCRIPTION_COLUMN, true)); table_view_->SetSortDescriptors(sort); - add_button_ = new ChromeViews::NativeButton( + add_button_ = new views::NativeButton( l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)); add_button_->SetEnabled(url_model_->loaded()); add_button_->SetListener(this); - edit_button_ = new ChromeViews::NativeButton( + edit_button_ = new views::NativeButton( l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON)); edit_button_->SetEnabled(false); edit_button_->SetListener(this); - remove_button_ = new ChromeViews::NativeButton( + remove_button_ = new views::NativeButton( l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)); remove_button_->SetEnabled(false); remove_button_->SetListener(this); - make_default_button_ = new ChromeViews::NativeButton( + make_default_button_ = new views::NativeButton( l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON)); make_default_button_->SetEnabled(false); make_default_button_->SetListener(this); - enable_suggest_checkbox_ = new ChromeViews::CheckBox( + enable_suggest_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_SUGGEST_PREF)); enable_suggest_checkbox_->SetMultiLine(true); // Enable the Suggest checkbox only if the default provider has Suggest @@ -524,7 +522,7 @@ void KeywordEditorView::InitLayoutManager() { SetLayoutManager(contents_layout); // For the table and buttons. - ChromeViews::ColumnSet* column_set = contents_layout->AddColumnSet(0); + views::ColumnSet* column_set = contents_layout->AddColumnSet(0); column_set->AddColumn(GridLayout::FILL, GridLayout::FILL, 1, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn(0, related_x); @@ -577,7 +575,7 @@ void KeywordEditorView::OnDoubleClick() { ButtonPressed(edit_button_); } -void KeywordEditorView::ButtonPressed(ChromeViews::NativeButton* sender) { +void KeywordEditorView::ButtonPressed(views::NativeButton* sender) { if (sender == add_button_) { EditKeywordController* controller = new EditKeywordController(GetContainer()->GetHWND(), NULL, this, @@ -589,7 +587,7 @@ void KeywordEditorView::ButtonPressed(ChromeViews::NativeButton* sender) { // worry about the model calling us back when we mutate it. url_model_->RemoveObserver(this); int last_view_row = -1; - for (ChromeViews::TableView::iterator i = table_view_->SelectionBegin(); + for (views::TableView::iterator i = table_view_->SelectionBegin(); i != table_view_->SelectionEnd(); ++i) { last_view_row = table_view_->model_to_view(*i); const TemplateURL* template_url = &table_model_->GetTemplateURL(*i); diff --git a/chrome/browser/views/keyword_editor_view.h b/chrome/browser/views/keyword_editor_view.h index 2d5b809..624cb14 100644 --- a/chrome/browser/views/keyword_editor_view.h +++ b/chrome/browser/views/keyword_editor_view.h @@ -15,7 +15,7 @@ #include "chrome/views/table_view.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class CheckBox; class Label; } @@ -40,7 +40,7 @@ class TemplateURLTableModel; // 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 ChromeViews::TableModel { +class TemplateURLTableModel : public views::TableModel { public: explicit TemplateURLTableModel(TemplateURLModel* template_url_model); @@ -54,7 +54,7 @@ class TemplateURLTableModel : public ChromeViews::TableModel { virtual int RowCount(); virtual std::wstring GetText(int row, int column); virtual SkBitmap GetIcon(int row); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); virtual bool HasGroups(); virtual Groups GetGroups(); virtual int GetGroupID(int row); @@ -96,7 +96,7 @@ class TemplateURLTableModel : public ChromeViews::TableModel { // Notification that a model entry has fetched its icon. void FavIconAvailable(ModelEntry* entry); - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; // The entries. std::vector<ModelEntry*> entries_; @@ -115,11 +115,11 @@ class TemplateURLTableModel : public ChromeViews::TableModel { // KeywordEditorView allows the user to edit keywords. -class KeywordEditorView : public ChromeViews::View, - public ChromeViews::TableViewObserver, - public ChromeViews::NativeButton::Listener, +class KeywordEditorView : public views::View, + public views::TableViewObserver, + public views::NativeButton::Listener, public TemplateURLModelObserver, - public ChromeViews::DialogDelegate { + public views::DialogDelegate { friend class KeywordEditorViewTest; FRIEND_TEST(KeywordEditorViewTest, MakeDefault); public: @@ -154,7 +154,7 @@ class KeywordEditorView : public ChromeViews::View, virtual int GetDialogButtons() const; virtual bool Accept(); virtual bool Cancel(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // Returns the TemplateURLModel we're using. TemplateURLModel* template_url_model() const { return url_model_; } @@ -171,7 +171,7 @@ class KeywordEditorView : public ChromeViews::View, virtual void OnDoubleClick(); // Button::ButtonListener method. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); // TemplateURLModelObserver notification. virtual void OnTemplateURLModelChanged(); @@ -195,12 +195,12 @@ class KeywordEditorView : public ChromeViews::View, // All the views are added as children, so that we don't need to delete // them directly. - ChromeViews::TableView* table_view_; - ChromeViews::NativeButton* add_button_; - ChromeViews::NativeButton* edit_button_; - ChromeViews::NativeButton* remove_button_; - ChromeViews::NativeButton* make_default_button_; - ChromeViews::CheckBox* enable_suggest_checkbox_; + views::TableView* table_view_; + views::NativeButton* add_button_; + views::NativeButton* edit_button_; + views::NativeButton* remove_button_; + views::NativeButton* make_default_button_; + views::CheckBox* enable_suggest_checkbox_; DISALLOW_COPY_AND_ASSIGN(KeywordEditorView); }; diff --git a/chrome/browser/views/keyword_editor_view_unittest.cc b/chrome/browser/views/keyword_editor_view_unittest.cc index 7afee5d..1bbb43c 100644 --- a/chrome/browser/views/keyword_editor_view_unittest.cc +++ b/chrome/browser/views/keyword_editor_view_unittest.cc @@ -12,7 +12,7 @@ // Base class for keyword editor tests. Creates a profile containing an // empty TemplateURLModel. class KeywordEditorViewTest : public testing::Test, - public ChromeViews::TableModelObserver { + public views::TableModelObserver { public: virtual void SetUp() { model_changed_count_ = items_changed_count_ = added_count_ = diff --git a/chrome/browser/views/location_bar_view.cc b/chrome/browser/views/location_bar_view.cc index bd9774c..32b1d79 100644 --- a/chrome/browser/views/location_bar_view.cc +++ b/chrome/browser/views/location_bar_view.cc @@ -30,7 +30,7 @@ #include "chrome/views/root_view.h" #include "generated_resources.h" -using ChromeViews::View; +using views::View; const int LocationBarView::kTextVertMargin = 2; @@ -123,7 +123,7 @@ void LocationBarView::Init() { } // URL edit field. - ChromeViews::Container* vc = GetContainer(); + views::Container* vc = GetContainer(); DCHECK(vc) << "LocationBarView::Init - vc is NULL!"; location_entry_.reset(new AutocompleteEditView(font_, this, model_, this, vc->GetHWND(), @@ -131,7 +131,7 @@ void LocationBarView::Init() { popup_window_mode_)); // View container for URL edit field. - location_entry_view_ = new ChromeViews::HWNDView; + location_entry_view_ = new views::HWNDView; DCHECK(location_entry_view_) << "LocationBarView::Init - OOM!"; location_entry_view_->SetID(VIEW_ID_AUTOCOMPLETE); AddChildView(location_entry_view_); @@ -266,16 +266,16 @@ void LocationBarView::VisibleBoundsInRootChanged() { location_entry_->ClosePopup(); } -bool LocationBarView::OnMousePressed(const ChromeViews::MouseEvent& event) { +bool LocationBarView::OnMousePressed(const views::MouseEvent& event) { UINT msg; if (event.IsLeftMouseButton()) { - msg = (event.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? WM_LBUTTONDBLCLK : WM_LBUTTONDOWN; } else if (event.IsMiddleMouseButton()) { - msg = (event.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? WM_MBUTTONDBLCLK : WM_MBUTTONDOWN; } else if (event.IsRightMouseButton()) { - msg = (event.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) ? + msg = (event.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) ? WM_RBUTTONDBLCLK : WM_RBUTTONDOWN; } else { NOTREACHED(); @@ -285,12 +285,12 @@ bool LocationBarView::OnMousePressed(const ChromeViews::MouseEvent& event) { return true; } -bool LocationBarView::OnMouseDragged(const ChromeViews::MouseEvent& event) { +bool LocationBarView::OnMouseDragged(const views::MouseEvent& event) { OnMouseEvent(event, WM_MOUSEMOVE); return true; } -void LocationBarView::OnMouseReleased(const ChromeViews::MouseEvent& event, +void LocationBarView::OnMouseReleased(const views::MouseEvent& event, bool canceled) { UINT msg; if (canceled) { @@ -493,7 +493,7 @@ bool LocationBarView::AdjustHints(int text_width, int max_width) { return needs_layout; } -void LocationBarView::LayoutView(bool leading, ChromeViews::View* view, +void LocationBarView::LayoutView(bool leading, views::View* view, int text_width, int max_width, gfx::Rect* bounds) { DCHECK(view && bounds); @@ -554,8 +554,7 @@ bool LocationBarView::ToggleVisibility(bool new_vis, View* view) { return false; } -void LocationBarView::OnMouseEvent(const ChromeViews::MouseEvent& event, - UINT msg) { +void LocationBarView::OnMouseEvent(const views::MouseEvent& event, UINT msg) { UINT flags = 0; if (event.IsControlDown()) flags |= MK_CONTROL; @@ -612,11 +611,11 @@ LocationBarView::SelectedKeywordView::SelectedKeywordView(Profile* profile) full_label_.SetVisible(false); partial_label_.SetVisible(false); full_label_.SetBorder( - ChromeViews::Border::CreateEmptyBorder(kTopInset, kLeftInset, - kBottomInset, kRightInset)); + views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, + kRightInset)); partial_label_.SetBorder( - ChromeViews::Border::CreateEmptyBorder(kTopInset, kLeftInset, - kBottomInset, kRightInset)); + views::Border::CreateEmptyBorder(kTopInset, kLeftInset, kBottomInset, + kRightInset)); } LocationBarView::SelectedKeywordView::~SelectedKeywordView() { @@ -795,7 +794,7 @@ void LocationBarView::KeywordHintView::Layout() { // We don't translate accelerators for ALT + numpad digit, they are used for // entering special characters. -bool LocationBarView::ShouldLookupAccelerators(const ChromeViews::KeyEvent& e) { +bool LocationBarView::ShouldLookupAccelerators(const views::KeyEvent& e) { if (!e.IsAltDown()) return true; @@ -861,7 +860,7 @@ void LocationBarView::ShowFirstRunBubbleInternal() { // right hand side of the location bar. if (UILayoutIsRightToLeft()) location.Offset(width(), 0); - ChromeViews::View::ConvertPointToScreen(this, &location); + views::View::ConvertPointToScreen(this, &location); // We try to guess that 20 pixels offset is a good place for the first // letter in the OmniBox. @@ -935,15 +934,15 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() { model_->GetIconHoverText(&text, &text_color); gfx::Point location; - ChromeViews::View::ConvertPointToScreen(this, &location); + views::View::ConvertPointToScreen(this, &location); gfx::Rect bounds(location.x(), location.y(), width(), height()); - ChromeViews::Label* label = new ChromeViews::Label(text); + views::Label* label = new views::Label(text); label->SetMultiLine(true); label->SetColor(text_color); label->SetFont(ResourceBundle::GetSharedInstance().GetFont( ResourceBundle::BaseFont).DeriveFont(2)); - label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); label->SizeToFit(0); DCHECK(info_bubble_ == NULL); info_bubble_ = InfoBubble::Show(GetRootView()->GetContainer()->GetHWND(), @@ -952,7 +951,7 @@ void LocationBarView::SecurityImageView::ShowInfoBubble() { } void LocationBarView::SecurityImageView::OnMouseMoved( - const ChromeViews::MouseEvent& event) { + const views::MouseEvent& event) { if (show_info_bubble_task_) { show_info_bubble_task_->Cancel(); show_info_bubble_task_ = NULL; @@ -969,7 +968,7 @@ void LocationBarView::SecurityImageView::OnMouseMoved( } void LocationBarView::SecurityImageView::OnMouseExited( - const ChromeViews::MouseEvent& event) { + const views::MouseEvent& event) { if (show_info_bubble_task_) { show_info_bubble_task_->Cancel(); show_info_bubble_task_ = NULL; @@ -980,7 +979,7 @@ void LocationBarView::SecurityImageView::OnMouseExited( } bool LocationBarView::SecurityImageView::OnMousePressed( - const ChromeViews::MouseEvent& event) { + const views::MouseEvent& event) { NavigationEntry* nav_entry = BrowserList::GetLastActive()->GetSelectedTabContents()-> controller()->GetActiveEntry(); @@ -1001,7 +1000,7 @@ void LocationBarView::SecurityImageView::InfoBubbleClosing( } bool LocationBarView::OverrideAccelerator( - const ChromeViews::Accelerator& accelerator) { + const views::Accelerator& accelerator) { return location_entry_->OverrideAccelerator(accelerator); } diff --git a/chrome/browser/views/location_bar_view.h b/chrome/browser/views/location_bar_view.h index 2c138f5..089b3c1 100644 --- a/chrome/browser/views/location_bar_view.h +++ b/chrome/browser/views/location_bar_view.h @@ -30,7 +30,7 @@ class Profile; // of the URL bar strip and contains its content. // ///////////////////////////////////////////////////////////////////////////// -class LocationBarView : public ChromeViews::View, +class LocationBarView : public views::View, public AutocompleteEditController { public: @@ -84,10 +84,9 @@ class LocationBarView : public ChromeViews::View, virtual void VisibleBoundsInRootChanged(); // Event Handlers - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& event, - bool canceled); + virtual bool OnMousePressed(const views::MouseEvent& event); + virtual bool OnMouseDragged(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); // AutocompleteEditController virtual void OnAutocompleteAccept(const std::wstring& url, @@ -125,7 +124,7 @@ class LocationBarView : public ChromeViews::View, void ShowFirstRunBubble(); // Overridden from View. - virtual bool OverrideAccelerator(const ChromeViews::Accelerator& accelerator); + virtual bool OverrideAccelerator(const views::Accelerator& accelerator); static const int kTextVertMargin; static const COLORREF kBackgroundColorByLevel[]; @@ -134,7 +133,7 @@ class LocationBarView : public ChromeViews::View, void Focus(); // Overridden from Chrome::View. - virtual bool ShouldLookupAccelerators(const ChromeViews::KeyEvent& e); + virtual bool ShouldLookupAccelerators(const views::KeyEvent& e); private: // View used when the user has selected a keyword. @@ -143,7 +142,7 @@ class LocationBarView : public ChromeViews::View, // complete description of the keyword, the second contains a truncated // version of the description. The second is used if there is not enough room // to display the complete description. - class SelectedKeywordView : public ChromeViews::View { + class SelectedKeywordView : public views::View { public: explicit SelectedKeywordView(Profile* profile); virtual ~SelectedKeywordView(); @@ -172,13 +171,13 @@ class LocationBarView : public ChromeViews::View, std::wstring keyword_; // For painting the background. - ChromeViews::HorizontalPainter background_painter_; + views::HorizontalPainter background_painter_; // Label containing the complete description. - ChromeViews::Label full_label_; + views::Label full_label_; // Label containing the partial description. - ChromeViews::Label partial_label_; + views::Label partial_label_; Profile* profile_; @@ -193,7 +192,7 @@ class LocationBarView : public ChromeViews::View, // // NOTE: This should really be called LocationBarKeywordHintView, but I // couldn't bring myself to use such a long name. - class KeywordHintView : public ChromeViews::View { + class KeywordHintView : public views::View { public: explicit KeywordHintView(Profile* profile); virtual ~KeywordHintView(); @@ -214,8 +213,8 @@ class LocationBarView : public ChromeViews::View, void set_profile(Profile* profile) { profile_ = profile; } private: - ChromeViews::Label leading_label_; - ChromeViews::Label trailing_label_; + views::Label leading_label_; + views::Label trailing_label_; // The keyword. std::wstring keyword_; @@ -234,7 +233,7 @@ class LocationBarView : public ChromeViews::View, // // If a message has been set with SetInfoBubbleText, it displays an info // bubble when the mouse hovers on the image. - class SecurityImageView : public ChromeViews::ImageView, + class SecurityImageView : public views::ImageView, public InfoBubbleDelegate { public: enum Image { @@ -249,9 +248,9 @@ class LocationBarView : public ChromeViews::View, void SetImageShown(Image image); // Overridden from view for the mouse hovering. - virtual void OnMouseMoved(const ChromeViews::MouseEvent& event); - virtual void OnMouseExited(const ChromeViews::MouseEvent& event); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); + virtual void OnMouseMoved(const views::MouseEvent& event); + virtual void OnMouseExited(const views::MouseEvent& event); + virtual bool OnMousePressed(const views::MouseEvent& event); // InfoBubbleDelegate void InfoBubbleClosing(InfoBubble* info_bubble); @@ -311,7 +310,7 @@ class LocationBarView : public ChromeViews::View, // If View fits in the specified region, it is made visible and the // bounds are adjusted appropriately. If the View does not fit, it is // made invisible. - void LayoutView(bool leading, ChromeViews::View* view, int text_width, + void LayoutView(bool leading, views::View* view, int text_width, int max_width, gfx::Rect* bounds); // Sets the security icon to display. Note that no repaint is done. @@ -326,10 +325,10 @@ class LocationBarView : public ChromeViews::View, // Sets the visibility of view to new_vis. Returns whether the visibility // changed. - bool ToggleVisibility(bool new_vis, ChromeViews::View* view); + bool ToggleVisibility(bool new_vis, views::View* view); // Helper for the Mouse event handlers that does all the real work. - void OnMouseEvent(const ChromeViews::MouseEvent& event, UINT msg); + void OnMouseEvent(const views::MouseEvent& event, UINT msg); // Helper to show the first run info bubble. void ShowFirstRunBubbleInternal(); @@ -363,7 +362,7 @@ class LocationBarView : public ChromeViews::View, ChromeFont font_; // Location_entry view wrapper - ChromeViews::HWNDView* location_entry_view_; + views::HWNDView* location_entry_view_; // The following views are used to provide hints and remind the user as to // what is going in the edit. They are all added a children of the @@ -377,13 +376,13 @@ class LocationBarView : public ChromeViews::View, KeywordHintView keyword_hint_view_; // Shown if the text is not a keyword or url. - ChromeViews::Label type_to_search_view_; + views::Label type_to_search_view_; // The view that shows the lock/warning when in HTTPS mode. SecurityImageView security_image_view_; // A label displayed after the lock icon to show some extra information. - ChromeViews::Label info_label_; + views::Label info_label_; // When true, the location bar view is read only and also is has a slightly // different presentation (font size / color). This is used for popups. diff --git a/chrome/browser/views/login_view.cc b/chrome/browser/views/login_view.cc index ccbad1f..9f7e7be 100644 --- a/chrome/browser/views/login_view.cc +++ b/chrome/browser/views/login_view.cc @@ -16,7 +16,7 @@ #include "generated_resources.h" -namespace ChromeViews { +namespace views { static const int kMessageWidth = 320; static const int kTextFieldStackHorizontalSpacing = 30; @@ -96,7 +96,7 @@ void LoginView::SetModel(LoginModel* model) { login_model_->SetObserver(this); } /////////////////////////////////////////////////////////////////////////////// -// LoginView, ChromeViews::View, ChromeViews::LoginModelObserver overrides: +// LoginView, views::View, views::LoginModelObserver overrides: void LoginView::ViewHierarchyChanged(bool is_add, View *parent, View *child) { if (is_add && child == this) { diff --git a/chrome/browser/views/login_view.h b/chrome/browser/views/login_view.h index 3379646..10aa07a 100644 --- a/chrome/browser/views/login_view.h +++ b/chrome/browser/views/login_view.h @@ -8,7 +8,7 @@ #include "base/task.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class TextField; class LoginModel; @@ -53,7 +53,7 @@ class LoginView : public View, public LoginModelObserver { void SetModel(LoginModel* model); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, View *parent, View *child); private: diff --git a/chrome/browser/views/old_frames/frame_view.cc b/chrome/browser/views/old_frames/frame_view.cc index 5ebe153..97b3b37 100644 --- a/chrome/browser/views/old_frames/frame_view.cc +++ b/chrome/browser/views/old_frames/frame_view.cc @@ -15,7 +15,7 @@ FrameView::FrameView(BrowserWindow* window) forwarding_to_tab_strip_(false) { } -void FrameView::AddViewToDropList(ChromeViews::View* view) { +void FrameView::AddViewToDropList(views::View* view) { dropable_views_.insert(view); } @@ -26,19 +26,19 @@ bool FrameView::CanDrop(const OSExchangeData& data) { return can_drop_; } -void FrameView::OnDragEntered(const ChromeViews::DropTargetEvent& event) { +void FrameView::OnDragEntered(const views::DropTargetEvent& event) { if (can_drop_ && ShouldForwardToTabStrip(event)) { forwarding_to_tab_strip_ = true; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); window_->GetTabStrip()->OnDragEntered(*mapped_event.get()); } } -int FrameView::OnDragUpdated(const ChromeViews::DropTargetEvent& event) { +int FrameView::OnDragUpdated(const views::DropTargetEvent& event) { if (can_drop_) { if (ShouldForwardToTabStrip(event)) { - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); if (!forwarding_to_tab_strip_) { window_->GetTabStrip()->OnDragEntered(*mapped_event.get()); @@ -60,10 +60,10 @@ void FrameView::OnDragExited() { } } -int FrameView::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { +int FrameView::OnPerformDrop(const views::DropTargetEvent& event) { if (forwarding_to_tab_strip_) { forwarding_to_tab_strip_ = false; - scoped_ptr<ChromeViews::DropTargetEvent> mapped_event( + scoped_ptr<views::DropTargetEvent> mapped_event( MapEventToTabStrip(event)); return window_->GetTabStrip()->OnPerformDrop(*mapped_event.get()); } @@ -71,7 +71,7 @@ int FrameView::OnPerformDrop(const ChromeViews::DropTargetEvent& event) { } bool FrameView::ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event) { + const views::DropTargetEvent& event) { if (!window_->GetTabStrip()->IsVisible()) return false; @@ -86,7 +86,7 @@ bool FrameView::ShouldForwardToTabStrip( // Mouse isn't over the tab strip. Only forward if the mouse isn't over // another view on the tab strip or is over a view we were told the user can // drop on. - ChromeViews::View* view_over_mouse = GetViewForPoint(event.location()); + views::View* view_over_mouse = GetViewForPoint(event.location()); return (view_over_mouse == this || view_over_mouse == window_->GetTabStrip() || dropable_views_.find(view_over_mouse) != dropable_views_.end()); @@ -97,12 +97,12 @@ void FrameView::ViewHierarchyChanged(bool is_add, View* parent, View* child) { dropable_views_.erase(child); } -ChromeViews::DropTargetEvent* FrameView::MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event) { +views::DropTargetEvent* FrameView::MapEventToTabStrip( + const views::DropTargetEvent& event) { gfx::Point tab_strip_loc(event.location()); ConvertPointToView(this, window_->GetTabStrip(), &tab_strip_loc); - return new ChromeViews::DropTargetEvent(event.GetData(), tab_strip_loc.x(), - tab_strip_loc.y(), - event.GetSourceOperations()); + return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(), + tab_strip_loc.y(), + event.GetSourceOperations()); } diff --git a/chrome/browser/views/old_frames/frame_view.h b/chrome/browser/views/old_frames/frame_view.h index 81e3010..fbb0f20 100644 --- a/chrome/browser/views/old_frames/frame_view.h +++ b/chrome/browser/views/old_frames/frame_view.h @@ -15,7 +15,7 @@ class OSExchangeData; // FrameView is the View that contains all the views of the BrowserWindow // (XPFrame or VistaFrame). FrameView forwards all drag and drop messages to // the TabStrip. -class FrameView : public ChromeViews::View { +class FrameView : public views::View { public: explicit FrameView(BrowserWindow* frame); virtual ~FrameView() {} @@ -23,22 +23,21 @@ class FrameView : public ChromeViews::View { // Adds view to the set of views that drops are allowed to occur on. You only // need invoke this for views whose y-coordinate extends above the tab strip // and you want to allow drops on. - void AddViewToDropList(ChromeViews::View* view); + void AddViewToDropList(views::View* view); protected: // As long as ShouldForwardToTabStrip returns true, drag and drop methods // are forwarded to the tab strip. virtual bool CanDrop(const OSExchangeData& data); - virtual void OnDragEntered(const ChromeViews::DropTargetEvent& event); - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event); + virtual void OnDragEntered(const views::DropTargetEvent& event); + virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event); + virtual int OnPerformDrop(const views::DropTargetEvent& event); // Returns true if the event should be forwarded to the TabStrip. This returns // true if y coordinate is less than the bottom of the tab strip, and is not // over another child view. - virtual bool ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event); + virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); // Overriden to remove views from dropable_views_. virtual void ViewHierarchyChanged(bool is_add, View* parent, View* child); @@ -46,8 +45,8 @@ class FrameView : public ChromeViews::View { private: // Creates and returns a new DropTargetEvent in the coordinates of the // TabStrip. - ChromeViews::DropTargetEvent* MapEventToTabStrip( - const ChromeViews::DropTargetEvent& event); + views::DropTargetEvent* MapEventToTabStrip( + const views::DropTargetEvent& event); // The BrowserWindow we're the child of. BrowserWindow* window_; @@ -61,7 +60,7 @@ class FrameView : public ChromeViews::View { bool forwarding_to_tab_strip_; // Set of additional views drops are allowed on. We do NOT own these. - std::set<ChromeViews::View*> dropable_views_; + std::set<views::View*> dropable_views_; DISALLOW_EVIL_CONSTRUCTORS(FrameView); }; diff --git a/chrome/browser/views/old_frames/simple_vista_frame.cc b/chrome/browser/views/old_frames/simple_vista_frame.cc index 82b246c..3ec7260 100644 --- a/chrome/browser/views/old_frames/simple_vista_frame.cc +++ b/chrome/browser/views/old_frames/simple_vista_frame.cc @@ -54,8 +54,8 @@ SimpleVistaFrame* SimpleVistaFrame::CreateFrame(const gfx::Rect& bounds, l10n_util::GetString(IDS_PRODUCT_NAME).c_str()); instance->InitAfterHWNDCreated(); instance->SetIsOffTheRecord(browser->profile()->IsOffTheRecord()); - ChromeViews::FocusManager::CreateFocusManager(instance->m_hWnd, - instance->GetRootView()); + views::FocusManager::CreateFocusManager(instance->m_hWnd, + instance->GetRootView()); return instance; } diff --git a/chrome/browser/views/old_frames/simple_xp_frame.cc b/chrome/browser/views/old_frames/simple_xp_frame.cc index 8436b63..8030a55 100644 --- a/chrome/browser/views/old_frames/simple_xp_frame.cc +++ b/chrome/browser/views/old_frames/simple_xp_frame.cc @@ -65,7 +65,7 @@ static const int kLocationBarSpacing = 1; // //////////////////////////////////////////////////////////////////////////////// TitleBarMenuButton::TitleBarMenuButton(SimpleXPFrameTitleBar* title_bar) - : ChromeViews::MenuButton(L"", title_bar, false), + : views::MenuButton(L"", title_bar, false), contents_(NULL), title_bar_(title_bar) { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); @@ -75,7 +75,7 @@ TitleBarMenuButton::TitleBarMenuButton(SimpleXPFrameTitleBar* title_bar) TitleBarMenuButton::~TitleBarMenuButton() { } -void TitleBarMenuButton::SetContents(ChromeViews::View* contents) { +void TitleBarMenuButton::SetContents(views::View* contents) { contents_ = contents; } @@ -110,7 +110,7 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) { s.height()); } - // We can not use the mirroring infrastructure in ChromeViews in order to + // We can not use the mirroring infrastructure in views in order to // mirror the drop down arrow because is is drawn directly on the canvas // (instead of using a child View). Thus, we should mirror its position // manually. @@ -122,8 +122,8 @@ void TitleBarMenuButton::Paint(ChromeCanvas* canvas) { canvas->DrawBitmapInt(*drop_arrow_, arrow_bounds.x(), arrow_bounds.y()); } -bool TitleBarMenuButton::OnMousePressed(const ChromeViews::MouseEvent& e) { - if (e.GetFlags() & ChromeViews::MouseEvent::EF_IS_DOUBLE_CLICK) { +bool TitleBarMenuButton::OnMousePressed(const views::MouseEvent& e) { + if (e.GetFlags() & views::MouseEvent::EF_IS_DOUBLE_CLICK) { if (!HitTest(e.location())) return true; title_bar_->CloseWindow(); @@ -151,9 +151,9 @@ SimpleXPFrameTitleBar::SimpleXPFrameTitleBar(SimpleXPFrame* parent) tab_icon_->Update(); - label_ = new ChromeViews::Label(); + label_ = new views::Label(); label_->SetColor(kTitleBarTextColor); - label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(label_); } @@ -188,7 +188,7 @@ SkBitmap SimpleXPFrameTitleBar::GetFavIcon() { return SkBitmap(); } -void SimpleXPFrameTitleBar::RunMenu(ChromeViews::View* source, +void SimpleXPFrameTitleBar::RunMenu(views::View* source, const CPoint& pt, HWND hwnd) { // Make sure we calculate the menu position based on the display bounds of // the menu button. The display bounds are different than the actual bounds @@ -263,8 +263,8 @@ SimpleXPFrame* SimpleXPFrame::CreateFrame(const gfx::Rect& bounds, l10n_util::GetString(IDS_PRODUCT_NAME).c_str()); instance->InitAfterHWNDCreated(); instance->SetIsOffTheRecord(browser->profile()->IsOffTheRecord()); - ChromeViews::FocusManager::CreateFocusManager(instance->m_hWnd, - instance->GetRootView()); + views::FocusManager::CreateFocusManager(instance->m_hWnd, + instance->GetRootView()); return instance; } @@ -341,7 +341,7 @@ void SimpleXPFrame::Layout() { LRESULT SimpleXPFrame::OnNCHitTest(const CPoint& pt) { if (IsTitleBarVisible()) { gfx::Point p(pt); - ChromeViews::View::ConvertPointToView(NULL, title_bar_, &p); + views::View::ConvertPointToView(NULL, title_bar_, &p); if (!title_bar_->WillHandleMouseEvent(p.x(), p.y()) && p.x() >= 0 && p.y() >= kTopResizeBarHeight && p.x() < title_bar_->width() && diff --git a/chrome/browser/views/old_frames/simple_xp_frame.h b/chrome/browser/views/old_frames/simple_xp_frame.h index 2b5b368..ac06612 100644 --- a/chrome/browser/views/old_frames/simple_xp_frame.h +++ b/chrome/browser/views/old_frames/simple_xp_frame.h @@ -14,7 +14,7 @@ class SimpleXPFrameTitleBar; class WebAppIconManager; -namespace ChromeViews { +namespace views { class Label; } @@ -99,25 +99,25 @@ class SimpleXPFrameTitleBar; // A custom menu button for the custom title bar. // //////////////////////////////////////////////////////////////////////////////// -class TitleBarMenuButton : public ChromeViews::MenuButton { +class TitleBarMenuButton : public views::MenuButton { public: explicit TitleBarMenuButton(SimpleXPFrameTitleBar* title_bar); virtual ~TitleBarMenuButton(); // Set the contents view which is the view presenting the menu icon. - void SetContents(ChromeViews::View* contents); + void SetContents(views::View* contents); // overridden from View virtual gfx::Size GetPreferredSize(); virtual void Paint(ChromeCanvas* canvas); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); + virtual bool OnMousePressed(const views::MouseEvent& e); private: // The drop arrow icon. SkBitmap* drop_arrow_; // The contents is an additional view positioned before the drop down. - ChromeViews::View* contents_; + views::View* contents_; // The title bar that created this instance. SimpleXPFrameTitleBar* title_bar_; @@ -130,9 +130,9 @@ class TitleBarMenuButton : public ChromeViews::MenuButton { // Custom title bar. // //////////////////////////////////////////////////////////////////////////////// -class SimpleXPFrameTitleBar : public ChromeViews::View, +class SimpleXPFrameTitleBar : public views::View, public TabIconView::TabContentsProvider, - public ChromeViews::ViewMenuDelegate { + public views::ViewMenuDelegate { public: explicit SimpleXPFrameTitleBar(SimpleXPFrame* parent); virtual ~SimpleXPFrameTitleBar(); @@ -141,7 +141,7 @@ class SimpleXPFrameTitleBar : public ChromeViews::View, virtual TabContents* GetCurrentTabContents(); virtual SkBitmap GetFavIcon(); - virtual void RunMenu(ChromeViews::View* source, const CPoint& pt, HWND hwnd); + virtual void RunMenu(views::View* source, const CPoint& pt, HWND hwnd); virtual void Layout(); bool WillHandleMouseEvent(int x, int y); void SetWindowTitle(std::wstring s); @@ -164,7 +164,7 @@ class SimpleXPFrameTitleBar : public ChromeViews::View, SimpleXPFrame* parent_; // The window title. - ChromeViews::Label* label_; + views::Label* label_; // Lazily created chrome icon. Created and used as the icon in the // TabIconView for all non-Application windows. diff --git a/chrome/browser/views/old_frames/vista_frame.cc b/chrome/browser/views/old_frames/vista_frame.cc index d381731..ce8ff70 100644 --- a/chrome/browser/views/old_frames/vista_frame.cc +++ b/chrome/browser/views/old_frames/vista_frame.cc @@ -98,8 +98,8 @@ typedef enum { CT_BOTTOM_CENTER = 0, CT_BOTTOM_LEFT_CORNER, CT_BOTTOM_RIGHT_CORNER, CT_LEFT_SIDE, CT_RIGHT_SIDE, CT_TOP_CENTER, CT_TOP_LEFT_CORNER, CT_TOP_RIGHT_CORNER }; -using ChromeViews::Accelerator; -using ChromeViews::FocusManager; +using views::Accelerator; +using views::FocusManager; //static VistaFrame* VistaFrame::CreateFrame(const gfx::Rect& bounds, @@ -152,7 +152,7 @@ VistaFrame::~VistaFrame() { // On Vista (unlike on XP), we let the OS render the Windows decor (close // button, maximize button, etc.). Since the mirroring infrastructure in -// ChromeViews does not rely on HWND flipping, the Windows decor on Vista are +// views does not rely on HWND flipping, the Windows decor on Vista are // not mirrored for RTL locales; that is, they appear on the upper right // instead of on the upper left (see bug http://b/issue?id=1128173). // @@ -161,7 +161,7 @@ VistaFrame::~VistaFrame() { // RTL locales by the mirroring infrastructure. In order to make sure they are // not mirrored, we flip them manually so make sure they don't overlap the // Windows decor. Unfortunately, there is no cleaner way to do this because the -// current ChromeViews mirroring API does not allow mirroring the position of +// current views mirroring API does not allow mirroring the position of // a subset of child Views; in other words, once a View is mirrored (in our // case frame_view_), then the positions of all its child Views (including, in // our case, the OTR image and the tabstrip) are mirrored. Once bug mentioned @@ -397,7 +397,7 @@ void VistaFrame::Init() { // Link the HWND with its root view so we can retrieve the RootView from the // HWND for automation purposes. - ChromeViews::SetRootViewForHWND(m_hWnd, &root_view_); + views::SetRootViewForHWND(m_hWnd, &root_view_); frame_view_ = new VistaFrameView(this); root_view_.AddChildView(frame_view_); @@ -414,20 +414,19 @@ void VistaFrame::Init() { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); if (is_off_the_record_) { - off_the_record_image_ = new ChromeViews::ImageView(); + off_the_record_image_ = new views::ImageView(); frame_view_->AddViewToDropList(off_the_record_image_); SkBitmap* otr_icon = rb.GetBitmapNamed(IDR_OTR_ICON); off_the_record_image_->SetImage(*otr_icon); off_the_record_image_->SetTooltipText( l10n_util::GetString(IDS_OFF_THE_RECORD_TOOLTIP)); - off_the_record_image_->SetVerticalAlignment( - ChromeViews::ImageView::LEADING); + off_the_record_image_->SetVerticalAlignment(views::ImageView::LEADING); frame_view_->AddChildView(off_the_record_image_); } SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO); if (!image->isNull()) { - distributor_logo_ = new ChromeViews::ImageView(); + distributor_logo_ = new views::ImageView(); frame_view_->AddViewToDropList(distributor_logo_); distributor_logo_->SetImage(image); frame_view_->AddChildView(distributor_logo_); @@ -540,9 +539,8 @@ void VistaFrame::SetAcceleratorTable( accelerator_table_.reset(accelerator_table); } -bool VistaFrame::GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator) { - std::map<ChromeViews::Accelerator, int>::iterator it = +bool VistaFrame::GetAccelerator(int cmd_id, views::Accelerator* accelerator) { + std::map<views::Accelerator, int>::iterator it = accelerator_table_->begin(); for (; it != accelerator_table_->end(); ++it) { if(it->second == cmd_id) { @@ -587,7 +585,7 @@ gfx::Rect VistaFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { } gfx::Point p; - ChromeViews::View::ConvertPointToContainer(tab_contents_container_, &p); + views::View::ConvertPointToContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); @@ -848,14 +846,12 @@ LRESULT VistaFrame::OnGetObject(UINT uMsg, WPARAM w_param, LPARAM object_id) { } void VistaFrame::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { - ChromeViews::KeyEvent event(ChromeViews::Event::ET_KEY_PRESSED, c, - rep_cnt, flags); + views::KeyEvent event(views::Event::ET_KEY_PRESSED, c, rep_cnt, flags); root_view_.ProcessKeyEvent(event); } void VistaFrame::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { - ChromeViews::KeyEvent event(ChromeViews::Event::ET_KEY_RELEASED, c, - rep_cnt, flags); + views::KeyEvent event(views::Event::ET_KEY_RELEASED, c, rep_cnt, flags); root_view_.ProcessKeyEvent(event); } @@ -969,13 +965,13 @@ LRESULT VistaFrame::OnNCHitTest(const CPoint& pt) { GetBounds(&cr, false); gfx::Point tab_pt(pt); - ChromeViews::View::ConvertPointToView(NULL, tabstrip_, &tab_pt); + views::View::ConvertPointToView(NULL, tabstrip_, &tab_pt); // If we are over the tabstrip if (tab_pt.x() > 0 && tab_pt.y() >= kTabShadowSize && tab_pt.x() < tabstrip_->width() && tab_pt.y() < tabstrip_->height()) { - ChromeViews::View* v = tabstrip_->GetViewForPoint(tab_pt); + views::View* v = tabstrip_->GetViewForPoint(tab_pt); if (v == tabstrip_) return HTCAPTION; @@ -1117,7 +1113,7 @@ void VistaFrame::OnCaptureChanged(HWND hwnd) { bool VistaFrame::ProcessMousePressed(const CPoint& pt, UINT flags, bool dbl_click) { - using namespace ChromeViews; + using namespace views; MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, pt.x, pt.y, @@ -1136,7 +1132,7 @@ bool VistaFrame::ProcessMousePressed(const CPoint& pt, UINT flags, } void VistaFrame::ProcessMouseDragged(const CPoint& pt, UINT flags) { - using namespace ChromeViews; + using namespace views; MouseEvent drag_event(Event::ET_MOUSE_DRAGGED, pt.x, pt.y, @@ -1145,7 +1141,7 @@ void VistaFrame::ProcessMouseDragged(const CPoint& pt, UINT flags) { } void VistaFrame::ProcessMouseReleased(const CPoint& pt, UINT flags) { - using namespace ChromeViews; + using namespace views; if (in_drag_session_) { in_drag_session_ = false; ReleaseCapture(); @@ -1158,7 +1154,7 @@ void VistaFrame::ProcessMouseReleased(const CPoint& pt, UINT flags) { } void VistaFrame::ProcessMouseMoved(const CPoint &pt, UINT flags) { - using namespace ChromeViews; + using namespace views; MouseEvent mouse_move(Event::ET_MOUSE_MOVED, pt.x, pt.y, @@ -1172,7 +1168,7 @@ void VistaFrame::ProcessMouseExited() { //////////////////////////////////////////////////////////////////////////////// // -// ChromeViews::Container +// views::Container // //////////////////////////////////////////////////////////////////////////////// @@ -1213,8 +1209,8 @@ void VistaFrame::PaintNow(const CRect& update_rect) { } } -ChromeViews::RootView* VistaFrame::GetRootView() { - return const_cast<ChromeViews::RootView*>(&root_view_); +views::RootView* VistaFrame::GetRootView() { + return const_cast<views::RootView*>(&root_view_); } bool VistaFrame::IsVisible() { @@ -1337,7 +1333,7 @@ static void UpdatePosition(const TITLEBARINFOEX& info, } bool VistaFrame::VistaFrameView::ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event) { + const views::DropTargetEvent& event) { if (!FrameView::ShouldForwardToTabStrip(event)) return false; @@ -1386,7 +1382,7 @@ LRESULT VistaFrame::OnNotify(int w_param, NMHDR* l_param) { return result; } -ChromeViews::TooltipManager* VistaFrame::GetTooltipManager() { +views::TooltipManager* VistaFrame::GetTooltipManager() { return tooltip_manager_.get(); } @@ -1395,7 +1391,7 @@ StatusBubble* VistaFrame::GetStatusBubble() { } void VistaFrame::InitAfterHWNDCreated() { - tooltip_manager_.reset(new ChromeViews::AeroTooltipManager(this, m_hWnd)); + tooltip_manager_.reset(new views::AeroTooltipManager(this, m_hWnd)); } void VistaFrame::ResetDWMFrame() { @@ -1436,8 +1432,8 @@ void VistaFrame::SelectedTabToolbarSizeChanged(bool is_animating) { } } -bool VistaFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** view) { +bool VistaFrame::UpdateChildViewAndLayout(views::View* new_view, + views::View** view) { DCHECK(view); if (*view == new_view) { // The views haven't changed, if the views pref changed schedule a layout. @@ -1601,18 +1597,18 @@ void VistaFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { // Coalesce layouts. bool changed = false; - ChromeViews::View* new_shelf = NULL; + views::View* new_shelf = NULL; if (current_tab && current_tab->IsDownloadShelfVisible()) new_shelf = current_tab->GetDownloadShelfView(); changed |= UpdateChildViewAndLayout(new_shelf, &shelf_view_); - ChromeViews::View* new_info_bar = NULL; + views::View* new_info_bar = NULL; WebContents* web_contents = current_tab ? current_tab->AsWebContents() : NULL; if (web_contents && web_contents->view()->IsInfoBarVisible()) new_info_bar = web_contents->view()->GetInfoBarView(); changed |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); - ChromeViews::View* new_bookmark_bar_view = NULL; + views::View* new_bookmark_bar_view = NULL; if (SupportsBookmarkBar()) new_bookmark_bar_view = GetBookmarkBarView(); changed |= UpdateChildViewAndLayout(new_bookmark_bar_view, diff --git a/chrome/browser/views/old_frames/vista_frame.h b/chrome/browser/views/old_frames/vista_frame.h index 5858436..3b105b5 100644 --- a/chrome/browser/views/old_frames/vista_frame.h +++ b/chrome/browser/views/old_frames/vista_frame.h @@ -28,7 +28,7 @@ class BookmarkBarView; class Browser; class BrowserView; class TabContentsContainerView; -class ChromeViews::FocusManager; +class views::FocusManager; class SkBitmap; class TabStrip; @@ -44,8 +44,8 @@ class VistaFrame : public BrowserWindow, CWindow, CWinTraits<WS_OVERLAPPEDWINDOW | WS_CLIPCHILDREN>>, - public ChromeViews::Container, - public ChromeViews::AcceleratorTarget { + public views::Container, + public views::AcceleratorTarget { public: // Create a new VistaFrame given the bounds and provided browser. // |bounds| may be empty to let Windows decide where to place the window. @@ -170,8 +170,8 @@ class VistaFrame : public BrowserWindow, int frame_component); virtual void SizeToContents(const gfx::Rect& contents_bounds); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + std::map<views::Accelerator, int>* accelerator_table); + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); virtual gfx::Rect GetBoundsForContentBounds(const gfx::Rect content_rect); @@ -187,20 +187,19 @@ class VistaFrame : public BrowserWindow, virtual bool IsBookmarkBarVisible() const; //////////////////////////////////////////////////////////////////////////////// - // ChromeViews::Container + // views::Container //////////////////////////////////////////////////////////////////////////////// virtual void GetBounds(CRect *out, bool including_frame) const; virtual void MoveToFront(bool should_activate); virtual HWND GetHWND() const; virtual void PaintNow(const CRect& update_rect); - virtual ChromeViews::RootView* GetRootView(); + virtual views::RootView* GetRootView(); virtual bool IsVisible(); virtual bool IsActive(); - virtual ChromeViews::TooltipManager* GetTooltipManager(); + virtual views::TooltipManager* GetTooltipManager(); virtual StatusBubble* GetStatusBubble(); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); virtual void ShelfVisibilityChanged(); virtual void SelectedTabToolbarSizeChanged(bool is_animating); @@ -274,8 +273,7 @@ class VistaFrame : public BrowserWindow, protected: // Overriden to return false if over the min/max/close buttons of the frame. - virtual bool ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event); + virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); private: void PaintContentsBorder(ChromeCanvas* canvas, @@ -324,8 +322,7 @@ class VistaFrame : public BrowserWindow, // // This function returns true if anything was changed. The caller should // ensure that Layout() is eventually called in this case. - bool UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** view); + bool UpdateChildViewAndLayout(views::View* new_view, views::View** view); // Implementation for ShelfVisibilityChanged(). Updates the various shelf // fields. If one of the shelves has changed (or it's size has changed) and @@ -333,16 +330,16 @@ class VistaFrame : public BrowserWindow, void ShelfVisibilityChangedImpl(TabContents* current_tab); // Root view - ChromeViews::RootView root_view_; + views::RootView root_view_; // Tooltip Manager - scoped_ptr<ChromeViews::TooltipManager> tooltip_manager_; + scoped_ptr<views::TooltipManager> tooltip_manager_; // The optional container for the off the record icon. - ChromeViews::ImageView* off_the_record_image_; + views::ImageView* off_the_record_image_; // The container for the distributor logo. - ChromeViews::ImageView* distributor_logo_; + views::ImageView* distributor_logo_; // The view that contains the tabs and any associated controls. TabStrip* tabstrip_; @@ -351,7 +348,7 @@ class VistaFrame : public BrowserWindow, scoped_ptr<BookmarkBarView> bookmark_bar_view_; // The visible bookmark bar. NULL if none is visible. - ChromeViews::View* active_bookmark_bar_; + views::View* active_bookmark_bar_; // Browser contents TabContentsContainerView* tab_contents_container_; @@ -369,17 +366,17 @@ class VistaFrame : public BrowserWindow, bool in_drag_session_; // A view positioned at the bottom of the frame. - ChromeViews::View* shelf_view_; + views::View* shelf_view_; // A view positioned beneath the bookmark bar view. // Implementation mirrors shelf_view_ - ChromeViews::View* info_bar_view_; + views::View* info_bar_view_; // We need to own the text of the menu, the Windows API does not copy it. std::wstring task_manager_label_text_; // A mapping between accelerators and commands. - scoped_ptr<std::map<ChromeViews::Accelerator, int>> accelerator_table_; + scoped_ptr<std::map<views::Accelerator, int>> accelerator_table_; // Whether this frame represents an off the record session. bool is_off_the_record_; diff --git a/chrome/browser/views/old_frames/xp_frame.cc b/chrome/browser/views/old_frames/xp_frame.cc index 4fddbe8..84d9aa77 100644 --- a/chrome/browser/views/old_frames/xp_frame.cc +++ b/chrome/browser/views/old_frames/xp_frame.cc @@ -102,8 +102,8 @@ static const SkColor kSeparationLineColor = SkColorSetRGB(178, 178, 178); // Padding between the tab strip and the window controls in maximized mode. static const int kZoomedStripPadding = 16; -using ChromeViews::Accelerator; -using ChromeViews::FocusManager; +using views::Accelerator; +using views::FocusManager; //////////////////////////////////////////////////////////////////////////////// // @@ -356,10 +356,10 @@ XPFrame::~XPFrame() { } void XPFrame::InitAfterHWNDCreated() { - tooltip_manager_.reset(new ChromeViews::TooltipManager(this, m_hWnd)); + tooltip_manager_.reset(new views::TooltipManager(this, m_hWnd)); } -ChromeViews::TooltipManager* XPFrame::GetTooltipManager() { +views::TooltipManager* XPFrame::GetTooltipManager() { return tooltip_manager_.get(); } @@ -401,7 +401,7 @@ void XPFrame::Init() { // Link the HWND with its root view so we can retrieve the RootView from the // HWND for automation purposes. - ChromeViews::SetRootViewForHWND(m_hWnd, &root_view_); + views::SetRootViewForHWND(m_hWnd, &root_view_); // Remove the WS_CAPTION explicitely because we don't want a window style // title bar @@ -420,7 +420,7 @@ void XPFrame::Init() { // TODO(brettw) if we have a preference for default page background, this // color should be the same. root_view_.SetBackground( - ChromeViews::Background::CreateSolidBackground(SK_ColorWHITE)); + views::Background::CreateSolidBackground(SK_ColorWHITE)); browser_view_ = new BrowserView(this, browser_, NULL, NULL); frame_view_->AddChildView(browser_view_); @@ -440,7 +440,7 @@ void XPFrame::Init() { #endif if (is_off_the_record_) { - off_the_record_image_ = new ChromeViews::ImageView(); + off_the_record_image_ = new views::ImageView(); SkBitmap* otr_icon = rb.GetBitmapNamed(IDR_OTR_ICON); off_the_record_image_->SetImage(*otr_icon); off_the_record_image_->SetTooltipText( @@ -451,58 +451,58 @@ void XPFrame::Init() { SkBitmap* image = rb.GetBitmapNamed(IDR_DISTRIBUTOR_LOGO_LIGHT); if (!image->isNull()) { - distributor_logo_ = new ChromeViews::ImageView(); + distributor_logo_ = new views::ImageView(); frame_view_->AddViewToDropList(distributor_logo_); distributor_logo_->SetImage(image); frame_view_->AddChildView(distributor_logo_); } - min_button_ = new ChromeViews::Button(); + min_button_ = new views::Button(); min_button_->SetListener(this, MINIATURIZE_TAG); - min_button_->SetImage(ChromeViews::Button::BS_NORMAL, + min_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_MINIMIZE)); - min_button_->SetImage(ChromeViews::Button::BS_HOT, + min_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_MINIMIZE_H)); - min_button_->SetImage(ChromeViews::Button::BS_PUSHED, + min_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_MINIMIZE_P)); min_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_MINIMIZE)); min_button_->SetTooltipText( l10n_util::GetString(IDS_XPFRAME_MINIMIZE_TOOLTIP)); frame_view_->AddChildView(min_button_); - max_button_ = new ChromeViews::Button(); + max_button_ = new views::Button(); max_button_->SetListener(this, MAXIMIZE_TAG); - max_button_->SetImage(ChromeViews::Button::BS_NORMAL, + max_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_MAXIMIZE)); - max_button_->SetImage(ChromeViews::Button::BS_HOT, + max_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_MAXIMIZE_H)); - max_button_->SetImage(ChromeViews::Button::BS_PUSHED, + max_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_MAXIMIZE_P)); max_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_MAXIMIZE)); max_button_->SetTooltipText( l10n_util::GetString(IDS_XPFRAME_MAXIMIZE_TOOLTIP)); frame_view_->AddChildView(max_button_); - restore_button_ = new ChromeViews::Button(); + restore_button_ = new views::Button(); restore_button_->SetListener(this, RESTORE_TAG); - restore_button_->SetImage(ChromeViews::Button::BS_NORMAL, + restore_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_RESTORE)); - restore_button_->SetImage(ChromeViews::Button::BS_HOT, + restore_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_RESTORE_H)); - restore_button_->SetImage(ChromeViews::Button::BS_PUSHED, + restore_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_RESTORE_P)); restore_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_RESTORE)); restore_button_->SetTooltipText( l10n_util::GetString(IDS_XPFRAME_RESTORE_TOOLTIP)); frame_view_->AddChildView(restore_button_); - close_button_ = new ChromeViews::Button(); + close_button_ = new views::Button(); close_button_->SetListener(this, CLOSE_TAG); - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, + close_button_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_CLOSE)); - close_button_->SetImage(ChromeViews::Button::BS_HOT, + close_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_CLOSE_H)); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, + close_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_CLOSE_P)); close_button_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_CLOSE)); close_button_->SetTooltipText( @@ -587,8 +587,8 @@ void XPFrame::Layout() { if (IsZoomed()) { preferred_size = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); close_button_->SetBounds(width - preferred_size.width() - kWindowControlsRightZoomedOffset, 0, @@ -601,8 +601,8 @@ void XPFrame::Layout() { restore_button_->SetVisible(true); preferred_size = restore_button_->GetPreferredSize(); - restore_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + restore_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); restore_button_->SetBounds(close_button_->x() - preferred_size.width(), 0, preferred_size.width(), @@ -610,8 +610,8 @@ void XPFrame::Layout() { kWindowControlsTopZoomedOffset); preferred_size = min_button_->GetPreferredSize(); - min_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_BOTTOM); + min_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_BOTTOM); min_button_->SetBounds(restore_button_->x() - preferred_size.width(), 0, preferred_size.width(), @@ -620,8 +620,8 @@ void XPFrame::Layout() { } else { preferred_size = close_button_->GetPreferredSize(); - close_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + close_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); close_button_->SetBounds(width - kWindowControlsRightOffset - preferred_size.width(), kWindowControlsTopOffset, @@ -632,16 +632,16 @@ void XPFrame::Layout() { max_button_->SetVisible(true); preferred_size = max_button_->GetPreferredSize(); - max_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + max_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); max_button_->SetBounds(close_button_->x() - preferred_size.width(), kWindowControlsTopOffset, preferred_size.width(), preferred_size.height()); preferred_size = min_button_->GetPreferredSize(); - min_button_->SetImageAlignment(ChromeViews::Button::ALIGN_LEFT, - ChromeViews::Button::ALIGN_TOP); + min_button_->SetImageAlignment(views::Button::ALIGN_LEFT, + views::Button::ALIGN_TOP); min_button_->SetBounds(max_button_->x() - preferred_size.width(), kWindowControlsTopOffset, preferred_size.width(), @@ -896,9 +896,9 @@ void XPFrame::SetAcceleratorTable( accelerator_table_.reset(accelerator_table); } -bool XPFrame::GetAccelerator(int cmd_id, ChromeViews::Accelerator* accelerator) +bool XPFrame::GetAccelerator(int cmd_id, views::Accelerator* accelerator) { - std::map<ChromeViews::Accelerator, int>::iterator it = + std::map<views::Accelerator, int>::iterator it = accelerator_table_->begin(); for (; it != accelerator_table_->end(); ++it) { if (it->second == cmd_id) { @@ -1063,7 +1063,7 @@ void XPFrame::OnNCRButtonDown(UINT flags, const CPoint& pt) { } void XPFrame::OnMouseButtonDown(UINT flags, const CPoint& pt) { - using namespace ChromeViews; + using namespace views; if (m_hWnd == NULL || !IsWindowVisible()) { return; } @@ -1235,14 +1235,13 @@ LRESULT XPFrame::OnGetObject(UINT uMsg, WPARAM w_param, LPARAM object_id) { } void XPFrame::OnKeyDown(TCHAR c, UINT rep_cnt, UINT flags) { - ChromeViews::KeyEvent event(ChromeViews::Event::ET_KEY_PRESSED, c, - rep_cnt, flags); + views::KeyEvent event(views::Event::ET_KEY_PRESSED, c, rep_cnt, flags); root_view_.ProcessKeyEvent(event); } void XPFrame::OnKeyUp(TCHAR c, UINT rep_cnt, UINT flags) { - ChromeViews::KeyEvent event(ChromeViews::Event::ET_KEY_RELEASED, c, - rep_cnt, flags); + views::KeyEvent event(views::Event::ET_KEY_RELEASED, c, rep_cnt, + flags); root_view_.ProcessKeyEvent(event); } @@ -1386,7 +1385,7 @@ LRESULT XPFrame::OnNCHitTest(const CPoint& pt) { } gfx::Point tsp(p); - ChromeViews::View::ConvertPointToView(&root_view_, tabstrip_, &tsp); + views::View::ConvertPointToView(&root_view_, tabstrip_, &tsp); // If the mouse is over the tabstrip. Check if we should move the window or // capture the mouse. @@ -1397,7 +1396,7 @@ LRESULT XPFrame::OnNCHitTest(const CPoint& pt) { if (!IsZoomed() && tsp.y() < kTabShadowSize) return HTCAPTION; - ChromeViews::View* v = tabstrip_->GetViewForPoint(tsp); + views::View* v = tabstrip_->GetViewForPoint(tsp); // If there is not tab at this location, claim the hit was in the title // bar to get a move action. if (v == tabstrip_) @@ -1412,7 +1411,7 @@ LRESULT XPFrame::OnNCHitTest(const CPoint& pt) { // The mouse is not above the tab strip. If there is no control under it, // let's move the window. if (ComputeResizeMode(p.x(), p.y(), r.Width(), r.Height()) == RM_UNDEFINED) { - ChromeViews::View* v = root_view_.GetViewForPoint(p); + views::View* v = root_view_.GetViewForPoint(p); if (v == frame_view_ || v == off_the_record_image_ || v == distributor_logo_) { return HTCAPTION; @@ -1554,7 +1553,7 @@ void XPFrame::OnSysCommand(UINT notification_code, CPoint click) { // //////////////////////////////////////////////////////////////////////////////// -void XPFrame::ButtonPressed(ChromeViews::BaseButton *sender) { +void XPFrame::ButtonPressed(views::BaseButton *sender) { switch (sender->GetTag()) { case MINIATURIZE_TAG: // We deliberately don't call ShowWindow(SW_SHOWMINIMIZED) directly @@ -1813,7 +1812,7 @@ gfx::Rect XPFrame::GetBoundsForContentBounds(const gfx::Rect content_rect) { } gfx::Point p; - ChromeViews::View::ConvertPointToContainer(tab_contents_container_, &p); + views::View::ConvertPointToContainer(tab_contents_container_, &p); CRect bounds; GetBounds(&bounds, true); @@ -1919,8 +1918,8 @@ void XPFrame::PaintNow(const CRect& update_rect) { } } -ChromeViews::RootView* XPFrame::GetRootView() { - return const_cast<ChromeViews::RootView*>(&root_view_); +views::RootView* XPFrame::GetRootView() { + return const_cast<views::RootView*>(&root_view_); } bool XPFrame::IsVisible() { @@ -1934,7 +1933,7 @@ bool XPFrame::IsActive() { bool XPFrame::ProcessMousePressed(const CPoint &pt, UINT flags, bool dbl_click) { - using namespace ChromeViews; + using namespace views; MouseEvent mouse_pressed(Event::ET_MOUSE_PRESSED, pt.x, pt.y, @@ -1953,7 +1952,7 @@ bool XPFrame::ProcessMousePressed(const CPoint &pt, } void XPFrame::ProcessMouseDragged(const CPoint &pt, UINT flags) { - using namespace ChromeViews; + using namespace views; MouseEvent drag_event(Event::ET_MOUSE_DRAGGED, pt.x, pt.y, @@ -1962,7 +1961,7 @@ void XPFrame::ProcessMouseDragged(const CPoint &pt, UINT flags) { } void XPFrame::ProcessMouseReleased(const CPoint &pt, UINT flags) { - using namespace ChromeViews; + using namespace views; current_action_ = FA_NONE; ReleaseCapture(); @@ -1975,7 +1974,7 @@ void XPFrame::ProcessMouseReleased(const CPoint &pt, UINT flags) { } void XPFrame::ProcessMouseMoved(const CPoint& pt, UINT flags) { - using namespace ChromeViews; + using namespace views; MouseEvent mouse_move(Event::ET_MOUSE_MOVED, pt.x, pt.y, @@ -2268,7 +2267,7 @@ void XPFrame::XPFrameView::SetAccessibleName(const std::wstring& name) { } bool XPFrame::XPFrameView::ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event) { + const views::DropTargetEvent& event) { if (!FrameView::ShouldForwardToTabStrip(event)) return false; if (parent_->IsZoomed() && event.x() >= parent_->min_button_->x() && @@ -2294,8 +2293,8 @@ void XPFrame::SelectedTabToolbarSizeChanged(bool is_animating) { } } -bool XPFrame::UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** view) { +bool XPFrame::UpdateChildViewAndLayout(views::View* new_view, + views::View** view) { DCHECK(view); if (*view == new_view) { // The views haven't changed, if the views pref changed schedule a layout. @@ -2408,7 +2407,7 @@ void XPFrame::ContinueDetachConstrainedWindowDrag(const gfx::Point& mouse_pt, // Because xpframe does its own resizing, and does not respond properly to // WM_NCHITTEST, there's no reliable way for us to handle other frame // component types. Alas. This will be corrected when XPFrame subclasses - // ChromeViews::CustomFrameWindow, some day. + // views::CustomFrameWindow, some day. } } @@ -2477,18 +2476,18 @@ void XPFrame::ShelfVisibilityChangedImpl(TabContents* current_tab) { // Coalesce layouts. bool changed = false; - ChromeViews::View* new_shelf = NULL; + views::View* new_shelf = NULL; if (current_tab && current_tab->IsDownloadShelfVisible()) new_shelf = current_tab->GetDownloadShelfView(); changed |= UpdateChildViewAndLayout(new_shelf, &shelf_view_); - ChromeViews::View* new_info_bar = NULL; + views::View* new_info_bar = NULL; WebContents* web_contents = current_tab ? current_tab->AsWebContents() : NULL; if (web_contents && web_contents->view()->IsInfoBarVisible()) new_info_bar = web_contents->view()->GetInfoBarView(); changed |= UpdateChildViewAndLayout(new_info_bar, &info_bar_view_); - ChromeViews::View* new_bookmark_bar_view = NULL; + views::View* new_bookmark_bar_view = NULL; if (SupportsBookmarkBar()) new_bookmark_bar_view = GetBookmarkBarView(); changed |= UpdateChildViewAndLayout(new_bookmark_bar_view, diff --git a/chrome/browser/views/old_frames/xp_frame.h b/chrome/browser/views/old_frames/xp_frame.h index b0bb8c9..051ba83 100644 --- a/chrome/browser/views/old_frames/xp_frame.h +++ b/chrome/browser/views/old_frames/xp_frame.h @@ -51,9 +51,9 @@ class XPFrame : public BrowserWindow, WS_MINIMIZEBOX | WS_MAXIMIZEBOX | WS_CLIPCHILDREN>>, - public ChromeViews::BaseButton::ButtonListener, - public ChromeViews::Container, - public ChromeViews::AcceleratorTarget { + public views::BaseButton::ButtonListener, + public views::Container, + public views::AcceleratorTarget { public: // Create a new XPFrame given the bounds and provided browser. @@ -78,8 +78,8 @@ class XPFrame : public BrowserWindow, virtual void Close(); virtual void* GetPlatformID(); virtual void SetAcceleratorTable( - std::map<ChromeViews::Accelerator, int>* accelerator_table); - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + std::map<views::Accelerator, int>* accelerator_table); + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); virtual gfx::Rect GetNormalBounds(); virtual bool IsMaximized(); virtual gfx::Rect GetBoundsForContentBounds(const gfx::Rect content_rect); @@ -152,8 +152,8 @@ class XPFrame : public BrowserWindow, void OnFinalMessage(HWND hwnd); - // ChromeViews::BaseButton::ButtonListener - void ButtonPressed(ChromeViews::BaseButton *sender); + // views::BaseButton::ButtonListener + void ButtonPressed(views::BaseButton *sender); // // Container @@ -161,13 +161,12 @@ class XPFrame : public BrowserWindow, virtual void MoveToFront(bool should_activate); virtual HWND GetHWND() const; virtual void PaintNow(const CRect& update_rect); - virtual ChromeViews::RootView* GetRootView(); + virtual views::RootView* GetRootView(); virtual bool IsVisible(); virtual bool IsActive(); - virtual ChromeViews::TooltipManager* GetTooltipManager(); + virtual views::TooltipManager* GetTooltipManager(); virtual StatusBubble* GetStatusBubble(); - virtual bool GetAccelerator(int cmd_id, - ChromeViews::Accelerator* accelerator); + virtual bool GetAccelerator(int cmd_id, views::Accelerator* accelerator); virtual void ShelfVisibilityChanged(); virtual void SelectedTabToolbarSizeChanged(bool is_animating); @@ -215,7 +214,7 @@ class XPFrame : public BrowserWindow, #endif // Return the frame view. - ChromeViews::View* GetFrameView() { return frame_view_; } + views::View* GetFrameView() { return frame_view_; } // Return the tab contents container. TabContentsContainerView* GetTabContentsContainer() { @@ -283,8 +282,7 @@ class XPFrame : public BrowserWindow, protected: // Overriden to return false if maximized and over the min/max/close // button. - virtual bool ShouldForwardToTabStrip( - const ChromeViews::DropTargetEvent& event); + virtual bool ShouldForwardToTabStrip(const views::DropTargetEvent& event); private: void PaintFrameBorder(ChromeCanvas* canvas); @@ -385,8 +383,8 @@ class XPFrame : public BrowserWindow, // Updates either the infobar or the bottom shelf depending on the views // passed in. void UpdateShelfViews(int view_top, int preferred_height, - ChromeViews::View* new_view, - ChromeViews::View** current_view, + views::View* new_view, + views::View** current_view, int* last_height); // If the workaround to prevent taskbar from hiding behind maximizing @@ -401,8 +399,7 @@ class XPFrame : public BrowserWindow, // // This function returns true if anything was changed. The caller should // ensure that Layout() is eventually called in this case. - bool UpdateChildViewAndLayout(ChromeViews::View* new_view, - ChromeViews::View** view); + bool UpdateChildViewAndLayout(views::View* new_view, views::View** view); // Return the set of bitmaps that should be used to draw this frame. SkBitmap** GetFrameBitmaps(); @@ -413,7 +410,7 @@ class XPFrame : public BrowserWindow, void ShelfVisibilityChangedImpl(TabContents* current_tab); // Root view - ChromeViews::RootView root_view_; + views::RootView root_view_; // Top level view used to render the frame itself including the title bar XPFrameView* frame_view_; @@ -422,10 +419,10 @@ class XPFrame : public BrowserWindow, TabContentsContainerView* tab_contents_container_; // Frame buttons - ChromeViews::Button* min_button_; - ChromeViews::Button* max_button_; - ChromeViews::Button* restore_button_; - ChromeViews::Button* close_button_; + views::Button* min_button_; + views::Button* max_button_; + views::Button* restore_button_; + views::Button* close_button_; // Whether we should save the bounds of the window. We don't want to // save the default size of windows for certain classes of windows @@ -465,14 +462,14 @@ class XPFrame : public BrowserWindow, // Frame min size CSize minimum_size_; - scoped_ptr<ChromeViews::TooltipManager> tooltip_manager_; + scoped_ptr<views::TooltipManager> tooltip_manager_; // A view positioned at the bottom of the frame. - ChromeViews::View* shelf_view_; + views::View* shelf_view_; // A view positioned beneath the bookmark bar. // Implementation mirrors shelf_view_ - ChromeViews::View* info_bar_view_; + views::View* info_bar_view_; // The view that contains the tabs and any associated controls. TabStrip* tabstrip_; @@ -481,19 +478,19 @@ class XPFrame : public BrowserWindow, scoped_ptr<BookmarkBarView> bookmark_bar_view_; // The visible bookmark bar. NULL if none is visible. - ChromeViews::View* active_bookmark_bar_; + views::View* active_bookmark_bar_; // The optional container for the off the record icon. - ChromeViews::ImageView* off_the_record_image_; + views::ImageView* off_the_record_image_; // The container for the distributor logo. - ChromeViews::ImageView* distributor_logo_; + views::ImageView* distributor_logo_; // We need to own the text of the menu, the Windows API does not copy it. std::wstring task_manager_label_text_; // A mapping between accelerators and commands. - scoped_ptr<std::map<ChromeViews::Accelerator, int>> accelerator_table_; + scoped_ptr<std::map<views::Accelerator, int>> accelerator_table_; // Whether this frame represents an off the record session. bool is_off_the_record_; diff --git a/chrome/browser/views/options/advanced_contents_view.cc b/chrome/browser/views/options/advanced_contents_view.cc index b8a759c..07237de 100644 --- a/chrome/browser/views/options/advanced_contents_view.cc +++ b/chrome/browser/views/options/advanced_contents_view.cc @@ -49,7 +49,7 @@ namespace { // A background object that paints the scrollable list background, // which may be rendered by the system visual styles system. -class ListBackground : public ChromeViews::Background { +class ListBackground : public views::Background { public: explicit ListBackground() { SkColor list_color = @@ -59,7 +59,7 @@ class ListBackground : public ChromeViews::Background { } virtual ~ListBackground() {} - virtual void Paint(ChromeCanvas* canvas, ChromeViews::View* view) const { + virtual void Paint(ChromeCanvas* canvas, views::View* view) const { HDC dc = canvas->beginPlatformPaint(); RECT native_lb = view->GetLocalBounds(true).ToRECT(); gfx::NativeTheme::instance()->PaintListBackground(dc, true, &native_lb); @@ -87,47 +87,47 @@ class AdvancedSection : public OptionsPageView { protected: // Convenience helpers to add different kinds of ColumnSets for specific // types of layout. - void AddWrappingColumnSet(ChromeViews::GridLayout* layout, int id); - void AddDependentTwoColumnSet(ChromeViews::GridLayout* layout, int id); - void AddTwoColumnSet(ChromeViews::GridLayout* layout, int id); - void AddIndentedColumnSet(ChromeViews::GridLayout* layout, int id); + void AddWrappingColumnSet(views::GridLayout* layout, int id); + void AddDependentTwoColumnSet(views::GridLayout* layout, int id); + void AddTwoColumnSet(views::GridLayout* layout, int id); + void AddIndentedColumnSet(views::GridLayout* layout, int id); // Convenience helpers for adding controls to specific layouts in an // aesthetically pleasing way. - void AddWrappingCheckboxRow(ChromeViews::GridLayout* layout, - ChromeViews::CheckBox* checkbox, + void AddWrappingCheckboxRow(views::GridLayout* layout, + views::CheckBox* checkbox, int id, bool related_follows); - void AddWrappingLabelRow(ChromeViews::GridLayout* layout, - ChromeViews::Label* label, + void AddWrappingLabelRow(views::GridLayout* layout, + views::Label* label, int id, bool related_follows); - void AddTwoColumnRow(ChromeViews::GridLayout* layout, - ChromeViews::Label* label, - ChromeViews::View* control, + void AddTwoColumnRow(views::GridLayout* layout, + views::Label* label, + views::View* control, bool control_stretches, // Whether or not the control // expands to fill the width. int id, bool related_follows); - void AddLeadingControl(ChromeViews::GridLayout* layout, - ChromeViews::View* control, + void AddLeadingControl(views::GridLayout* layout, + views::View* control, int id, bool related_follows); - void AddIndentedControl(ChromeViews::GridLayout* layout, - ChromeViews::View* control, + void AddIndentedControl(views::GridLayout* layout, + views::View* control, int id, bool related_follows); - void AddSpacing(ChromeViews::GridLayout* layout, bool related_follows); + void AddSpacing(views::GridLayout* layout, bool related_follows); // OptionsPageView overrides: virtual void InitControlLayout(); // The View that contains the contents of the section. - ChromeViews::View* contents_; + views::View* contents_; private: // The section title. - ChromeViews::Label* title_label_; + views::Label* title_label_; DISALLOW_EVIL_CONSTRUCTORS(AdvancedSection); }; @@ -138,7 +138,7 @@ class AdvancedSection : public OptionsPageView { AdvancedSection::AdvancedSection(Profile* profile, const std::wstring& title) : contents_(NULL), - title_label_(new ChromeViews::Label(title)), + title_label_(new views::Label(title)), OptionsPageView(profile) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont title_font = @@ -160,21 +160,20 @@ void AdvancedSection::DidChangeBounds(const gfx::Rect& previous, //////////////////////////////////////////////////////////////////////////////// // AdvancedSection, protected: -void AdvancedSection::AddWrappingColumnSet(ChromeViews::GridLayout* layout, - int id) { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; +void AdvancedSection::AddWrappingColumnSet(views::GridLayout* layout, int id) { + using views::GridLayout; + using views::ColumnSet; ColumnSet* column_set = layout->AddColumnSet(id); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); } -void AdvancedSection::AddDependentTwoColumnSet(ChromeViews::GridLayout* layout, +void AdvancedSection::AddDependentTwoColumnSet(views::GridLayout* layout, int id) { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; ColumnSet* column_set = layout->AddColumnSet(id); - column_set->AddPaddingColumn(0, ChromeViews::CheckBox::GetTextIndent()); + column_set->AddPaddingColumn(0, views::CheckBox::GetTextIndent()); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); column_set->AddPaddingColumn(0, kRelatedControlHorizontalSpacing); @@ -183,10 +182,9 @@ void AdvancedSection::AddDependentTwoColumnSet(ChromeViews::GridLayout* layout, column_set->AddPaddingColumn(0, kUnrelatedControlHorizontalSpacing); } -void AdvancedSection::AddTwoColumnSet(ChromeViews::GridLayout* layout, - int id) { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; +void AdvancedSection::AddTwoColumnSet(views::GridLayout* layout, int id) { + using views::GridLayout; + using views::ColumnSet; ColumnSet* column_set = layout->AddColumnSet(id); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); @@ -195,18 +193,17 @@ void AdvancedSection::AddTwoColumnSet(ChromeViews::GridLayout* layout, GridLayout::USE_PREF, 0, 0); } -void AdvancedSection::AddIndentedColumnSet(ChromeViews::GridLayout* layout, - int id) { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; +void AdvancedSection::AddIndentedColumnSet(views::GridLayout* layout, int id) { + using views::GridLayout; + using views::ColumnSet; ColumnSet* column_set = layout->AddColumnSet(id); - column_set->AddPaddingColumn(0, ChromeViews::CheckBox::GetTextIndent()); + column_set->AddPaddingColumn(0, views::CheckBox::GetTextIndent()); column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); } -void AdvancedSection::AddWrappingCheckboxRow(ChromeViews::GridLayout* layout, - ChromeViews::CheckBox* checkbox, +void AdvancedSection::AddWrappingCheckboxRow(views::GridLayout* layout, + views::CheckBox* checkbox, int id, bool related_follows) { checkbox->SetMultiLine(true); @@ -215,46 +212,46 @@ void AdvancedSection::AddWrappingCheckboxRow(ChromeViews::GridLayout* layout, AddSpacing(layout, related_follows); } -void AdvancedSection::AddWrappingLabelRow(ChromeViews::GridLayout* layout, - ChromeViews::Label* label, +void AdvancedSection::AddWrappingLabelRow(views::GridLayout* layout, + views::Label* label, int id, bool related_follows) { label->SetMultiLine(true); - label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); layout->StartRow(0, id); layout->AddView(label); AddSpacing(layout, related_follows); } -void AdvancedSection::AddTwoColumnRow(ChromeViews::GridLayout* layout, - ChromeViews::Label* label, - ChromeViews::View* control, +void AdvancedSection::AddTwoColumnRow(views::GridLayout* layout, + views::Label* label, + views::View* control, bool control_stretches, int id, bool related_follows) { - label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); layout->StartRow(0, id); layout->AddView(label); if (control_stretches) { layout->AddView(control); } else { - layout->AddView(control, 1, 1, ChromeViews::GridLayout::LEADING, - ChromeViews::GridLayout::CENTER); + layout->AddView(control, 1, 1, views::GridLayout::LEADING, + views::GridLayout::CENTER); } AddSpacing(layout, related_follows); } -void AdvancedSection::AddLeadingControl(ChromeViews::GridLayout* layout, - ChromeViews::View* control, +void AdvancedSection::AddLeadingControl(views::GridLayout* layout, + views::View* control, int id, bool related_follows) { - using ChromeViews::GridLayout; + using views::GridLayout; layout->StartRow(0, id); layout->AddView(control, 1, 1, GridLayout::LEADING, GridLayout::CENTER); AddSpacing(layout, related_follows); } -void AdvancedSection::AddSpacing(ChromeViews::GridLayout* layout, +void AdvancedSection::AddSpacing(views::GridLayout* layout, bool related_follows) { layout->AddPaddingRow(0, related_follows ? kRelatedControlVerticalSpacing : kUnrelatedControlVerticalSpacing); @@ -264,10 +261,10 @@ void AdvancedSection::AddSpacing(ChromeViews::GridLayout* layout, // AdvancedSection, OptionsPageView overrides: void AdvancedSection::InitControlLayout() { - contents_ = new ChromeViews::View; + contents_ = new views::View; - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(this); SetLayoutManager(layout); @@ -293,19 +290,19 @@ void AdvancedSection::InitControlLayout() { // GeneralSection class GeneralSection : public AdvancedSection, - public ChromeViews::NativeButton::Listener, - public ChromeViews::LinkController { + public views::NativeButton::Listener, + public views::LinkController { public: explicit GeneralSection(Profile* profile); virtual ~GeneralSection() {} - // Overridden from ChromeViews::NativeButton::Listener: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden from views::NativeButton::Listener: + virtual void ButtonPressed(views::NativeButton* sender); - // Overridden from ChromeViews::LinkController: - virtual void LinkActivated(ChromeViews::Link* source, int event_flags); + // Overridden from views::LinkController: + virtual void LinkActivated(views::Link* source, int event_flags); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Layout(); protected: @@ -315,10 +312,10 @@ class GeneralSection : public AdvancedSection, private: // Controls for this section: - ChromeViews::Label* reset_file_handlers_label_; - ChromeViews::NativeButton* reset_file_handlers_button_; - ChromeViews::CheckBox* reporting_enabled_checkbox_; - ChromeViews::Link* learn_more_link_; + views::Label* reset_file_handlers_label_; + views::NativeButton* reset_file_handlers_button_; + views::CheckBox* reporting_enabled_checkbox_; + views::Link* learn_more_link_; // Preferences for this section: StringPrefMember auto_open_files_; @@ -338,7 +335,7 @@ GeneralSection::GeneralSection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_GENERAL)) { } -void GeneralSection::ButtonPressed(ChromeViews::NativeButton* sender) { +void GeneralSection::ButtonPressed(views::NativeButton* sender) { if (sender == reset_file_handlers_button_) { profile()->GetDownloadManager()->ResetAutoOpenFiles(); UserMetricsRecordAction(L"Options_ResetAutoOpenFiles", @@ -358,8 +355,7 @@ void GeneralSection::ButtonPressed(ChromeViews::NativeButton* sender) { } } -void GeneralSection::LinkActivated(ChromeViews::Link* source, - int event_flags) { +void GeneralSection::LinkActivated(views::Link* source, int event_flags) { if (source == learn_more_link_) { // We open a new browser window so the Options dialog doesn't get lost // behind other windows. @@ -379,7 +375,7 @@ void GeneralSection::Layout() { // preferred size calculation code is dependent on its width, and if we don't // do this then it will return 0 as a preferred width when GridLayout (called // from View::Layout) tries to access it. - ChromeViews::View* parent = GetParent(); + views::View* parent = GetParent(); if (parent && parent->width()) { const int parent_width = parent->width(); reporting_enabled_checkbox_->SetBounds(0, 0, parent_width - 20, 0); @@ -390,21 +386,20 @@ void GeneralSection::Layout() { void GeneralSection::InitControlLayout() { AdvancedSection::InitControlLayout(); - reset_file_handlers_label_ = new ChromeViews::Label( + reset_file_handlers_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_INFO)); - reset_file_handlers_button_ = new ChromeViews::NativeButton( + reset_file_handlers_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_AUTOOPENFILETYPES_RESETTODEFAULT)); reset_file_handlers_button_->SetListener(this); - reporting_enabled_checkbox_ = new ChromeViews::CheckBox( + reporting_enabled_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_ENABLE_LOGGING)); reporting_enabled_checkbox_->SetMultiLine(true); reporting_enabled_checkbox_->SetListener(this); - learn_more_link_ = - new ChromeViews::Link(l10n_util::GetString(IDS_LEARN_MORE)); + learn_more_link_ = new views::Link(l10n_util::GetString(IDS_LEARN_MORE)); learn_more_link_->SetController(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -478,13 +473,13 @@ void GeneralSection::ResolveMetricsReportingEnabled() { // ContentSection class ContentSection : public AdvancedSection, - public ChromeViews::NativeButton::Listener { + public views::NativeButton::Listener { public: explicit ContentSection(Profile* profile); virtual ~ContentSection() {} - // Overridden from ChromeViews::NativeButton::Listener: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden from views::NativeButton::Listener: + virtual void ButtonPressed(views::NativeButton* sender); protected: // OptionsPageView overrides: @@ -493,9 +488,9 @@ class ContentSection : public AdvancedSection, private: // Controls for this section: - ChromeViews::CheckBox* popup_blocked_notification_checkbox_; - ChromeViews::Label* gears_label_; - ChromeViews::NativeButton* gears_settings_button_; + views::CheckBox* popup_blocked_notification_checkbox_; + views::Label* gears_label_; + views::NativeButton* gears_settings_button_; BooleanPrefMember disable_popup_blocked_notification_pref_; @@ -510,7 +505,7 @@ ContentSection::ContentSection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_CONTENT)) { } -void ContentSection::ButtonPressed(ChromeViews::NativeButton* sender) { +void ContentSection::ButtonPressed(views::NativeButton* sender) { if (sender == popup_blocked_notification_checkbox_) { bool notification_disabled = popup_blocked_notification_checkbox_->IsSelected(); @@ -531,18 +526,18 @@ void ContentSection::ButtonPressed(ChromeViews::NativeButton* sender) { void ContentSection::InitControlLayout() { AdvancedSection::InitControlLayout(); - popup_blocked_notification_checkbox_ = new ChromeViews::CheckBox( + popup_blocked_notification_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_SHOWPOPUPBLOCKEDNOTIFICATION)); popup_blocked_notification_checkbox_->SetListener(this); - gears_label_ = new ChromeViews::Label( + gears_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_GROUP_NAME)); - gears_settings_button_ = new ChromeViews::NativeButton( + gears_settings_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_GEARSSETTINGS_CONFIGUREGEARS_BUTTON)); gears_settings_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -571,16 +566,16 @@ void ContentSection::NotifyPrefChanged(const std::wstring* pref_name) { //////////////////////////////////////////////////////////////////////////////// // SecuritySection -class MixedContentComboModel : public ChromeViews::ComboBox::Model { +class MixedContentComboModel : public views::ComboBox::Model { public: MixedContentComboModel() {} // Return the number of items in the combo box. - virtual int GetItemCount(ChromeViews::ComboBox* source) { + virtual int GetItemCount(views::ComboBox* source) { return 3; } - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index) { + virtual std::wstring GetItemAt(views::ComboBox* source, int index) { const int kStringIDs[] = { IDS_OPTIONS_INCLUDE_MIXED_CONTENT, IDS_OPTIONS_INCLUDE_MIXED_CONTENT_IMAGE_ONLY, @@ -609,16 +604,16 @@ class MixedContentComboModel : public ChromeViews::ComboBox::Model { DISALLOW_EVIL_CONSTRUCTORS(MixedContentComboModel); }; -class CookieBehaviorComboModel : public ChromeViews::ComboBox::Model { +class CookieBehaviorComboModel : public views::ComboBox::Model { public: CookieBehaviorComboModel() {} // Return the number of items in the combo box. - virtual int GetItemCount(ChromeViews::ComboBox* source) { + virtual int GetItemCount(views::ComboBox* source) { return 3; } - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index) { + virtual std::wstring GetItemAt(views::ComboBox* source, int index) { const int kStringIDs[] = { IDS_OPTIONS_COOKIES_ACCEPT_ALL_COOKIES, IDS_OPTIONS_COOKIES_RESTRICT_THIRD_PARTY_COOKIES, @@ -648,17 +643,17 @@ class CookieBehaviorComboModel : public ChromeViews::ComboBox::Model { }; class SecuritySection : public AdvancedSection, - public ChromeViews::NativeButton::Listener, - public ChromeViews::ComboBox::Listener { + public views::NativeButton::Listener, + public views::ComboBox::Listener { public: explicit SecuritySection(Profile* profile); virtual ~SecuritySection() {} - // Overridden from ChromeViews::NativeButton::Listener: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden from views::NativeButton::Listener: + virtual void ButtonPressed(views::NativeButton* sender); - // Overridden from ChromeViews::ComboBox::Listener: - virtual void ItemChanged(ChromeViews::ComboBox* sender, + // Overridden from views::ComboBox::Listener: + virtual void ItemChanged(views::ComboBox* sender, int prev_index, int new_index); @@ -669,17 +664,17 @@ class SecuritySection : public AdvancedSection, private: // Controls for this section: - ChromeViews::CheckBox* enable_safe_browsing_checkbox_; - ChromeViews::Label* ssl_info_label_; - ChromeViews::CheckBox* enable_ssl2_checkbox_; - ChromeViews::CheckBox* check_for_cert_revocation_checkbox_; - ChromeViews::Label* mixed_content_info_label_; - ChromeViews::ComboBox* mixed_content_combobox_; - ChromeViews::Label* manage_certificates_label_; - ChromeViews::NativeButton* manage_certificates_button_; - ChromeViews::Label* cookie_behavior_label_; - ChromeViews::ComboBox* cookie_behavior_combobox_; - ChromeViews::NativeButton* show_cookies_button_; + views::CheckBox* enable_safe_browsing_checkbox_; + views::Label* ssl_info_label_; + views::CheckBox* enable_ssl2_checkbox_; + views::CheckBox* check_for_cert_revocation_checkbox_; + views::Label* mixed_content_info_label_; + views::ComboBox* mixed_content_combobox_; + views::Label* manage_certificates_label_; + views::NativeButton* manage_certificates_button_; + views::Label* cookie_behavior_label_; + views::ComboBox* cookie_behavior_combobox_; + views::NativeButton* show_cookies_button_; // The contents of the mixed content combobox. scoped_ptr<MixedContentComboModel> mixed_content_model_; @@ -710,7 +705,7 @@ SecuritySection::SecuritySection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_SECURITY)) { } -void SecuritySection::ButtonPressed(ChromeViews::NativeButton* sender) { +void SecuritySection::ButtonPressed(views::NativeButton* sender) { if (sender == enable_safe_browsing_checkbox_) { bool enabled = enable_safe_browsing_checkbox_->IsSelected(); if (enabled) { @@ -753,7 +748,7 @@ void SecuritySection::ButtonPressed(ChromeViews::NativeButton* sender) { } } -void SecuritySection::ItemChanged(ChromeViews::ComboBox* sender, +void SecuritySection::ItemChanged(views::ComboBox* sender, int prev_index, int new_index) { if (sender == mixed_content_combobox_) { @@ -786,40 +781,40 @@ void SecuritySection::ItemChanged(ChromeViews::ComboBox* sender, void SecuritySection::InitControlLayout() { AdvancedSection::InitControlLayout(); - enable_safe_browsing_checkbox_ = new ChromeViews::CheckBox( + enable_safe_browsing_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_SAFEBROWSING_ENABLEPROTECTION)); enable_safe_browsing_checkbox_->SetListener(this); - ssl_info_label_ = new ChromeViews::Label( + ssl_info_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_SSL_GROUP_DESCRIPTION)); - enable_ssl2_checkbox_ = new ChromeViews::CheckBox( + enable_ssl2_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_SSL_USESSL2)); enable_ssl2_checkbox_->SetListener(this); - check_for_cert_revocation_checkbox_ = new ChromeViews::CheckBox( + check_for_cert_revocation_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_SSL_CHECKREVOCATION)); check_for_cert_revocation_checkbox_->SetListener(this); - mixed_content_info_label_ = new ChromeViews::Label( + mixed_content_info_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_MIXED_CONTENT_LABEL)); mixed_content_model_.reset(new MixedContentComboModel); - mixed_content_combobox_ = new ChromeViews::ComboBox( + mixed_content_combobox_ = new views::ComboBox( mixed_content_model_.get()); mixed_content_combobox_->SetListener(this); - manage_certificates_label_ = new ChromeViews::Label( + manage_certificates_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_LABEL)); - manage_certificates_button_ = new ChromeViews::NativeButton( + manage_certificates_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_CERTIFICATES_MANAGE_BUTTON)); manage_certificates_button_->SetListener(this); - cookie_behavior_label_ = new ChromeViews::Label( + cookie_behavior_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_COOKIES_ACCEPT_LABEL)); allow_cookies_model_.reset(new CookieBehaviorComboModel); - cookie_behavior_combobox_ = new ChromeViews::ComboBox( + cookie_behavior_combobox_ = new views::ComboBox( allow_cookies_model_.get()); cookie_behavior_combobox_->SetListener(this); - show_cookies_button_ = new ChromeViews::NativeButton( + show_cookies_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_COOKIES_SHOWCOOKIES)); show_cookies_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -939,13 +934,13 @@ class OpenConnectionDialogTask : public Task { } // namespace class NetworkSection : public AdvancedSection, - public ChromeViews::NativeButton::Listener { + public views::NativeButton::Listener { public: explicit NetworkSection(Profile* profile); virtual ~NetworkSection() {} - // Overridden from ChromeViews::NativeButton::Listener: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // Overridden from views::NativeButton::Listener: + virtual void ButtonPressed(views::NativeButton* sender); protected: // OptionsPageView overrides: @@ -954,10 +949,10 @@ class NetworkSection : public AdvancedSection, private: // Controls for this section: - ChromeViews::Label* change_proxies_label_; - ChromeViews::NativeButton* change_proxies_button_; - ChromeViews::CheckBox* enable_link_doctor_checkbox_; - ChromeViews::CheckBox* enable_dns_prefetching_checkbox_; + views::Label* change_proxies_label_; + views::NativeButton* change_proxies_button_; + views::CheckBox* enable_link_doctor_checkbox_; + views::CheckBox* enable_dns_prefetching_checkbox_; BooleanPrefMember alternate_error_pages_; BooleanPrefMember dns_prefetch_enabled_; @@ -974,7 +969,7 @@ NetworkSection::NetworkSection(Profile* profile) l10n_util::GetString(IDS_OPTIONS_ADVANCED_SECTION_TITLE_NETWORK)) { } -void NetworkSection::ButtonPressed(ChromeViews::NativeButton* sender) { +void NetworkSection::ButtonPressed(views::NativeButton* sender) { if (sender == change_proxies_button_) { UserMetricsRecordAction(L"Options_ChangeProxies", NULL); base::Thread* thread = g_browser_process->file_thread(); @@ -1007,20 +1002,20 @@ void NetworkSection::ButtonPressed(ChromeViews::NativeButton* sender) { void NetworkSection::InitControlLayout() { AdvancedSection::InitControlLayout(); - change_proxies_label_ = new ChromeViews::Label( + change_proxies_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_PROXIES_LABEL)); - change_proxies_button_ = new ChromeViews::NativeButton( + change_proxies_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_PROXIES_CONFIGURE_BUTTON)); change_proxies_button_->SetListener(this); - enable_link_doctor_checkbox_ = new ChromeViews::CheckBox( + enable_link_doctor_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_LINKDOCTOR_PREF)); enable_link_doctor_checkbox_->SetListener(this); - enable_dns_prefetching_checkbox_ = new ChromeViews::CheckBox( + enable_dns_prefetching_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_NETWORK_DNS_PREFETCH_ENABLED_DESCRIPTION)); enable_dns_prefetching_checkbox_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(contents_); contents_->SetLayoutManager(layout); @@ -1074,8 +1069,8 @@ class AdvancedContentsView : public OptionsPageView { explicit AdvancedContentsView(Profile* profile); virtual ~AdvancedContentsView(); - // ChromeViews::View overrides: - virtual int GetLineScrollIncrement(ChromeViews::ScrollView* scroll_view, + // views::View overrides: + virtual int GetLineScrollIncrement(views::ScrollView* scroll_view, bool is_horizontal, bool is_positive); virtual void Layout(); virtual void DidChangeBounds(const gfx::Rect& previous, @@ -1108,10 +1103,10 @@ AdvancedContentsView::~AdvancedContentsView() { } //////////////////////////////////////////////////////////////////////////////// -// AdvancedContentsView, ChromeViews::View overrides: +// AdvancedContentsView, views::View overrides: int AdvancedContentsView::GetLineScrollIncrement( - ChromeViews::ScrollView* scroll_view, + views::ScrollView* scroll_view, bool is_horizontal, bool is_positive) { @@ -1121,7 +1116,7 @@ int AdvancedContentsView::GetLineScrollIncrement( } void AdvancedContentsView::Layout() { - ChromeViews::View* parent = GetParent(); + views::View* parent = GetParent(); if (parent && parent->width()) { const int width = parent->width(); const int height = GetHeightForWidth(width); @@ -1143,8 +1138,8 @@ void AdvancedContentsView::DidChangeBounds(const gfx::Rect& previous, // AdvancedContentsView, OptionsPageView implementation: void AdvancedContentsView::InitControlLayout() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -1181,7 +1176,7 @@ void AdvancedContentsView::InitClass() { AdvancedScrollViewContainer::AdvancedScrollViewContainer(Profile* profile) : contents_view_(new AdvancedContentsView(profile)), - scroll_view_(new ChromeViews::ScrollView) { + scroll_view_(new views::ScrollView) { AddChildView(scroll_view_); scroll_view_->SetContents(contents_view_); SetBackground(new ListBackground()); @@ -1191,7 +1186,7 @@ AdvancedScrollViewContainer::~AdvancedScrollViewContainer() { } //////////////////////////////////////////////////////////////////////////////// -// AdvancedScrollViewContainer, ChromeViews::View overrides: +// AdvancedScrollViewContainer, views::View overrides: void AdvancedScrollViewContainer::Layout() { gfx::Rect lb = GetLocalBounds(false); diff --git a/chrome/browser/views/options/advanced_contents_view.h b/chrome/browser/views/options/advanced_contents_view.h index 1f332ab..8d62bf1 100644 --- a/chrome/browser/views/options/advanced_contents_view.h +++ b/chrome/browser/views/options/advanced_contents_view.h @@ -8,7 +8,7 @@ #include "chrome/browser/views/options/options_page_view.h" class AdvancedContentsView; -namespace ChromeViews { +namespace views { class ScrollView; } @@ -17,12 +17,12 @@ class ScrollView; // // A View that contains a scroll view containing the Advanced options. -class AdvancedScrollViewContainer : public ChromeViews::View { +class AdvancedScrollViewContainer : public views::View { public: explicit AdvancedScrollViewContainer(Profile* profile); virtual ~AdvancedScrollViewContainer(); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); private: @@ -30,7 +30,7 @@ class AdvancedScrollViewContainer : public ChromeViews::View { AdvancedContentsView* contents_view_; // The scroll view that contains the advanced options. - ChromeViews::ScrollView* scroll_view_; + views::ScrollView* scroll_view_; DISALLOW_EVIL_CONSTRUCTORS(AdvancedScrollViewContainer); }; diff --git a/chrome/browser/views/options/advanced_page_view.cc b/chrome/browser/views/options/advanced_page_view.cc index 2865882..9e3382c 100644 --- a/chrome/browser/views/options/advanced_page_view.cc +++ b/chrome/browser/views/options/advanced_page_view.cc @@ -26,7 +26,7 @@ namespace { // A dialog box that asks the user to confirm resetting settings. -class ResetDefaultsConfirmBox : public ChromeViews::DialogDelegate { +class ResetDefaultsConfirmBox : public views::DialogDelegate { public: // This box is modal to |parent_hwnd|. static void ShowConfirmBox(HWND parent_hwnd, AdvancedPageView* page_view) { @@ -35,7 +35,7 @@ class ResetDefaultsConfirmBox : public ChromeViews::DialogDelegate { } protected: - // ChromeViews::DialogDelegate + // views::DialogDelegate virtual int GetDialogButtons() const { return DIALOGBUTTON_OK | DIALOGBUTTON_CANCEL; } @@ -58,10 +58,10 @@ class ResetDefaultsConfirmBox : public ChromeViews::DialogDelegate { advanced_page_view_->ResetToDefaults(); return true; } - // ChromeViews::WindowDelegate + // views::WindowDelegate virtual void WindowClosing() { delete this; } virtual bool IsModal() const { return true; } - virtual ChromeViews::View* GetContentsView() { return message_box_view_; } + virtual views::View* GetContentsView() { return message_box_view_; } private: ResetDefaultsConfirmBox(HWND parent_hwnd, AdvancedPageView* page_view) @@ -73,7 +73,7 @@ class ResetDefaultsConfirmBox : public ChromeViews::DialogDelegate { l10n_util::GetString(IDS_OPTIONS_RESET_MESSAGE).c_str(), std::wstring(), kDialogWidth); - ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), + views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this)->Show(); } virtual ~ResetDefaultsConfirmBox() { } @@ -152,9 +152,9 @@ void AdvancedPageView::ResetToDefaults() { } /////////////////////////////////////////////////////////////////////////////// -// AdvancedPageView, ChromeViews::NativeButton::Listener implementation: +// AdvancedPageView, views::NativeButton::Listener implementation: -void AdvancedPageView::ButtonPressed(ChromeViews::NativeButton* sender) { +void AdvancedPageView::ButtonPressed(views::NativeButton* sender) { if (sender == reset_to_default_button_) { UserMetricsRecordAction(L"Options_ResetToDefaults", NULL); ResetDefaultsConfirmBox::ShowConfirmBox(GetRootWindow(), this); @@ -165,13 +165,13 @@ void AdvancedPageView::ButtonPressed(ChromeViews::NativeButton* sender) { // AdvancedPageView, OptionsPageView implementation: void AdvancedPageView::InitControlLayout() { - reset_to_default_button_ = new ChromeViews::NativeButton( + reset_to_default_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_RESET)); reset_to_default_button_->SetListener(this); advanced_scroll_view_ = new AdvancedScrollViewContainer(profile()); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); diff --git a/chrome/browser/views/options/advanced_page_view.h b/chrome/browser/views/options/advanced_page_view.h index a1313ff..75a7ee2 100644 --- a/chrome/browser/views/options/advanced_page_view.h +++ b/chrome/browser/views/options/advanced_page_view.h @@ -16,7 +16,7 @@ class PrefService; // AdvancedPageView class AdvancedPageView : public OptionsPageView, - public ChromeViews::NativeButton::Listener { + public views::NativeButton::Listener { public: explicit AdvancedPageView(Profile* profile); virtual ~AdvancedPageView(); @@ -24,8 +24,8 @@ class AdvancedPageView : public OptionsPageView, // Resets all prefs to their default values. void ResetToDefaults(); - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); protected: // OptionsPageView implementation: @@ -34,7 +34,7 @@ class AdvancedPageView : public OptionsPageView, private: // Controls for the Advanced page AdvancedScrollViewContainer* advanced_scroll_view_; - ChromeViews::NativeButton* reset_to_default_button_; + views::NativeButton* reset_to_default_button_; DISALLOW_EVIL_CONSTRUCTORS(AdvancedPageView); }; diff --git a/chrome/browser/views/options/content_page_view.cc b/chrome/browser/views/options/content_page_view.cc index 52911a4..36304e7 100644 --- a/chrome/browser/views/options/content_page_view.cc +++ b/chrome/browser/views/options/content_page_view.cc @@ -46,28 +46,28 @@ static const int kFileIconTextFieldSpacing = 3; //////////////////////////////////////////////////////////////////////////////// // FileDisplayArea -class FileDisplayArea : public ChromeViews::View { +class FileDisplayArea : public views::View { public: FileDisplayArea(); virtual ~FileDisplayArea(); void SetFile(const std::wstring& file_path); - // ChromeViews::View overrides: + // views::View overrides: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: void Init(); - ChromeViews::TextField* text_field_; + views::TextField* text_field_; SkColor text_field_background_color_; gfx::Rect icon_bounds_; @@ -84,7 +84,7 @@ class FileDisplayArea : public ChromeViews::View { SkBitmap FileDisplayArea::default_folder_icon_; FileDisplayArea::FileDisplayArea() - : text_field_(new ChromeViews::TextField), + : text_field_(new views::TextField), text_field_background_color_(0), initialized_(false) { InitClass(); @@ -125,8 +125,8 @@ gfx::Size FileDisplayArea::GetPreferredSize() { } void FileDisplayArea::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (!initialized_ && is_add && GetContainer()) Init(); } @@ -189,9 +189,9 @@ void ContentPageView::FileSelected(const std::wstring& path, void* params) { } /////////////////////////////////////////////////////////////////////////////// -// ContentPageView, ChromeViews::NativeButton::Listener implementation: +// ContentPageView, views::NativeButton::Listener implementation: -void ContentPageView::ButtonPressed(ChromeViews::NativeButton* sender) { +void ContentPageView::ButtonPressed(views::NativeButton* sender) { if (sender == download_browse_button_) { const std::wstring dialog_title = l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_TITLE); @@ -222,7 +222,7 @@ void ContentPageView::ButtonPressed(ChromeViews::NativeButton* sender) { UserMetricsRecordAction(L"Options_ShowPasswordManager", NULL); PasswordManagerView::Show(profile()); } else if (sender == change_content_fonts_button_) { - ChromeViews::Window::CreateChromeWindow( + views::Window::CreateChromeWindow( GetRootWindow(), gfx::Rect(), new FontsLanguagesWindowView(profile()))->Show(); @@ -237,8 +237,8 @@ bool ContentPageView::CanClose() const { } void ContentPageView::InitControlLayout() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(this); layout->SetInsets(5, 5, 5, 5); @@ -290,7 +290,7 @@ void ContentPageView::NotifyPrefChanged(const std::wstring* pref_name) { } /////////////////////////////////////////////////////////////////////////////// -// ContentsPageView, ChromeViews::View overrides: +// ContentsPageView, views::View overrides: void ContentPageView::Layout() { // We need to Layout twice - once to get the width of the contents box... @@ -312,19 +312,19 @@ void ContentPageView::Layout() { void ContentPageView::InitDownloadLocation() { download_default_download_location_display_ = new FileDisplayArea; - download_browse_button_ = new ChromeViews::NativeButton( + download_browse_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_BROWSE_BUTTON)); download_browse_button_->SetListener(this); - download_ask_for_save_location_checkbox_ = new ChromeViews::CheckBox( + download_ask_for_save_location_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_DOWNLOADLOCATION_ASKFORSAVELOCATION)); download_ask_for_save_location_checkbox_->SetListener(this); download_ask_for_save_location_checkbox_->SetMultiLine(true); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -359,24 +359,24 @@ void ContentPageView::InitDownloadLocation() { } void ContentPageView::InitPasswordSavingGroup() { - passwords_asktosave_radio_ = new ChromeViews::RadioButton( + passwords_asktosave_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_PASSWORDS_ASKTOSAVE), kPasswordSavingRadioGroup); passwords_asktosave_radio_->SetListener(this); passwords_asktosave_radio_->SetMultiLine(true); - passwords_neversave_radio_ = new ChromeViews::RadioButton( + passwords_neversave_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_PASSWORDS_NEVERSAVE), kPasswordSavingRadioGroup); passwords_neversave_radio_->SetListener(this); passwords_neversave_radio_->SetMultiLine(true); - passwords_show_passwords_button_ = new ChromeViews::NativeButton( + passwords_show_passwords_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_PASSWORDS_SHOWPASSWORDS)); passwords_show_passwords_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -400,19 +400,18 @@ void ContentPageView::InitPasswordSavingGroup() { } void ContentPageView::InitFontsLangGroup() { - fonts_and_languages_label_ = new ChromeViews::Label( + fonts_and_languages_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_INFO)); - fonts_and_languages_label_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); + fonts_and_languages_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); fonts_and_languages_label_->SetMultiLine(true); - change_content_fonts_button_ = new ChromeViews::NativeButton( + change_content_fonts_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_FONTSETTINGS_CONFIGUREFONTS_BUTTON)); change_content_fonts_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); diff --git a/chrome/browser/views/options/content_page_view.h b/chrome/browser/views/options/content_page_view.h index 0c3f5736..1363bb9 100644 --- a/chrome/browser/views/options/content_page_view.h +++ b/chrome/browser/views/options/content_page_view.h @@ -11,7 +11,7 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class CheckBox; class RadioButton; } @@ -23,14 +23,14 @@ class PrefService; // ContentPageView class ContentPageView : public OptionsPageView, - public ChromeViews::NativeButton::Listener, + public views::NativeButton::Listener, public SelectFileDialog::Listener { public: explicit ContentPageView(Profile* profile); virtual ~ContentPageView(); - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); // SelectFileDialog::Listener implementation: virtual void FileSelected(const std::wstring& path, void* params); @@ -43,7 +43,7 @@ class ContentPageView : public OptionsPageView, virtual void InitControlLayout(); virtual void NotifyPrefChanged(const std::wstring* pref_name); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); private: @@ -59,25 +59,25 @@ class ContentPageView : public OptionsPageView, // Controls for the Download Location group. OptionsGroupView* download_location_group_; FileDisplayArea* download_default_download_location_display_; - ChromeViews::NativeButton* download_browse_button_; - ChromeViews::CheckBox* download_ask_for_save_location_checkbox_; + views::NativeButton* download_browse_button_; + views::CheckBox* download_ask_for_save_location_checkbox_; scoped_refptr<SelectFileDialog> select_file_dialog_; // Controls for the Password Saving group OptionsGroupView* passwords_group_; - ChromeViews::RadioButton* passwords_asktosave_radio_; - ChromeViews::RadioButton* passwords_neversave_radio_; - ChromeViews::NativeButton* passwords_show_passwords_button_; + views::RadioButton* passwords_asktosave_radio_; + views::RadioButton* passwords_neversave_radio_; + views::NativeButton* passwords_show_passwords_button_; // Controls for the Popup Blocking group. OptionsGroupView* popups_group_; - ChromeViews::RadioButton* popups_show_minimized_radio_; - ChromeViews::RadioButton* popups_block_all_radio_; + views::RadioButton* popups_show_minimized_radio_; + views::RadioButton* popups_block_all_radio_; // Controls for the Fonts and Languages group. OptionsGroupView* fonts_lang_group_; - ChromeViews::Label* fonts_and_languages_label_; - ChromeViews::NativeButton* change_content_fonts_button_; + views::Label* fonts_and_languages_label_; + views::NativeButton* change_content_fonts_button_; StringPrefMember default_download_location_; BooleanPrefMember ask_for_save_location_; diff --git a/chrome/browser/views/options/cookies_view.cc b/chrome/browser/views/options/cookies_view.cc index 41a8968..c70d5b3 100644 --- a/chrome/browser/views/options/cookies_view.cc +++ b/chrome/browser/views/options/cookies_view.cc @@ -26,7 +26,7 @@ #include "net/url_request/url_request_context.h" // static -ChromeViews::Window* CookiesView::instance_ = NULL; +views::Window* CookiesView::instance_ = NULL; static const int kCookieInfoViewBorderSize = 1; static const int kCookieInfoViewInsetSize = 3; static const int kSearchFilterDelayMs = 500; @@ -34,7 +34,7 @@ static const int kSearchFilterDelayMs = 500; /////////////////////////////////////////////////////////////////////////////// // CookiesTableModel -class CookiesTableModel : public ChromeViews::TableModel { +class CookiesTableModel : public views::TableModel { public: explicit CookiesTableModel(Profile* profile); virtual ~CookiesTableModel() {} @@ -47,11 +47,11 @@ class CookiesTableModel : public ChromeViews::TableModel { void RemoveCookies(int start_index, int remove_count); void RemoveAllShownCookies(); - // ChromeViews::TableModel implementation: + // views::TableModel implementation: virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); virtual SkBitmap GetIcon(int row); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); virtual int CompareValues(int row1, int row2, int column_id); // Filter the cookies to only display matched results. @@ -71,7 +71,7 @@ class CookiesTableModel : public ChromeViews::TableModel { CookieList all_cookies_; CookiePtrList shown_cookies_; - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; DISALLOW_EVIL_CONSTRUCTORS(CookiesTableModel); }; @@ -135,7 +135,7 @@ void CookiesTableModel::RemoveAllShownCookies() { } /////////////////////////////////////////////////////////////////////////////// -// CookiesTableModel, ChromeViews::TableModel implementation: +// CookiesTableModel, views::TableModel implementation: int CookiesTableModel::RowCount() { return static_cast<int>(shown_cookies_.size()); @@ -168,7 +168,7 @@ SkBitmap CookiesTableModel::GetIcon(int row) { return *icon; } -void CookiesTableModel::SetObserver(ChromeViews::TableModelObserver* observer) { +void CookiesTableModel::SetObserver(views::TableModelObserver* observer) { observer_ = observer; } @@ -240,17 +240,17 @@ void CookiesTableModel::UpdateSearchResults(const std::wstring& filter) { // CookiesTableView // Overridden to handle Delete key presses -class CookiesTableView : public ChromeViews::TableView { +class CookiesTableView : public views::TableView { public: CookiesTableView(CookiesTableModel* cookies_model, - std::vector<ChromeViews::TableColumn> columns); + std::vector<views::TableColumn> columns); virtual ~CookiesTableView() {} // Removes the cookies associated with the selected rows in the TableView. void RemoveSelectedCookies(); protected: - // ChromeViews::TableView implementation: + // views::TableView implementation: virtual void OnKeyDown(unsigned short virtual_keycode); private: @@ -262,9 +262,9 @@ class CookiesTableView : public ChromeViews::TableView { CookiesTableView::CookiesTableView( CookiesTableModel* cookies_model, - std::vector<ChromeViews::TableColumn> columns) - : ChromeViews::TableView(cookies_model, columns, - ChromeViews::ICON_AND_TEXT, false, true, true), + std::vector<views::TableColumn> columns) + : views::TableView(cookies_model, columns, views::ICON_AND_TEXT, false, + true, true), cookies_model_(cookies_model) { } @@ -281,7 +281,7 @@ void CookiesTableView::RemoveSelectedCookies() { // Remove the selected cookies. This iterates over the rows backwards, which // is required when calling RemoveCookies, see bug 2994. int first_selected_row = -1; - for (ChromeViews::TableView::iterator i = SelectionBegin(); + for (views::TableView::iterator i = SelectionBegin(); i != SelectionEnd(); ++i) { int selected_row = *i; if (first_selected_row == -1) @@ -302,7 +302,7 @@ void CookiesTableView::OnKeyDown(unsigned short virtual_keycode) { // CookieInfoView // // Responsible for displaying a tabular grid of Cookie information. -class CookieInfoView : public ChromeViews::View { +class CookieInfoView : public views::View { public: CookieInfoView(); virtual ~CookieInfoView(); @@ -319,30 +319,30 @@ class CookieInfoView : public ChromeViews::View { void EnableCookieDisplay(bool enabled); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Set up the view layout void Init(); // Individual property labels - ChromeViews::Label* name_label_; - ChromeViews::TextField* name_value_field_; - ChromeViews::Label* content_label_; - ChromeViews::TextField* content_value_field_; - ChromeViews::Label* domain_label_; - ChromeViews::TextField* domain_value_field_; - ChromeViews::Label* path_label_; - ChromeViews::TextField* path_value_field_; - ChromeViews::Label* send_for_label_; - ChromeViews::TextField* send_for_value_field_; - ChromeViews::Label* created_label_; - ChromeViews::TextField* created_value_field_; - ChromeViews::Label* expires_label_; - ChromeViews::TextField* expires_value_field_; + views::Label* name_label_; + views::TextField* name_value_field_; + views::Label* content_label_; + views::TextField* content_value_field_; + views::Label* domain_label_; + views::TextField* domain_value_field_; + views::Label* path_label_; + views::TextField* path_value_field_; + views::Label* send_for_label_; + views::TextField* send_for_value_field_; + views::Label* created_label_; + views::TextField* created_value_field_; + views::Label* expires_label_; + views::TextField* expires_value_field_; DISALLOW_EVIL_CONSTRUCTORS(CookieInfoView); }; @@ -424,11 +424,11 @@ void CookieInfoView::ClearCookieDisplay() { } /////////////////////////////////////////////////////////////////////////////// -// CookieInfoView, ChromeViews::View overrides: +// CookieInfoView, views::View overrides: void CookieInfoView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) Init(); } @@ -438,34 +438,34 @@ void CookieInfoView::ViewHierarchyChanged(bool is_add, void CookieInfoView::Init() { SkColor border_color = color_utils::GetSysSkColor(COLOR_3DSHADOW); - ChromeViews::Border* border = ChromeViews::Border::CreateSolidBorder( + views::Border* border = views::Border::CreateSolidBorder( kCookieInfoViewBorderSize, border_color); SetBorder(border); - name_label_ = new ChromeViews::Label( + name_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_NAME_LABEL)); - name_value_field_ = new ChromeViews::TextField; - content_label_ = new ChromeViews::Label( + name_value_field_ = new views::TextField; + content_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_CONTENT_LABEL)); - content_value_field_ = new ChromeViews::TextField; - domain_label_ = new ChromeViews::Label( + content_value_field_ = new views::TextField; + domain_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_DOMAIN_LABEL)); - domain_value_field_ = new ChromeViews::TextField; - path_label_ = new ChromeViews::Label( + domain_value_field_ = new views::TextField; + path_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_PATH_LABEL)); - path_value_field_ = new ChromeViews::TextField; - send_for_label_ = new ChromeViews::Label( + path_value_field_ = new views::TextField; + send_for_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_SENDFOR_LABEL)); - send_for_value_field_ = new ChromeViews::TextField; - created_label_ = new ChromeViews::Label( + send_for_value_field_ = new views::TextField; + created_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_CREATED_LABEL)); - created_value_field_ = new ChromeViews::TextField; - expires_label_ = new ChromeViews::Label( + created_value_field_ = new views::TextField; + expires_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_COOKIE_EXPIRES_LABEL)); - expires_value_field_ = new ChromeViews::TextField; + expires_value_field_ = new views::TextField; - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(this); layout->SetInsets(kCookieInfoViewInsetSize, @@ -543,7 +543,7 @@ void CookieInfoView::Init() { void CookiesView::ShowCookiesWindow(Profile* profile) { if (!instance_) { CookiesView* cookies_view = new CookiesView(profile); - instance_ = ChromeViews::Window::CreateChromeWindow( + instance_ = views::Window::CreateChromeWindow( NULL, gfx::Rect(), cookies_view); } if (!instance_->IsVisible()) { @@ -563,9 +563,9 @@ void CookiesView::UpdateSearchResults() { } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, ChromeViews::NativeButton::listener implementation: +// CookiesView, views::NativeButton::listener implementation: -void CookiesView::ButtonPressed(ChromeViews::NativeButton* sender) { +void CookiesView::ButtonPressed(views::NativeButton* sender) { if (sender == remove_button_) { cookies_table_->RemoveSelectedCookies(); } else if (sender == remove_all_button_) { @@ -578,7 +578,7 @@ void CookiesView::ButtonPressed(ChromeViews::NativeButton* sender) { } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, ChromeViews::TableViewObserver implementation: +// CookiesView, views::TableViewObserver implementation: void CookiesView::OnSelectionChanged() { int selected_row_count = cookies_table_->SelectedRowCount(); if (selected_row_count == 1) { @@ -597,9 +597,9 @@ void CookiesView::OnSelectionChanged() { } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, ChromeViews::TextField::Controller implementation: +// CookiesView, views::TextField::Controller implementation: -void CookiesView::ContentsChanged(ChromeViews::TextField* sender, +void CookiesView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { search_update_factory_.RevokeAll(); MessageLoop::current()->PostDelayedTask(FROM_HERE, @@ -607,9 +607,8 @@ void CookiesView::ContentsChanged(ChromeViews::TextField* sender, &CookiesView::UpdateSearchResults), kSearchFilterDelayMs); } -void CookiesView::HandleKeystroke(ChromeViews::TextField* sender, - UINT message, TCHAR key, UINT repeat_count, - UINT flags) { +void CookiesView::HandleKeystroke(views::TextField* sender, UINT message, + TCHAR key, UINT repeat_count, UINT flags) { switch (key) { case VK_ESCAPE: ResetSearchQuery(); @@ -622,7 +621,7 @@ void CookiesView::HandleKeystroke(ChromeViews::TextField* sender, } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, ChromeViews::DialogDelegate implementation: +// CookiesView, views::DialogDelegate implementation: std::wstring CookiesView::GetWindowTitle() const { return l10n_util::GetString(IDS_COOKIES_WINDOW_TITLE); @@ -632,12 +631,12 @@ void CookiesView::WindowClosing() { instance_ = NULL; } -ChromeViews::View* CookiesView::GetContentsView() { +views::View* CookiesView::GetContentsView() { return this; } /////////////////////////////////////////////////////////////////////////////// -// CookiesView, ChromeViews::View overrides: +// CookiesView, views::View overrides: void CookiesView::Layout() { // Lay out the Remove/Remove All buttons in the parent view. @@ -659,14 +658,14 @@ void CookiesView::Layout() { } gfx::Size CookiesView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_COOKIES_DIALOG_WIDTH_CHARS, IDS_COOKIES_DIALOG_HEIGHT_LINES)); } void CookiesView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) Init(); } @@ -688,45 +687,43 @@ CookiesView::CookiesView(Profile* profile) } void CookiesView::Init() { - search_label_ = new ChromeViews::Label( + search_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_SEARCH_LABEL)); - search_field_ = new ChromeViews::TextField; + search_field_ = new views::TextField; search_field_->SetController(this); - clear_search_button_ = new ChromeViews::NativeButton( + clear_search_button_ = new views::NativeButton( l10n_util::GetString(IDS_COOKIES_CLEAR_SEARCH_LABEL)); clear_search_button_->SetListener(this); - description_label_ = new ChromeViews::Label( + description_label_ = new views::Label( l10n_util::GetString(IDS_COOKIES_INFO_LABEL)); - description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); cookies_table_model_.reset(new CookiesTableModel(profile_)); info_view_ = new CookieInfoView; - std::vector<ChromeViews::TableColumn> columns; - columns.push_back(ChromeViews::TableColumn(IDS_COOKIES_DOMAIN_COLUMN_HEADER, - ChromeViews::TableColumn::LEFT, - 200, 0.5f)); + std::vector<views::TableColumn> columns; + columns.push_back(views::TableColumn(IDS_COOKIES_DOMAIN_COLUMN_HEADER, + views::TableColumn::LEFT, 200, 0.5f)); columns.back().sortable = true; - columns.push_back(ChromeViews::TableColumn(IDS_COOKIES_NAME_COLUMN_HEADER, - ChromeViews::TableColumn::LEFT, - 150, 0.5f)); + columns.push_back(views::TableColumn(IDS_COOKIES_NAME_COLUMN_HEADER, + views::TableColumn::LEFT, 150, 0.5f)); columns.back().sortable = true; cookies_table_ = new CookiesTableView(cookies_table_model_.get(), columns); cookies_table_->SetObserver(this); // Make the table initially sorted by domain. - ChromeViews::TableView::SortDescriptors sort; + views::TableView::SortDescriptors sort; sort.push_back( - ChromeViews::TableView::SortDescriptor( - IDS_COOKIES_DOMAIN_COLUMN_HEADER, true)); + views::TableView::SortDescriptor(IDS_COOKIES_DOMAIN_COLUMN_HEADER, + true)); cookies_table_->SetSortDescriptors(sort); - remove_button_ = new ChromeViews::NativeButton( + remove_button_ = new views::NativeButton( l10n_util::GetString(IDS_COOKIES_REMOVE_LABEL)); remove_button_->SetListener(this); - remove_all_button_ = new ChromeViews::NativeButton( + remove_all_button_ = new views::NativeButton( l10n_util::GetString(IDS_COOKIES_REMOVE_ALL_LABEL)); remove_all_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); diff --git a/chrome/browser/views/options/cookies_view.h b/chrome/browser/views/options/cookies_view.h index 4121c25..946382b 100644 --- a/chrome/browser/views/options/cookies_view.h +++ b/chrome/browser/views/options/cookies_view.h @@ -12,7 +12,7 @@ #include "chrome/views/view.h" #include "chrome/views/window.h" -namespace ChromeViews { +namespace views { class Label; } class CookieInfoView; @@ -21,11 +21,11 @@ class CookiesTableView; class Profile; class Timer; -class CookiesView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::NativeButton::Listener, - public ChromeViews::TableViewObserver, - public ChromeViews::TextField::Controller { +class CookiesView : public views::View, + public views::DialogDelegate, + public views::NativeButton::Listener, + public views::TableViewObserver, + public views::TextField::Controller { public: // Show the Cookies Window, creating one if necessary. static void ShowCookiesWindow(Profile* profile); @@ -35,38 +35,38 @@ class CookiesView : public ChromeViews::View, // Updates the display to show only the search results. void UpdateSearchResults(); - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::TableViewObserver implementation: + // views::TableViewObserver implementation: virtual void OnSelectionChanged(); - // ChromeViews::TextField::Controller implementation: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // views::TextField::Controller implementation: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags); - // ChromeViews::WindowDelegate implementation: + // views::WindowDelegate implementation: virtual int GetDialogButtons() const { return DIALOGBUTTON_CANCEL; } - virtual ChromeViews::View* GetInitiallyFocusedView() const { + virtual views::View* GetInitiallyFocusedView() const { return search_field_; } virtual bool CanResize() const { return true; } virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); virtual gfx::Size GetPreferredSize(); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Use the static factory method to show. @@ -82,14 +82,14 @@ class CookiesView : public ChromeViews::View, void UpdateForEmptyState(); // Assorted dialog controls - ChromeViews::Label* search_label_; - ChromeViews::TextField* search_field_; - ChromeViews::NativeButton* clear_search_button_; - ChromeViews::Label* description_label_; + views::Label* search_label_; + views::TextField* search_field_; + views::NativeButton* clear_search_button_; + views::Label* description_label_; CookiesTableView* cookies_table_; CookieInfoView* info_view_; - ChromeViews::NativeButton* remove_button_; - ChromeViews::NativeButton* remove_all_button_; + views::NativeButton* remove_button_; + views::NativeButton* remove_all_button_; // The Cookies Table model scoped_ptr<CookiesTableModel> cookies_table_model_; @@ -104,7 +104,7 @@ class CookiesView : public ChromeViews::View, // Our containing window. If this is non-NULL there is a visible Cookies // window somewhere. - static ChromeViews::Window* instance_; + static views::Window* instance_; DISALLOW_EVIL_CONSTRUCTORS(CookiesView); }; diff --git a/chrome/browser/views/options/fonts_languages_window_view.cc b/chrome/browser/views/options/fonts_languages_window_view.cc index b147d4e..89115c8 100644 --- a/chrome/browser/views/options/fonts_languages_window_view.cc +++ b/chrome/browser/views/options/fonts_languages_window_view.cc @@ -38,7 +38,7 @@ FontsLanguagesWindowView::~FontsLanguagesWindowView() { } /////////////////////////////////////////////////////////////////////////////// -// FontsLanguagesWindowView, ChromeViews::DialogDelegate implementation: +// FontsLanguagesWindowView, views::DialogDelegate implementation: bool FontsLanguagesWindowView::Accept() { fonts_page_->SaveChanges(); @@ -47,19 +47,19 @@ bool FontsLanguagesWindowView::Accept() { } /////////////////////////////////////////////////////////////////////////////// -// FontsLanguagesWindowView, ChromeViews::WindowDelegate implementation: +// FontsLanguagesWindowView, views::WindowDelegate implementation: std::wstring FontsLanguagesWindowView::GetWindowTitle() const { return l10n_util::GetStringF(IDS_FONT_LANGUAGE_SETTING_WINDOWS_TITLE, l10n_util::GetString(IDS_PRODUCT_NAME)); } -ChromeViews::View* FontsLanguagesWindowView::GetContentsView() { +views::View* FontsLanguagesWindowView::GetContentsView() { return this; } /////////////////////////////////////////////////////////////////////////////// -// FontsLanguagesWindowView, ChromeViews::View overrides: +// FontsLanguagesWindowView, views::View overrides: void FontsLanguagesWindowView::Layout() { tabs_->SetBounds(kDialogPadding, kDialogPadding, @@ -68,13 +68,13 @@ void FontsLanguagesWindowView::Layout() { } gfx::Size FontsLanguagesWindowView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_FONTSLANG_DIALOG_WIDTH_CHARS, IDS_FONTSLANG_DIALOG_HEIGHT_LINES)); } void FontsLanguagesWindowView::ViewHierarchyChanged( - bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { + bool is_add, views::View* parent, views::View* child) { // Can't init before we're inserted into a Container, because we require // a HWND to parent native child controls to. if (is_add && child == this) @@ -85,7 +85,7 @@ void FontsLanguagesWindowView::ViewHierarchyChanged( // FontsLanguagesWindowView, private: void FontsLanguagesWindowView::Init() { - tabs_ = new ChromeViews::TabbedPane; + tabs_ = new views::TabbedPane; AddChildView(tabs_); fonts_page_ = new FontsPageView(profile_); diff --git a/chrome/browser/views/options/fonts_languages_window_view.h b/chrome/browser/views/options/fonts_languages_window_view.h index e30f7f0..9c2f77e 100644 --- a/chrome/browser/views/options/fonts_languages_window_view.h +++ b/chrome/browser/views/options/fonts_languages_window_view.h @@ -19,35 +19,35 @@ class LanguagesPageView; // // The contents of the "Fonts and Languages Preferences" dialog window. // -class FontsLanguagesWindowView : public ChromeViews::View, - public ChromeViews::DialogDelegate { +class FontsLanguagesWindowView : public views::View, + public views::DialogDelegate { public: explicit FontsLanguagesWindowView(Profile* profile); virtual ~FontsLanguagesWindowView(); - // ChromeViews::DialogDelegate implementation: + // views::DialogDelegate implementation: virtual bool Accept(); - // ChromeViews::WindowDelegate Methods: + // views::WindowDelegate Methods: virtual bool IsModal() const { return true; } virtual std::wstring GetWindowTitle() const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); virtual gfx::Size GetPreferredSize(); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Init the assorted Tabbed pages void Init(); // The Tab view that contains all of the options pages. - ChromeViews::TabbedPane* tabs_; + views::TabbedPane* tabs_; // Fonts Page View handle remembered so that prefs is updated only when // OK is pressed. diff --git a/chrome/browser/views/options/fonts_page_view.cc b/chrome/browser/views/options/fonts_page_view.cc index 7bd8836..3d94245 100644 --- a/chrome/browser/views/options/fonts_page_view.cc +++ b/chrome/browser/views/options/fonts_page_view.cc @@ -34,7 +34,7 @@ #include "generated_resources.h" #include "skia/include/SkBitmap.h" -class DefaultEncodingComboboxModel : public ChromeViews::ComboBox::Model { +class DefaultEncodingComboboxModel : public views::ComboBox::Model { public: DefaultEncodingComboboxModel() { canonical_encoding_names_length_ = @@ -43,12 +43,12 @@ class DefaultEncodingComboboxModel : public ChromeViews::ComboBox::Model { virtual ~DefaultEncodingComboboxModel() {} - // Overridden from ChromeViews::Combobox::Model. - virtual int GetItemCount(ChromeViews::ComboBox* source) { + // Overridden from views::Combobox::Model. + virtual int GetItemCount(views::ComboBox* source) { return canonical_encoding_names_length_; } - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index) { + virtual std::wstring GetItemAt(views::ComboBox* source, int index) { DCHECK(index >= 0 && canonical_encoding_names_length_ > index); return CharacterEncoding::GetCanonicalEncodingDisplayNameByIndex(index); } @@ -81,7 +81,7 @@ class DefaultEncodingComboboxModel : public ChromeViews::ComboBox::Model { //////////////////////////////////////////////////////////////////////////////// // FontDisplayView -class FontDisplayView : public ChromeViews::View { +class FontDisplayView : public views::View { public: FontDisplayView(); virtual ~FontDisplayView(); @@ -94,13 +94,13 @@ class FontDisplayView : public ChromeViews::View { std::wstring font_name() { return font_name_; } int font_size() { return font_size_; } - // ChromeViews::View overrides: + // views::View overrides: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); private: - ChromeViews::Label* font_text_label_; + views::Label* font_text_label_; std::wstring font_name_; int font_size_; std::wstring font_text_label_string_; @@ -113,7 +113,7 @@ class FontDisplayView : public ChromeViews::View { }; FontDisplayView::FontDisplayView() - : font_text_label_(new ChromeViews::Label) { + : font_text_label_(new views::Label) { AddChildView(font_text_label_); } @@ -177,7 +177,7 @@ gfx::Size FontDisplayView::GetPreferredSize() { + 2 * kFontDisplayLabelPadding); } -void EmbellishTitle(ChromeViews::Label* title_label) { +void EmbellishTitle(views::Label* title_label) { ResourceBundle& rb = ResourceBundle::GetSharedInstance(); ChromeFont title_font = rb.GetFont(ResourceBundle::BaseFont).DeriveFont(0, ChromeFont::BOLD); @@ -227,7 +227,7 @@ FontsPageView::FontsPageView(Profile* profile) FontsPageView::~FontsPageView() { } -void FontsPageView::ButtonPressed(ChromeViews::NativeButton* sender) { +void FontsPageView::ButtonPressed(views::NativeButton* sender) { HWND owning_hwnd = GetAncestor(GetContainer()->GetHWND(), GA_ROOT); std::wstring font_name; int font_size = 0; @@ -251,7 +251,7 @@ void FontsPageView::ButtonPressed(ChromeViews::NativeButton* sender) { select_font_dialog_->SelectFont(owning_hwnd, NULL, font_name, font_size); } -void FontsPageView::ItemChanged(ChromeViews::ComboBox* combo_box, +void FontsPageView::ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index) { if (combo_box == default_encoding_combobox_) { if (prev_index != new_index) { // Default-Encoding has been changed. @@ -297,8 +297,8 @@ void FontsPageView::SaveChanges() { } void FontsPageView::InitControlLayout() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -309,11 +309,11 @@ void FontsPageView::InitControlLayout() { // Fonts group. column_set->AddColumn(GridLayout::FILL, GridLayout::LEADING, 1, GridLayout::USE_PREF, 0, 0); - fonts_group_title_ = new ChromeViews::Label( + fonts_group_title_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_FONT_TITLE)); EmbellishTitle(fonts_group_title_); - fonts_group_title_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + fonts_group_title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); layout->StartRow(0, single_column_view_set_id); layout->AddView(fonts_group_title_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); @@ -323,11 +323,11 @@ void FontsPageView::InitControlLayout() { layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); // Encoding group. - encoding_group_title_ = new ChromeViews::Label( + encoding_group_title_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SUB_DIALOG_ENCODING_TITLE)); EmbellishTitle(encoding_group_title_); - encoding_group_title_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + encoding_group_title_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); layout->StartRow(0, single_column_view_set_id); layout->AddView(encoding_group_title_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); @@ -357,50 +357,48 @@ void FontsPageView::NotifyPrefChanged(const std::wstring* pref_name) { void FontsPageView::InitFontLayout() { // Fixed width. fixed_width_font_display_view_ = new FontDisplayView; - fixed_width_font_change_page_button_ = new ChromeViews::NativeButton( + fixed_width_font_change_page_button_ = new views::NativeButton( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); fixed_width_font_change_page_button_->SetListener(this); - fixed_width_font_label_ = new ChromeViews::Label( + fixed_width_font_label_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_FIXED_WIDTH_LABEL)); - fixed_width_font_label_->SetHorizontalAlignment(ChromeViews::Label:: - ALIGN_LEFT); + fixed_width_font_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); fixed_width_font_label_->SetMultiLine(true); // Serif font. serif_font_display_view_ = new FontDisplayView; - serif_font_change_page_button_ = new ChromeViews::NativeButton( + serif_font_change_page_button_ = new views::NativeButton( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); serif_font_change_page_button_->SetListener(this); - serif_font_label_ = new ChromeViews::Label( + serif_font_label_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SERIF_LABEL)); - serif_font_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + serif_font_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); serif_font_label_->SetMultiLine(true); // Sans Serif font. sans_serif_font_display_view_ = new FontDisplayView; - sans_serif_font_change_page_button_ = new ChromeViews::NativeButton( + sans_serif_font_change_page_button_ = new views::NativeButton( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_BUTTON_LABEL)); sans_serif_font_change_page_button_->SetListener(this); - sans_serif_font_label_ = new ChromeViews::Label( + sans_serif_font_label_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_SELECTOR_SANS_SERIF_LABEL)); - sans_serif_font_label_->SetHorizontalAlignment(ChromeViews::Label:: - ALIGN_LEFT); + sans_serif_font_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); sans_serif_font_label_->SetMultiLine(true); // Now add the views. - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - fonts_contents_ = new ChromeViews::View; + fonts_contents_ = new views::View; GridLayout* layout = new GridLayout(fonts_contents_); fonts_contents_->SetLayoutManager(layout); @@ -445,11 +443,11 @@ void FontsPageView::InitFontLayout() { } void FontsPageView::InitEncodingLayout() { - default_encoding_combobox_label_ = new ChromeViews::Label( + default_encoding_combobox_label_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_FONT_DEFAULT_ENCODING_SELECTOR_LABEL)); default_encoding_combobox_model_.reset(new DefaultEncodingComboboxModel); - default_encoding_combobox_ = new ChromeViews::ComboBox( + default_encoding_combobox_ = new views::ComboBox( default_encoding_combobox_model_.get()); int selected_encoding_index = default_encoding_combobox_model_-> GetSelectedEncodingIndex(profile()); @@ -459,10 +457,10 @@ void FontsPageView::InitEncodingLayout() { default_encoding_combobox_->SetListener(this); // Now add the views. - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - encoding_contents_ = new ChromeViews::View; + encoding_contents_ = new views::View; GridLayout* layout = new GridLayout(encoding_contents_); encoding_contents_->SetLayoutManager(layout); diff --git a/chrome/browser/views/options/fonts_page_view.h b/chrome/browser/views/options/fonts_page_view.h index 1a64a91..21bd2a1 100644 --- a/chrome/browser/views/options/fonts_page_view.h +++ b/chrome/browser/views/options/fonts_page_view.h @@ -13,7 +13,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class GroupboxView; class Label; class TableModel; @@ -27,18 +27,18 @@ class DefaultEncodingComboboxModel; // FontsPageView class FontsPageView : public OptionsPageView, - public ChromeViews::ComboBox::Listener, + public views::ComboBox::Listener, public SelectFontDialog::Listener, - public ChromeViews::NativeButton::Listener { + public views::NativeButton::Listener { public: explicit FontsPageView(Profile* profile); virtual ~FontsPageView(); - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::ComboBox::Listener implementation: - virtual void ItemChanged(ChromeViews::ComboBox* combo_box, + // views::ComboBox::Listener implementation: + virtual void ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index); @@ -72,20 +72,20 @@ class FontsPageView : public OptionsPageView, bool fixed_width_button_pressed_; bool encoding_dropdown_clicked_; - ChromeViews::Label* fonts_group_title_; - ChromeViews::Label* encoding_group_title_; + views::Label* fonts_group_title_; + views::Label* encoding_group_title_; - ChromeViews::View* fonts_contents_; - ChromeViews::View* encoding_contents_; + views::View* fonts_contents_; + views::View* encoding_contents_; // Fonts settings. // Select Font dialogs. scoped_refptr<SelectFontDialog> select_font_dialog_; // Buttons. - ChromeViews::NativeButton* fixed_width_font_change_page_button_; - ChromeViews::NativeButton* serif_font_change_page_button_; - ChromeViews::NativeButton* sans_serif_font_change_page_button_; + views::NativeButton* fixed_width_font_change_page_button_; + views::NativeButton* serif_font_change_page_button_; + views::NativeButton* sans_serif_font_change_page_button_; // FontDisplayView objects to display selected font. FontDisplayView* fixed_width_font_display_view_; @@ -93,9 +93,9 @@ class FontsPageView : public OptionsPageView, FontDisplayView* sans_serif_font_display_view_; // Labels to describe what is to be changed. - ChromeViews::Label* fixed_width_font_label_; - ChromeViews::Label* serif_font_label_; - ChromeViews::Label* sans_serif_font_label_; + views::Label* fixed_width_font_label_; + views::Label* serif_font_label_; + views::Label* sans_serif_font_label_; // Advanced Font names and sizes as PrefMembers. StringPrefMember serif_name_; @@ -112,8 +112,8 @@ class FontsPageView : public OptionsPageView, // Default Encoding. scoped_ptr<DefaultEncodingComboboxModel> default_encoding_combobox_model_; - ChromeViews::Label* default_encoding_combobox_label_; - ChromeViews::ComboBox* default_encoding_combobox_; + views::Label* default_encoding_combobox_label_; + views::ComboBox* default_encoding_combobox_; std::wstring default_encoding_selected_; bool default_encoding_changed_; diff --git a/chrome/browser/views/options/general_page_view.cc b/chrome/browser/views/options/general_page_view.cc index 6f178ef..d506fdc 100644 --- a/chrome/browser/views/options/general_page_view.cc +++ b/chrome/browser/views/options/general_page_view.cc @@ -168,7 +168,7 @@ void GeneralPageView::DefaultBrowserWorker::UpdateUI(bool is_default) { // CustomHomePagesTableModel is the model for the TableView showing the list // of pages the user wants opened on startup. -class CustomHomePagesTableModel : public ChromeViews::TableModel { +class CustomHomePagesTableModel : public views::TableModel { public: explicit CustomHomePagesTableModel(Profile* profile); virtual ~CustomHomePagesTableModel() {} @@ -185,11 +185,11 @@ class CustomHomePagesTableModel : public ChromeViews::TableModel { // Returns the set of urls this model contains. std::vector<GURL> GetURLs(); - // ChromeViews::TableModel overrides: + // views::TableModel overrides: virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); virtual SkBitmap GetIcon(int row); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); private: // Each item in the model is represented as an Entry. Entry stores the URL @@ -233,7 +233,7 @@ class CustomHomePagesTableModel : public ChromeViews::TableModel { // Profile used to load icons. Profile* profile_; - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; // Used in loading favicons. CancelableRequestConsumer fav_icon_consumer_; @@ -311,7 +311,7 @@ SkBitmap CustomHomePagesTableModel::GetIcon(int row) { } void CustomHomePagesTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { + views::TableModelObserver* observer) { observer_ = observer; } @@ -376,7 +376,7 @@ CustomHomePagesTableModel::Entry* /////////////////////////////////////////////////////////////////////////////// // SearchEngineListModel -class SearchEngineListModel : public ChromeViews::ComboBox::Model, +class SearchEngineListModel : public views::ComboBox::Model, public TemplateURLModelObserver { public: explicit SearchEngineListModel(Profile* profile); @@ -384,11 +384,11 @@ class SearchEngineListModel : public ChromeViews::ComboBox::Model, // Sets the ComboBox. SearchEngineListModel needs a handle to the ComboBox // so that when the TemplateURLModel changes the combobox can be updated. - void SetComboBox(ChromeViews::ComboBox* combo_box); + void SetComboBox(views::ComboBox* combo_box); - // ChromeViews::ComboBox::Model overrides: - virtual int GetItemCount(ChromeViews::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + // views::ComboBox::Model overrides: + virtual int GetItemCount(views::ComboBox* source); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); // Returns the TemplateURL at the specified index. const TemplateURL* GetTemplateURLAt(int index); @@ -409,7 +409,7 @@ class SearchEngineListModel : public ChromeViews::ComboBox::Model, TemplateURLModel* template_url_model_; // The combobox hosting us. - ChromeViews::ComboBox* combo_box_; + views::ComboBox* combo_box_; // The TemplateURLs we're showing. typedef std::vector<const TemplateURL*> TemplateURLs; @@ -433,7 +433,7 @@ SearchEngineListModel::~SearchEngineListModel() { template_url_model_->RemoveObserver(this); } -void SearchEngineListModel::SetComboBox(ChromeViews::ComboBox* combo_box) { +void SearchEngineListModel::SetComboBox(views::ComboBox* combo_box) { combo_box_ = combo_box; if (template_url_model_ && template_url_model_->loaded()) ChangeComboBoxSelection(); @@ -441,11 +441,11 @@ void SearchEngineListModel::SetComboBox(ChromeViews::ComboBox* combo_box) { combo_box_->SetEnabled(false); } -int SearchEngineListModel::GetItemCount(ChromeViews::ComboBox* source) { +int SearchEngineListModel::GetItemCount(views::ComboBox* source) { return static_cast<int>(template_urls_.size()); } -std::wstring SearchEngineListModel::GetItemAt(ChromeViews::ComboBox* source, +std::wstring SearchEngineListModel::GetItemAt(views::ComboBox* source, int index) { DCHECK(index < GetItemCount(combo_box_)); return template_urls_[index]->short_name(); @@ -532,9 +532,9 @@ GeneralPageView::~GeneralPageView() { } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, ChromeViews::NativeButton::Listener implementation: +// GeneralPageView, views::NativeButton::Listener implementation: -void GeneralPageView::ButtonPressed(ChromeViews::NativeButton* sender) { +void GeneralPageView::ButtonPressed(views::NativeButton* sender) { if (sender == startup_homepage_radio_ || sender == startup_last_session_radio_ || sender == startup_custom_radio_) { @@ -585,9 +585,9 @@ void GeneralPageView::ButtonPressed(ChromeViews::NativeButton* sender) { } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, ChromeViews::ComboBox::Listener implementation: +// GeneralPageView, views::ComboBox::Listener implementation: -void GeneralPageView::ItemChanged(ChromeViews::ComboBox* combo_box, +void GeneralPageView::ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index) { if (combo_box == default_search_engine_combobox_) { SetDefaultSearchProvider(); @@ -596,9 +596,9 @@ void GeneralPageView::ItemChanged(ChromeViews::ComboBox* combo_box, } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, ChromeViews::TextField::Controller implementation: +// GeneralPageView, views::TextField::Controller implementation: -void GeneralPageView::ContentsChanged(ChromeViews::TextField* sender, +void GeneralPageView::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { if (sender == homepage_use_url_textfield_) { // If the text field contains a valid URL, sync it to prefs. We run it @@ -611,7 +611,7 @@ void GeneralPageView::ContentsChanged(ChromeViews::TextField* sender, } } -void GeneralPageView::HandleKeystroke(ChromeViews::TextField* sender, +void GeneralPageView::HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags) { // Not necessary. @@ -621,8 +621,8 @@ void GeneralPageView::HandleKeystroke(ChromeViews::TextField* sender, // GeneralPageView, OptionsPageView implementation: void GeneralPageView::InitControlLayout() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(this); layout->SetInsets(5, 5, 5, 5); @@ -726,7 +726,7 @@ void GeneralPageView::HighlightGroup(OptionsGroup highlight_group) { } /////////////////////////////////////////////////////////////////////////////// -// GeneralPageView, ChromeViews::View overrides: +// GeneralPageView, views::View overrides: void GeneralPageView::Layout() { // We need to Layout twice - once to get the width of the contents box... @@ -765,45 +765,45 @@ void GeneralPageView::SetDefaultBrowserUIState(DefaultBrowserUIState state) { } void GeneralPageView::InitStartupGroup() { - startup_homepage_radio_ = new ChromeViews::RadioButton( + startup_homepage_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_DEFAULT_AND_NEWTAB), kStartupRadioGroup); startup_homepage_radio_->SetListener(this); - startup_last_session_radio_ = new ChromeViews::RadioButton( + startup_last_session_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_LAST_SESSION), kStartupRadioGroup); startup_last_session_radio_->SetListener(this); startup_last_session_radio_->SetMultiLine(true); - startup_custom_radio_ = new ChromeViews::RadioButton( + startup_custom_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_SHOW_PAGES), kStartupRadioGroup); startup_custom_radio_->SetListener(this); - startup_add_custom_page_button_ = new ChromeViews::NativeButton( + startup_add_custom_page_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_ADD_BUTTON)); startup_add_custom_page_button_->SetListener(this); - startup_remove_custom_page_button_ = new ChromeViews::NativeButton( + startup_remove_custom_page_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_REMOVE_BUTTON)); startup_remove_custom_page_button_->SetEnabled(false); startup_remove_custom_page_button_->SetListener(this); - startup_use_current_page_button_ = new ChromeViews::NativeButton( + startup_use_current_page_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_STARTUP_USE_CURRENT)); startup_use_current_page_button_->SetListener(this); startup_custom_pages_table_model_.reset( new CustomHomePagesTableModel(profile())); - std::vector<ChromeViews::TableColumn> columns; - columns.push_back(ChromeViews::TableColumn()); - startup_custom_pages_table_ = new ChromeViews::TableView( + std::vector<views::TableColumn> columns; + columns.push_back(views::TableColumn()); + startup_custom_pages_table_ = new views::TableView( startup_custom_pages_table_model_.get(), columns, - ChromeViews::ICON_AND_TEXT, true, false, true); + views::ICON_AND_TEXT, true, false, true); // URLs are inherently left-to-right, so do not mirror the table. startup_custom_pages_table_->EnableUIMirroringForRTLLanguages(false); startup_custom_pages_table_->SetObserver(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -833,7 +833,7 @@ void GeneralPageView::InitStartupGroup() { layout->StartRow(0, double_column_view_set_id); layout->AddView(startup_custom_pages_table_); - ChromeViews::View* button_stack = new ChromeViews::View; + views::View* button_stack = new views::View; GridLayout* button_stack_layout = new GridLayout(button_stack); button_stack->SetLayoutManager(button_stack_layout); @@ -859,26 +859,26 @@ void GeneralPageView::InitStartupGroup() { } void GeneralPageView::InitHomepageGroup() { - homepage_use_newtab_radio_ = new ChromeViews::RadioButton( + homepage_use_newtab_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_USE_NEWTAB), kHomePageRadioGroup); homepage_use_newtab_radio_->SetListener(this); homepage_use_newtab_radio_->SetMultiLine(true); - homepage_use_url_radio_ = new ChromeViews::RadioButton( + homepage_use_url_radio_ = new views::RadioButton( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_USE_URL), kHomePageRadioGroup); homepage_use_url_radio_->SetListener(this); - homepage_use_url_textfield_ = new ChromeViews::TextField; + homepage_use_url_textfield_ = new views::TextField; homepage_use_url_textfield_->SetController(this); - homepage_show_home_button_checkbox_ = new ChromeViews::CheckBox( + homepage_show_home_button_checkbox_ = new views::CheckBox( l10n_util::GetString(IDS_OPTIONS_HOMEPAGE_SHOW_BUTTON)); homepage_show_home_button_checkbox_->SetListener(this); homepage_show_home_button_checkbox_->SetMultiLine(true); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -914,18 +914,18 @@ void GeneralPageView::InitHomepageGroup() { void GeneralPageView::InitDefaultSearchGroup() { default_search_engines_model_.reset(new SearchEngineListModel(profile())); default_search_engine_combobox_ = - new ChromeViews::ComboBox(default_search_engines_model_.get()); + new views::ComboBox(default_search_engines_model_.get()); default_search_engines_model_->SetComboBox(default_search_engine_combobox_); default_search_engine_combobox_->SetListener(this); - default_search_manage_engines_button_ = new ChromeViews::NativeButton( + default_search_manage_engines_button_ = new views::NativeButton( l10n_util::GetString(IDS_OPTIONS_DEFAULTSEARCH_MANAGE_ENGINES_LINK)); default_search_manage_engines_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -947,19 +947,19 @@ void GeneralPageView::InitDefaultSearchGroup() { } void GeneralPageView::InitDefaultBrowserGroup() { - default_browser_status_label_ = new ChromeViews::Label; + default_browser_status_label_ = new views::Label; default_browser_status_label_->SetMultiLine(true); default_browser_status_label_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); - default_browser_use_as_default_button_ = new ChromeViews::NativeButton( + views::Label::ALIGN_LEFT); + default_browser_use_as_default_button_ = new views::NativeButton( l10n_util::GetStringF(IDS_OPTIONS_DEFAULTBROWSER_USEASDEFAULT, l10n_util::GetString(IDS_PRODUCT_NAME))); default_browser_use_as_default_button_->SetListener(this); - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; - ChromeViews::View* contents = new ChromeViews::View; + views::View* contents = new views::View; GridLayout* layout = new GridLayout(contents); contents->SetLayoutManager(layout); @@ -1001,7 +1001,7 @@ void GeneralPageView::AddURLToStartupURLs() { } void GeneralPageView::RemoveURLsFromStartupURLs() { - for (ChromeViews::TableView::iterator i = + for (views::TableView::iterator i = startup_custom_pages_table_->SelectionBegin(); i != startup_custom_pages_table_->SelectionEnd(); ++i) { startup_custom_pages_table_model_->Remove(*i); diff --git a/chrome/browser/views/options/general_page_view.h b/chrome/browser/views/options/general_page_view.h index 8ec6e39..7860cff 100644 --- a/chrome/browser/views/options/general_page_view.h +++ b/chrome/browser/views/options/general_page_view.h @@ -12,7 +12,7 @@ #include "chrome/views/native_button.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class CheckBox; class GroupboxView; class Label; @@ -29,28 +29,28 @@ class SearchEngineListModel; // GeneralPageView class GeneralPageView : public OptionsPageView, - public ChromeViews::ComboBox::Listener, - public ChromeViews::NativeButton::Listener, - public ChromeViews::TextField::Controller, + public views::ComboBox::Listener, + public views::NativeButton::Listener, + public views::TextField::Controller, public ShelfItemDialogDelegate, - public ChromeViews::TableViewObserver { + public views::TableViewObserver { public: explicit GeneralPageView(Profile* profile); virtual ~GeneralPageView(); protected: - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::ComboBox::Listener implementation: - virtual void ItemChanged(ChromeViews::ComboBox* combo_box, + // views::ComboBox::Listener implementation: + virtual void ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index); - // ChromeViews::TextField::Controller implementation: - virtual void ContentsChanged(ChromeViews::TextField* sender, + // views::TextField::Controller implementation: + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags); @@ -59,7 +59,7 @@ class GeneralPageView : public OptionsPageView, virtual void NotifyPrefChanged(const std::wstring* pref_name); virtual void HighlightGroup(OptionsGroup highlight_group); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); private: @@ -119,35 +119,35 @@ class GeneralPageView : public OptionsPageView, // Controls for the Startup group OptionsGroupView* startup_group_; - ChromeViews::RadioButton* startup_homepage_radio_; - ChromeViews::RadioButton* startup_last_session_radio_; - ChromeViews::RadioButton* startup_custom_radio_; - ChromeViews::NativeButton* startup_add_custom_page_button_; - ChromeViews::NativeButton* startup_remove_custom_page_button_; - ChromeViews::NativeButton* startup_use_current_page_button_; - ChromeViews::TableView* startup_custom_pages_table_; + views::RadioButton* startup_homepage_radio_; + views::RadioButton* startup_last_session_radio_; + views::RadioButton* startup_custom_radio_; + views::NativeButton* startup_add_custom_page_button_; + views::NativeButton* startup_remove_custom_page_button_; + views::NativeButton* startup_use_current_page_button_; + views::TableView* startup_custom_pages_table_; scoped_ptr<CustomHomePagesTableModel> startup_custom_pages_table_model_; // Controls for the Home Page group OptionsGroupView* homepage_group_; - ChromeViews::RadioButton* homepage_use_newtab_radio_; - ChromeViews::RadioButton* homepage_use_url_radio_; - ChromeViews::TextField* homepage_use_url_textfield_; - ChromeViews::CheckBox* homepage_show_home_button_checkbox_; + views::RadioButton* homepage_use_newtab_radio_; + views::RadioButton* homepage_use_url_radio_; + views::TextField* homepage_use_url_textfield_; + views::CheckBox* homepage_show_home_button_checkbox_; BooleanPrefMember new_tab_page_is_home_page_; StringPrefMember homepage_; BooleanPrefMember show_home_button_; // Controls for the Default Search group OptionsGroupView* default_search_group_; - ChromeViews::ComboBox* default_search_engine_combobox_; - ChromeViews::NativeButton* default_search_manage_engines_button_; + views::ComboBox* default_search_engine_combobox_; + views::NativeButton* default_search_manage_engines_button_; scoped_ptr<SearchEngineListModel> default_search_engines_model_; // Controls for the Default Browser group OptionsGroupView* default_browser_group_; - ChromeViews::Label* default_browser_status_label_; - ChromeViews::NativeButton* default_browser_use_as_default_button_; + views::Label* default_browser_status_label_; + views::NativeButton* default_browser_use_as_default_button_; // The helper object that performs default browser set/check tasks. class DefaultBrowserWorker; diff --git a/chrome/browser/views/options/language_combobox_model.cc b/chrome/browser/views/options/language_combobox_model.cc index 46fafe2..44c1f0c 100644 --- a/chrome/browser/views/options/language_combobox_model.cc +++ b/chrome/browser/views/options/language_combobox_model.cc @@ -73,12 +73,12 @@ void LanguageComboboxModel::InitNativeNames(const std::vector<std::wstring>& &locale_names_); } -// Overridden from ChromeViews::Combobox::Model: -int LanguageComboboxModel::GetItemCount(ChromeViews::ComboBox* source) { +// Overridden from views::Combobox::Model: +int LanguageComboboxModel::GetItemCount(views::ComboBox* source) { return static_cast<int>(locale_names_.size()); } -std::wstring LanguageComboboxModel::GetItemAt(ChromeViews::ComboBox* source, +std::wstring LanguageComboboxModel::GetItemAt(views::ComboBox* source, int index) { DCHECK(static_cast<int>(locale_names_.size()) > index); LocaleDataMap::const_iterator it = diff --git a/chrome/browser/views/options/language_combobox_model.h b/chrome/browser/views/options/language_combobox_model.h index 657fa76..9922fe8 100644 --- a/chrome/browser/views/options/language_combobox_model.h +++ b/chrome/browser/views/options/language_combobox_model.h @@ -11,7 +11,7 @@ /////////////////////////////////////////////////////////////////////////////// // LanguageComboboxModel // The model that fills the dropdown of valid UI languages. -class LanguageComboboxModel : public ChromeViews::ComboBox::Model { +class LanguageComboboxModel : public views::ComboBox::Model { public: struct LocaleData { LocaleData() { } @@ -33,10 +33,10 @@ class LanguageComboboxModel : public ChromeViews::ComboBox::Model { void InitNativeNames(const std::vector<std::wstring>& locale_codes); - // Overridden from ChromeViews::Combobox::Model: - virtual int GetItemCount(ChromeViews::ComboBox* source); + // Overridden from views::Combobox::Model: + virtual int GetItemCount(views::ComboBox* source); - virtual std::wstring GetItemAt(ChromeViews::ComboBox* source, int index); + virtual std::wstring GetItemAt(views::ComboBox* source, int index); // Return the locale for the given index. E.g., may return pt-BR. std::wstring GetLocaleFromIndex(int index); diff --git a/chrome/browser/views/options/languages_page_view.cc b/chrome/browser/views/options/languages_page_view.cc index 240bbe3..fc8398e 100644 --- a/chrome/browser/views/options/languages_page_view.cc +++ b/chrome/browser/views/options/languages_page_view.cc @@ -204,42 +204,42 @@ static const wchar_t* const accept_language_list[] = { // // This opens another window from where a new accept language can be selected. // -class AddLanguageWindowView : public ChromeViews::View, - public ChromeViews::ComboBox::Listener, - public ChromeViews::DialogDelegate { +class AddLanguageWindowView : public views::View, + public views::ComboBox::Listener, + public views::DialogDelegate { public: AddLanguageWindowView(LanguagesPageView* language_delegate, Profile* profile); - ChromeViews::Window* container() const { return container_; } - void set_container(ChromeViews::Window* container) { + views::Window* container() const { return container_; } + void set_container(views::Window* container) { container_ = container; } - // ChromeViews::DialogDelegate methods. + // views::DialogDelegate methods. virtual bool Accept(); virtual std::wstring GetWindowTitle() const; - // ChromeViews::WindowDelegate method. + // views::WindowDelegate method. virtual bool IsModal() const { return true; } - virtual ChromeViews::View* GetContentsView() { return this; } + virtual views::View* GetContentsView() { return this; } - // ChromeViews::ComboBox::Listener implementation: - virtual void ItemChanged(ChromeViews::ComboBox* combo_box, + // views::ComboBox::Listener implementation: + virtual void ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index); - // ChromeViews::View overrides. + // views::View overrides. virtual void Layout(); virtual gfx::Size GetPreferredSize(); protected: - virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, - ChromeViews::View* child); + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); private: void Init(); // The Options dialog window. - ChromeViews::Window* container_; + views::Window* container_; // Used for Call back to LanguagePageView that language has been selected. LanguagesPageView* language_delegate_; @@ -247,7 +247,7 @@ class AddLanguageWindowView : public ChromeViews::View, // Combobox and its corresponding model. scoped_ptr<LanguageComboboxModel> accept_language_combobox_model_; - ChromeViews::ComboBox* accept_language_combobox_; + views::ComboBox* accept_language_combobox_; // The Profile associated with this window. Profile* profile_; @@ -282,7 +282,7 @@ bool AddLanguageWindowView::Accept() { return true; } -void AddLanguageWindowView::ItemChanged(ChromeViews::ComboBox* combo_box, +void AddLanguageWindowView::ItemChanged(views::ComboBox* combo_box, int prev_index, int new_index) { accept_language_selected_ = accept_language_combobox_model_-> @@ -303,8 +303,9 @@ gfx::Size AddLanguageWindowView::GetPreferredSize() { font.height() * kDefaultWindowHeightLines); } -void AddLanguageWindowView::ViewHierarchyChanged( - bool is_add, ChromeViews::View* parent, ChromeViews::View* child) { +void AddLanguageWindowView::ViewHierarchyChanged(bool is_add, + views::View* parent, + views::View* child) { // Can't init before we're inserted into a Container, because we require // a HWND to parent native child controls to. if (is_add && child == this) @@ -328,14 +329,14 @@ void AddLanguageWindowView::Init() { } accept_language_combobox_model_.reset(new LanguageComboboxModel( profile_, locale_codes)); - accept_language_combobox_ = new ChromeViews::ComboBox( + accept_language_combobox_ = new views::ComboBox( accept_language_combobox_model_.get()); accept_language_combobox_->SetSelectedItem(0); accept_language_combobox_->SetListener(this); AddChildView(accept_language_combobox_); } -class LanguageOrderTableModel : public ChromeViews::TableModel { +class LanguageOrderTableModel : public views::TableModel { public: LanguageOrderTableModel(); @@ -357,10 +358,10 @@ class LanguageOrderTableModel : public ChromeViews::TableModel { // Returns the set of languagess this model contains. std::wstring GetLanguageList() { return VectorToList(languages_); } - // ChromeViews::TableModel overrides: + // views::TableModel overrides: virtual int RowCount(); virtual std::wstring GetText(int row, int column_id); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); private: // This method converts a comma separated list to a vector of strings. @@ -374,7 +375,7 @@ class LanguageOrderTableModel : public ChromeViews::TableModel { std::vector<std::wstring> languages_; std::wstring comma_separated_language_list_; - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; DISALLOW_EVIL_CONSTRUCTORS(LanguageOrderTableModel); }; @@ -393,7 +394,7 @@ void LanguageOrderTableModel::SetAcceptLanguagesString( } void LanguageOrderTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { + views::TableModelObserver* observer) { observer_ = observer; } @@ -491,7 +492,7 @@ LanguagesPageView::~LanguagesPageView() { language_order_table_->SetModel(NULL); } -void LanguagesPageView::ButtonPressed(ChromeViews::NativeButton* sender) { +void LanguagesPageView::ButtonPressed(views::NativeButton* sender) { if (sender == move_up_button_) { OnMoveUpLanguage(); language_table_edited_ = true; @@ -502,7 +503,7 @@ void LanguagesPageView::ButtonPressed(ChromeViews::NativeButton* sender) { OnRemoveLanguage(); language_table_edited_ = true; } else if (sender == add_button_) { - ChromeViews::Window::CreateChromeWindow( + views::Window::CreateChromeWindow( GetContainer()->GetHWND(), gfx::Rect(), new AddLanguageWindowView(this, profile()))->Show(); @@ -518,25 +519,25 @@ void LanguagesPageView::OnAddLanguage(const std::wstring& new_language) { void LanguagesPageView::InitControlLayout() { // Define the buttons. - add_button_ = new ChromeViews::NativeButton(l10n_util::GetString( + add_button_ = new views::NativeButton(l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_ADD_BUTTON_LABEL)); add_button_->SetListener(this); - remove_button_ = new ChromeViews::NativeButton(l10n_util::GetString( + remove_button_ = new views::NativeButton(l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_REMOVE_BUTTON_LABEL)); remove_button_->SetEnabled(false); remove_button_->SetListener(this); - move_up_button_ = new ChromeViews::NativeButton(l10n_util::GetString( + move_up_button_ = new views::NativeButton(l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEUP_BUTTON_LABEL)); move_up_button_->SetEnabled(false); move_up_button_->SetListener(this); - move_down_button_ = new ChromeViews::NativeButton(l10n_util::GetString( + move_down_button_ = new views::NativeButton(l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_SELECTOR_MOVEDOWN_BUTTON_LABEL)); move_down_button_->SetEnabled(false); move_down_button_->SetListener(this); - languages_contents_ = new ChromeViews::View; - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + languages_contents_ = new views::View; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = CreatePanelGridLayout(this); SetLayoutManager(layout); @@ -547,23 +548,23 @@ void LanguagesPageView::InitControlLayout() { // Add the instructions label. column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); - languages_instructions_ = new ChromeViews::Label( + languages_instructions_ = new views::Label( l10n_util::GetString( IDS_FONT_LANGUAGE_SETTING_LANGUAGES_INSTRUCTIONS)); languages_instructions_->SetMultiLine(true); languages_instructions_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); + views::Label::ALIGN_LEFT); layout->StartRow(0, single_column_view_set_id); layout->AddView(languages_instructions_); layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); // Add two columns - for table, and for button stack. - std::vector<ChromeViews::TableColumn> columns; - columns.push_back(ChromeViews::TableColumn()); + std::vector<views::TableColumn> columns; + columns.push_back(views::TableColumn()); language_order_table_model_.reset(new LanguageOrderTableModel); - language_order_table_ = new ChromeViews::TableView( + language_order_table_ = new views::TableView( language_order_table_model_.get(), columns, - ChromeViews::TEXT_ONLY, false, true, true); + views::TEXT_ONLY, false, true, true); language_order_table_->SetObserver(this); const int double_column_view_set_id = 1; @@ -580,7 +581,7 @@ void LanguagesPageView::InitControlLayout() { layout->AddView(language_order_table_); // Now add the four buttons to the second column. - button_stack_ = new ChromeViews::View; + button_stack_ = new views::View; GridLayout* button_stack_layout = new GridLayout(button_stack_); button_stack_->SetLayoutManager(button_stack_layout); @@ -607,20 +608,20 @@ void LanguagesPageView::InitControlLayout() { layout->AddPaddingRow(0, kUnrelatedControlLargeVerticalSpacing); - language_info_label_ = new ChromeViews::Label( + language_info_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CHROME_LANGUAGE_INFO)); - language_info_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); - ui_language_label_ = new ChromeViews::Label( + language_info_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); + ui_language_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CHROME_UI_LANGUAGE)); - ui_language_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + ui_language_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); ui_language_model_.reset(new LanguageComboboxModel); change_ui_language_combobox_ = - new ChromeViews::ComboBox(ui_language_model_.get()); + new views::ComboBox(ui_language_model_.get()); change_ui_language_combobox_->SetListener(this); - dictionary_language_label_ = new ChromeViews::Label( + dictionary_language_label_ = new views::Label( l10n_util::GetString(IDS_OPTIONS_CHROME_DICTIONARY_LANGUAGE)); dictionary_language_label_->SetHorizontalAlignment( - ChromeViews::Label::ALIGN_LEFT); + views::Label::ALIGN_LEFT); layout->StartRow(0, single_column_view_set_id); layout->AddView(language_info_label_); @@ -641,7 +642,7 @@ void LanguagesPageView::InitControlLayout() { dictionary_language_model_.reset(new LanguageComboboxModel(profile(), locale_codes)); change_dictionary_language_combobox_ = - new ChromeViews::ComboBox(dictionary_language_model_.get()); + new views::ComboBox(dictionary_language_model_.get()); change_dictionary_language_combobox_->SetListener(this); layout->StartRow(0, double_column_view_set_2_id); @@ -685,7 +686,7 @@ void LanguagesPageView::NotifyPrefChanged(const std::wstring* pref_name) { } } -void LanguagesPageView::ItemChanged(ChromeViews::ComboBox* sender, +void LanguagesPageView::ItemChanged(views::ComboBox* sender, int prev_index, int new_index) { if (sender == change_ui_language_combobox_) { @@ -711,7 +712,7 @@ void LanguagesPageView::OnSelectionChanged() { void LanguagesPageView::OnRemoveLanguage() { int item_selected = 0; - for (ChromeViews::TableView::iterator i = + for (views::TableView::iterator i = language_order_table_->SelectionBegin(); i != language_order_table_->SelectionEnd(); ++i) { language_order_table_model_->Remove(*i); diff --git a/chrome/browser/views/options/languages_page_view.h b/chrome/browser/views/options/languages_page_view.h index fc7d0b0..1cd9552 100644 --- a/chrome/browser/views/options/languages_page_view.h +++ b/chrome/browser/views/options/languages_page_view.h @@ -12,7 +12,7 @@ #include "chrome/views/table_view.h" #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class TableModel; class TableView; @@ -26,15 +26,15 @@ class AddLanguageView; // LanguagesPageView class LanguagesPageView : public OptionsPageView, - public ChromeViews::NativeButton::Listener, - public ChromeViews::TableViewObserver, - public ChromeViews::ComboBox::Listener { + public views::NativeButton::Listener, + public views::TableViewObserver, + public views::ComboBox::Listener { public: explicit LanguagesPageView(Profile* profile); virtual ~LanguagesPageView(); - // ChromeViews::NativeButton::Listener implementation: - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener implementation: + virtual void ButtonPressed(views::NativeButton* sender); // Save Changes made to relevant pref members associated with this tab. // This is public since it is called by FontsLanguageWindowView in its @@ -51,8 +51,8 @@ class LanguagesPageView : public OptionsPageView, virtual void InitControlLayout(); virtual void NotifyPrefChanged(const std::wstring* pref_name); - // ChromeViews::ComboBox::Listener implementation: - virtual void ItemChanged(ChromeViews::ComboBox* sender, + // views::ComboBox::Listener implementation: + virtual void ItemChanged(views::ComboBox* sender, int prev_index, int new_index); @@ -64,19 +64,19 @@ class LanguagesPageView : public OptionsPageView, void OnMoveDownLanguage(); void OnMoveUpLanguage(); - ChromeViews::Label* languages_instructions_; - ChromeViews::View* languages_contents_; - ChromeViews::View* button_stack_; - ChromeViews::TableView* language_order_table_; - ChromeViews::NativeButton* move_up_button_; - ChromeViews::NativeButton* move_down_button_; - ChromeViews::NativeButton* add_button_; - ChromeViews::NativeButton* remove_button_; - ChromeViews::Label* language_info_label_; - ChromeViews::Label* ui_language_label_; - ChromeViews::ComboBox* change_ui_language_combobox_; - ChromeViews::ComboBox* change_dictionary_language_combobox_; - ChromeViews::Label* dictionary_language_label_; + views::Label* languages_instructions_; + views::View* languages_contents_; + views::View* button_stack_; + views::TableView* language_order_table_; + views::NativeButton* move_up_button_; + views::NativeButton* move_down_button_; + views::NativeButton* add_button_; + views::NativeButton* remove_button_; + views::Label* language_info_label_; + views::Label* ui_language_label_; + views::ComboBox* change_ui_language_combobox_; + views::ComboBox* change_dictionary_language_combobox_; + views::Label* dictionary_language_label_; scoped_ptr<LanguageOrderTableModel> language_order_table_model_; AddLanguageView* add_language_instance_; diff --git a/chrome/browser/views/options/options_group_view.cc b/chrome/browser/views/options/options_group_view.cc index 5dbe96a..3fbbe08 100644 --- a/chrome/browser/views/options/options_group_view.cc +++ b/chrome/browser/views/options/options_group_view.cc @@ -26,13 +26,13 @@ static const int kOptionsGroupViewColumnSpacing = 30; /////////////////////////////////////////////////////////////////////////////// // OptionsGroupView, public: -OptionsGroupView::OptionsGroupView(ChromeViews::View* contents, +OptionsGroupView::OptionsGroupView(views::View* contents, const std::wstring& title, const std::wstring& description, bool show_separator) : contents_(contents), - title_label_(new ChromeViews::Label(title)), - description_label_(new ChromeViews::Label(description)), + title_label_(new views::Label(title)), + description_label_(new views::Label(description)), separator_(NULL), show_separator_(show_separator), highlighted_(false) { @@ -44,10 +44,10 @@ OptionsGroupView::OptionsGroupView(ChromeViews::View* contents, gfx::NativeTheme::BUTTON, BP_GROUPBOX, GBS_NORMAL, TMT_TEXTCOLOR, COLOR_WINDOWTEXT); title_label_->SetColor(title_color); title_label_->SetMultiLine(true); - title_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); description_label_->SetMultiLine(true); - description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); } void OptionsGroupView::SetHighlighted(bool highlighted) { @@ -60,7 +60,7 @@ int OptionsGroupView::GetContentsWidth() const { } /////////////////////////////////////////////////////////////////////////////// -// OptionsGroupView, ChromeViews::View overrides: +// OptionsGroupView, views::View overrides: void OptionsGroupView::Paint(ChromeCanvas* canvas) { if (highlighted_) { @@ -75,8 +75,8 @@ void OptionsGroupView::Paint(ChromeCanvas* canvas) { } void OptionsGroupView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (is_add && child == this) Init(); } @@ -85,8 +85,8 @@ void OptionsGroupView::ViewHierarchyChanged(bool is_add, // OptionsGroupView, private: void OptionsGroupView::Init() { - using ChromeViews::GridLayout; - using ChromeViews::ColumnSet; + using views::GridLayout; + using views::ColumnSet; GridLayout* layout = new GridLayout(this); SetLayoutManager(layout); @@ -129,7 +129,7 @@ void OptionsGroupView::Init() { column_set->AddColumn(GridLayout::FILL, GridLayout::CENTER, 1, GridLayout::USE_PREF, 0, 0); - separator_ = new ChromeViews::Separator; + separator_ = new views::Separator; layout->StartRow(0, single_column_layout_id); layout->AddView(separator_); } diff --git a/chrome/browser/views/options/options_group_view.h b/chrome/browser/views/options/options_group_view.h index e1d98d1..f4050d9 100644 --- a/chrome/browser/views/options/options_group_view.h +++ b/chrome/browser/views/options/options_group_view.h @@ -7,7 +7,7 @@ #include "chrome/views/view.h" -namespace ChromeViews { +namespace views { class Label; class Separator; }; @@ -18,9 +18,9 @@ class Separator; // A helper View that gathers related options into groups with a title and // optional description. // -class OptionsGroupView : public ChromeViews::View { +class OptionsGroupView : public views::View { public: - OptionsGroupView(ChromeViews::View* contents, + OptionsGroupView(views::View* contents, const std::wstring& title, const std::wstring& description, bool show_separator); @@ -33,19 +33,19 @@ class OptionsGroupView : public ChromeViews::View { int GetContentsWidth() const; protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void Paint(ChromeCanvas* canvas); virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: void Init(); - ChromeViews::View* contents_; - ChromeViews::Label* title_label_; - ChromeViews::Label* description_label_; - ChromeViews::Separator* separator_; + views::View* contents_; + views::Label* title_label_; + views::Label* description_label_; + views::Separator* separator_; // True if we should show a separator line below the contents of this // section. diff --git a/chrome/browser/views/options/options_page_view.cc b/chrome/browser/views/options/options_page_view.cc index 5672397..bf16a17 100644 --- a/chrome/browser/views/options/options_page_view.cc +++ b/chrome/browser/views/options/options_page_view.cc @@ -38,11 +38,11 @@ void OptionsPageView::Observe(NotificationType type, } /////////////////////////////////////////////////////////////////////////////// -// OptionsPageView, ChromeViews::View overrides: +// OptionsPageView, views::View overrides: void OptionsPageView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (!initialized_ && is_add && GetContainer()) { // It is important that this only get done _once_ otherwise we end up // duplicating the view hierarchy when tabs are switched. diff --git a/chrome/browser/views/options/options_page_view.h b/chrome/browser/views/options/options_page_view.h index aff4191..d60b0d4 100644 --- a/chrome/browser/views/options/options_page_view.h +++ b/chrome/browser/views/options/options_page_view.h @@ -19,7 +19,7 @@ class PrefService; // A base class for Options dialog pages that handles ensuring control // initialization is done just once. // -class OptionsPageView : public ChromeViews::View, +class OptionsPageView : public views::View, public NotificationObserver { public: virtual ~OptionsPageView(); @@ -58,10 +58,10 @@ class OptionsPageView : public ChromeViews::View, // set. virtual void NotifyPrefChanged(const std::wstring* pref_name) { } - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); // Returns the HWND on which created windows should be parented. HWND GetRootWindow() const; diff --git a/chrome/browser/views/options/options_window_view.cc b/chrome/browser/views/options/options_window_view.cc index 4393a7e..ebc1bcf 100644 --- a/chrome/browser/views/options/options_window_view.cc +++ b/chrome/browser/views/options/options_window_view.cc @@ -31,9 +31,9 @@ static const int kDefaultWindowHeightLines = 29; // // The contents of the Options dialog window. // -class OptionsWindowView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::TabbedPane::Listener { +class OptionsWindowView : public views::View, + public views::DialogDelegate, + public views::TabbedPane::Listener { public: explicit OptionsWindowView(Profile* profile); virtual ~OptionsWindowView(); @@ -41,25 +41,25 @@ class OptionsWindowView : public ChromeViews::View, // Shows the Tab corresponding to the specified OptionsPage. void ShowOptionsPage(OptionsPage page, OptionsGroup highlight_group); - // ChromeViews::DialogDelegate implementation: + // views::DialogDelegate implementation: virtual int GetDialogButtons() const { return DIALOGBUTTON_CANCEL; } virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); virtual bool Cancel(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); - // ChromeViews::TabbedPane::Listener implementation: + // views::TabbedPane::Listener implementation: virtual void TabSelectedAt(int index); - // ChromeViews::View overrides: + // views::View overrides: virtual void Layout(); virtual gfx::Size GetPreferredSize(); protected: - // ChromeViews::View overrides: + // views::View overrides: virtual void ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child); + views::View* parent, + views::View* child); private: // Init the assorted Tabbed pages void Init(); @@ -68,7 +68,7 @@ class OptionsWindowView : public ChromeViews::View, OptionsPageView* GetCurrentOptionsPageView() const; // The Tab view that contains all of the options pages. - ChromeViews::TabbedPane* tabs_; + views::TabbedPane* tabs_; // The Profile associated with these options. Profile* profile_; @@ -125,7 +125,7 @@ void OptionsWindowView::ShowOptionsPage(OptionsPage page, } /////////////////////////////////////////////////////////////////////////////// -// OptionsWindowView, ChromeViews::DialogDelegate implementation: +// OptionsWindowView, views::DialogDelegate implementation: std::wstring OptionsWindowView::GetWindowTitle() const { return l10n_util::GetStringF(IDS_OPTIONS_DIALOG_TITLE, @@ -142,12 +142,12 @@ bool OptionsWindowView::Cancel() { return GetCurrentOptionsPageView()->CanClose(); } -ChromeViews::View* OptionsWindowView::GetContentsView() { +views::View* OptionsWindowView::GetContentsView() { return this; } /////////////////////////////////////////////////////////////////////////////// -// OptionsWindowView, ChromeViews::TabbedPane::Listener implementation: +// OptionsWindowView, views::TabbedPane::Listener implementation: void OptionsWindowView::TabSelectedAt(int index) { DCHECK(index > OPTIONS_PAGE_DEFAULT && index < OPTIONS_PAGE_COUNT); @@ -155,7 +155,7 @@ void OptionsWindowView::TabSelectedAt(int index) { } /////////////////////////////////////////////////////////////////////////////// -// OptionsWindowView, ChromeViews::View overrides: +// OptionsWindowView, views::View overrides: void OptionsWindowView::Layout() { tabs_->SetBounds(kDialogPadding, kDialogPadding, @@ -164,14 +164,14 @@ void OptionsWindowView::Layout() { } gfx::Size OptionsWindowView::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_OPTIONS_DIALOG_WIDTH_CHARS, IDS_OPTIONS_DIALOG_HEIGHT_LINES)); } void OptionsWindowView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { // Can't init before we're inserted into a Container, because we require a // HWND to parent native child controls to. if (is_add && child == this) @@ -182,7 +182,7 @@ void OptionsWindowView::ViewHierarchyChanged(bool is_add, // OptionsWindowView, private: void OptionsWindowView::Init() { - tabs_ = new ChromeViews::TabbedPane; + tabs_ = new views::TabbedPane; tabs_->SetListener(this); AddChildView(tabs_); @@ -202,7 +202,7 @@ void OptionsWindowView::Init() { } OptionsPageView* OptionsWindowView::GetCurrentOptionsPageView() const { - ChromeViews::RootView* contents_root_view = tabs_->GetContentsRootView(); + views::RootView* contents_root_view = tabs_->GetContentsRootView(); DCHECK(contents_root_view->GetChildViewCount() == 1); return static_cast<OptionsPageView*>(contents_root_view->GetChildViewAt(0)); } @@ -220,7 +220,7 @@ void ShowOptionsWindow(OptionsPage page, // about this case this will have to be fixed. if (!instance_) { instance_ = new OptionsWindowView(profile); - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); // The window is alive by itself now... } instance_->ShowOptionsPage(page, highlight_group); diff --git a/chrome/browser/views/page_info_window.cc b/chrome/browser/views/page_info_window.cc index 3a45c3f..dce5640 100644 --- a/chrome/browser/views/page_info_window.cc +++ b/chrome/browser/views/page_info_window.cc @@ -38,7 +38,7 @@ const int kHorizontalPadding = 10; //////////////////////////////////////////////////////////////////////////////// // SecurityTabView -class SecurityTabView : public ChromeViews::View { +class SecurityTabView : public views::View { public: SecurityTabView(Profile* profile, const GURL& url, @@ -58,7 +58,7 @@ class SecurityTabView : public ChromeViews::View { private: // A section contains an image that shows a status (good or bad), a title, // an optional head-line (in bold) and a description. - class Section : public ChromeViews::View { + class Section : public views::View { public: Section(const std::wstring& title, bool state, @@ -85,11 +85,11 @@ class SecurityTabView : public ChromeViews::View { static SkBitmap* good_state_icon_; static SkBitmap* bad_state_icon_; - ChromeViews::Label* title_label_; - ChromeViews::Separator* separator_; - ChromeViews::ImageView* status_image_; - ChromeViews::Label* head_line_label_; - ChromeViews::Label* description_label_; + views::Label* title_label_; + views::Separator* separator_; + views::ImageView* status_image_; + views::Label* head_line_label_; + views::Label* description_label_; DISALLOW_EVIL_CONSTRUCTORS(Section); }; @@ -139,26 +139,26 @@ SecurityTabView::Section::Section(const std::wstring& title, bool state, good_state_icon_ = rb.GetBitmapNamed(IDR_PAGEINFO_GOOD); bad_state_icon_ = rb.GetBitmapNamed(IDR_PAGEINFO_BAD); } - title_label_ = new ChromeViews::Label(title); - title_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + title_label_ = new views::Label(title); + title_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(title_label_); - separator_ = new ChromeViews::Separator(); + separator_ = new views::Separator(); AddChildView(separator_); - status_image_ = new ChromeViews::ImageView(); + status_image_ = new views::ImageView(); status_image_->SetImage(state ? good_state_icon_ : bad_state_icon_); AddChildView(status_image_); - head_line_label_ = new ChromeViews::Label(head_line); + head_line_label_ = new views::Label(head_line); head_line_label_->SetFont( head_line_label_->GetFont().DeriveFont(0, ChromeFont::BOLD)); - head_line_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + head_line_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(head_line_label_); - description_label_ = new ChromeViews::Label(description); + description_label_ = new views::Label(description); description_label_->SetMultiLine(true); - description_label_->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + description_label_->SetHorizontalAlignment(views::Label::ALIGN_LEFT); AddChildView(description_label_); } @@ -430,18 +430,18 @@ void SecurityTabView::OnGotVisitCountToHost(HistoryService::Handle handle, //////////////////////////////////////////////////////////////////////////////// // PageInfoContentView -class PageInfoContentView : public ChromeViews::View { +class PageInfoContentView : public views::View { public: PageInfoContentView() : cert_viewer_button_(NULL) {} - void set_cert_viewer_button(ChromeViews::NativeButton* cert_viewer_button) { + void set_cert_viewer_button(views::NativeButton* cert_viewer_button) { cert_viewer_button_ = cert_viewer_button; } - // ChromeViews::View overrides: + // views::View overrides: virtual void GetPreferredSize(CSize *out) { DCHECK(out); - *out = ChromeViews::Window::GetLocalizedContentsSize( + *out = views::Window::GetLocalizedContentsSize( IDS_PAGEINFO_DIALOG_WIDTH_CHARS, IDS_PAGEINFO_DIALOG_HEIGHT_LINES).ToSIZE(); } @@ -460,7 +460,7 @@ class PageInfoContentView : public ChromeViews::View { } private: - ChromeViews::NativeButton* cert_viewer_button_; + views::NativeButton* cert_viewer_button_; DISALLOW_EVIL_CONSTRUCTORS(PageInfoContentView); }; @@ -514,7 +514,7 @@ void PageInfoWindow::Init(Profile* profile, HWND parent) { cert_id_ = ssl.cert_id(); - cert_info_button_ = new ChromeViews::NativeButton( + cert_info_button_ = new views::NativeButton( l10n_util::GetString(IDS_PAGEINFO_CERT_INFO_BUTTON)); cert_info_button_->SetListener(this); @@ -522,23 +522,22 @@ void PageInfoWindow::Init(Profile* profile, DWORD sys_color = ::GetSysColor(COLOR_3DFACE); SkColor color = SkColorSetRGB(GetRValue(sys_color), GetGValue(sys_color), GetBValue(sys_color)); - contents_->SetBackground( - ChromeViews::Background::CreateSolidBackground(color)); + contents_->SetBackground(views::Background::CreateSolidBackground(color)); - ChromeViews::GridLayout* layout = new ChromeViews::GridLayout(contents_); + views::GridLayout* layout = new views::GridLayout(contents_); contents_->SetLayoutManager(layout); - ChromeViews::ColumnSet* columns = layout->AddColumnSet(0); + views::ColumnSet* columns = layout->AddColumnSet(0); columns->AddPaddingColumn(0, kHorizontalPadding); - columns->AddColumn(ChromeViews::GridLayout::FILL, // Horizontal resize. - ChromeViews::GridLayout::FILL, // Vertical resize. + columns->AddColumn(views::GridLayout::FILL, // Horizontal resize. + views::GridLayout::FILL, // Vertical resize. 1, // Resize weight. - ChromeViews::GridLayout::USE_PREF, // Size type. + views::GridLayout::USE_PREF, // Size type. 0, // Ignored for USE_PREF. 0); // Minimum size. - columns->AddColumn(ChromeViews::GridLayout::FILL, // Horizontal resize. - ChromeViews::GridLayout::FILL, // Vertical resize. + columns->AddColumn(views::GridLayout::FILL, // Horizontal resize. + views::GridLayout::FILL, // Vertical resize. 1, // Resize weight. - ChromeViews::GridLayout::USE_PREF, // Size type. + views::GridLayout::USE_PREF, // Size type. 0, // Ignored for USE_PREF. 0); // Minimum size. columns->AddPaddingColumn(0, kHorizontalPadding); @@ -562,7 +561,7 @@ void PageInfoWindow::Init(Profile* profile, } } - ChromeViews::Window::CreateChromeWindow(parent, gfx::Rect(), this); + views::Window::CreateChromeWindow(parent, gfx::Rect(), this); // TODO(beng): (Cleanup) - cert viewer button should use GetExtraView. if (cert_id_) { @@ -578,11 +577,11 @@ void PageInfoWindow::Init(Profile* profile, } } -ChromeViews::View* PageInfoWindow::CreateGeneralTabView() { - return new ChromeViews::View(); +views::View* PageInfoWindow::CreateGeneralTabView() { + return new views::View(); } -ChromeViews::View* PageInfoWindow::CreateSecurityTabView( +views::View* PageInfoWindow::CreateSecurityTabView( Profile* profile, const GURL& url, const NavigationEntry::SSLStatus& ssl, @@ -621,11 +620,11 @@ bool PageInfoWindow::RestoreWindowPosition(CRect* bounds, bounds, maximized, always_on_top); } -ChromeViews::View* PageInfoWindow::GetContentsView() { +views::View* PageInfoWindow::GetContentsView() { return contents_; } -void PageInfoWindow::ButtonPressed(ChromeViews::NativeButton* sender) { +void PageInfoWindow::ButtonPressed(views::NativeButton* sender) { if (sender == cert_info_button_) { DCHECK(cert_id_ != 0); ShowCertDialog(cert_id_); diff --git a/chrome/browser/views/page_info_window.h b/chrome/browser/views/page_info_window.h index 3f94fec..97b7a5d 100644 --- a/chrome/browser/views/page_info_window.h +++ b/chrome/browser/views/page_info_window.h @@ -14,7 +14,7 @@ // The page info window displays information regarding the current page, // including security information. -namespace ChromeViews { +namespace views { class TabbedPane; } @@ -24,8 +24,8 @@ class PrefService; class Profile; class X509Certificate; -class PageInfoWindow : public ChromeViews::DialogDelegate, - public ChromeViews::NativeButton::Listener { +class PageInfoWindow : public views::DialogDelegate, + public views::NativeButton::Listener { public: enum TabID { GENERAL = 0, @@ -59,13 +59,13 @@ class PageInfoWindow : public ChromeViews::DialogDelegate, bool show_history, HWND parent); - // ChromeViews::Window overridden method. + // views::Window overridden method. void Show(); - // ChromeViews::NativeButton::Listener method. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + // views::NativeButton::Listener method. + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::DialogDelegate methods: + // views::DialogDelegate methods: virtual int GetDialogButtons() const; virtual std::wstring GetWindowTitle() const; virtual void SaveWindowPosition(const CRect& bounds, @@ -74,11 +74,11 @@ class PageInfoWindow : public ChromeViews::DialogDelegate, virtual bool RestoreWindowPosition(CRect* bounds, bool* maximized, bool* always_on_top); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: - ChromeViews::View* CreateGeneralTabView(); - ChromeViews::View* CreateSecurityTabView( + views::View* CreateGeneralTabView(); + views::View* CreateSecurityTabView( Profile* profile, const GURL& url, const NavigationEntry::SSLStatus& ssl, @@ -92,7 +92,7 @@ class PageInfoWindow : public ChromeViews::DialogDelegate, // Shows various information for the specified certificate in a new dialog. void ShowCertDialog(int cert_id); - ChromeViews::NativeButton* cert_info_button_; + views::NativeButton* cert_info_button_; // The id of the server cert for this page (0 means no cert). int cert_id_; diff --git a/chrome/browser/views/password_manager_view.cc b/chrome/browser/views/password_manager_view.cc index 13965eb..91fdc09 100644 --- a/chrome/browser/views/password_manager_view.cc +++ b/chrome/browser/views/password_manager_view.cc @@ -16,8 +16,8 @@ #include "generated_resources.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; // We can only have one PasswordManagerView at a time. static PasswordManagerView* instance_ = NULL; @@ -98,7 +98,7 @@ int PasswordManagerTableModel::CompareValues(int row1, int row2, } void PasswordManagerTableModel::SetObserver( - ChromeViews::TableModelObserver* observer) { + views::TableModelObserver* observer) { observer_ = observer; } @@ -177,7 +177,7 @@ void PasswordManagerView::Show(Profile* profile) { instance_ = new PasswordManagerView(profile); // manager is owned by the dialog window, so Close() will delete it. - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), instance_); } if (!instance_->window()->IsVisible()) { instance_->window()->Show(); @@ -201,26 +201,20 @@ PasswordManagerView::PasswordManagerView(Profile* profile) void PasswordManagerView::SetupTable() { // Creates the different columns for the table. // The float resize values are the result of much tinkering. - std::vector<ChromeViews::TableColumn> columns; - columns.push_back( - ChromeViews::TableColumn( - IDS_PASSWORD_MANAGER_VIEW_SITE_COLUMN, - ChromeViews::TableColumn::LEFT, -1, 0.55f)); + std::vector<views::TableColumn> columns; + columns.push_back(views::TableColumn(IDS_PASSWORD_MANAGER_VIEW_SITE_COLUMN, + views::TableColumn::LEFT, -1, 0.55f)); columns.back().sortable = true; - columns.push_back( - ChromeViews::TableColumn( - IDS_PASSWORD_MANAGER_VIEW_USERNAME_COLUMN, - ChromeViews::TableColumn::RIGHT, -1, 0.37f)); + columns.push_back(views::TableColumn( + IDS_PASSWORD_MANAGER_VIEW_USERNAME_COLUMN, views::TableColumn::RIGHT, + -1, 0.37f)); columns.back().sortable = true; - table_view_ = new ChromeViews::TableView(&table_model_, - columns, - ChromeViews::TEXT_ONLY, - true, true, true); + table_view_ = new views::TableView(&table_model_, columns, views::TEXT_ONLY, + true, true, true); // Make the table initially sorted by host. - ChromeViews::TableView::SortDescriptors sort; - sort.push_back( - ChromeViews::TableView::SortDescriptor( - IDS_PASSWORD_MANAGER_VIEW_SITE_COLUMN, true)); + views::TableView::SortDescriptors sort; + sort.push_back(views::TableView::SortDescriptor( + IDS_PASSWORD_MANAGER_VIEW_SITE_COLUMN, true)); table_view_->SetSortDescriptors(sort); table_view_->SetObserver(this); } @@ -306,8 +300,8 @@ gfx::Size PasswordManagerView::GetPreferredSize() { } void PasswordManagerView::ViewHierarchyChanged(bool is_add, - ChromeViews::View* parent, - ChromeViews::View* child) { + views::View* parent, + views::View* child) { if (child == this) { // Add and remove the Remove All button from the ClientView's hierarchy. if (is_add) { @@ -352,7 +346,7 @@ std::wstring PasswordManagerView::GetWindowTitle() const { return l10n_util::GetString(IDS_PASSWORD_MANAGER_VIEW_TITLE); } -void PasswordManagerView::ButtonPressed(ChromeViews::NativeButton* sender) { +void PasswordManagerView::ButtonPressed(views::NativeButton* sender) { DCHECK(window()); // Close will result in our destruction. if (sender == &remove_all_button_) { @@ -362,7 +356,7 @@ void PasswordManagerView::ButtonPressed(ChromeViews::NativeButton* sender) { // The following require a selection (and only one, since table is single- // select only). - ChromeViews::TableSelectionIterator iter = table_view_->SelectionBegin(); + views::TableSelectionIterator iter = table_view_->SelectionBegin(); int row = *iter; PasswordForm* selected = table_model_.GetPasswordFormAt(row); DCHECK(++iter == table_view_->SelectionEnd()); @@ -393,6 +387,6 @@ void PasswordManagerView::WindowClosing() { instance_ = NULL; } -ChromeViews::View* PasswordManagerView::GetContentsView() { +views::View* PasswordManagerView::GetContentsView() { return this; } diff --git a/chrome/browser/views/password_manager_view.h b/chrome/browser/views/password_manager_view.h index f611b18..1eb7ed5 100644 --- a/chrome/browser/views/password_manager_view.h +++ b/chrome/browser/views/password_manager_view.h @@ -18,7 +18,7 @@ class Profile; struct PasswordForm; -class PasswordManagerTableModel : public ChromeViews::TableModel, +class PasswordManagerTableModel : public views::TableModel, public WebDataServiceConsumer { public: explicit PasswordManagerTableModel(Profile* profile); @@ -28,7 +28,7 @@ class PasswordManagerTableModel : public ChromeViews::TableModel, virtual int RowCount(); virtual std::wstring GetText(int row, int column); virtual int CompareValues(int row1, int row2, int column_id); - virtual void SetObserver(ChromeViews::TableModelObserver* observer); + virtual void SetObserver(views::TableModelObserver* observer); // Delete the PasswordForm at specified row from the database (and remove // from view). @@ -69,7 +69,7 @@ class PasswordManagerTableModel : public ChromeViews::TableModel, } // The TableView observing this model. - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; // Handle to any pending WebDataService::GetLogins query. WebDataService::Handle pending_login_query_; @@ -85,7 +85,7 @@ class PasswordManagerTableModel : public ChromeViews::TableModel, // A button that can have 2 different labels set on it and for which the // preferred size is the size of the widest string. -class MultiLabelButtons : public ChromeViews::NativeButton { +class MultiLabelButtons : public views::NativeButton { public: MultiLabelButtons(const std::wstring& label, const std::wstring& alt_label); @@ -99,10 +99,10 @@ class MultiLabelButtons : public ChromeViews::NativeButton { DISALLOW_EVIL_CONSTRUCTORS(MultiLabelButtons); }; -class PasswordManagerView : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::TableViewObserver, - public ChromeViews::NativeButton::Listener { +class PasswordManagerView : public views::View, + public views::DialogDelegate, + public views::TableViewObserver, + public views::NativeButton::Listener { public: explicit PasswordManagerView(Profile* profile); virtual ~PasswordManagerView(); @@ -113,16 +113,16 @@ class PasswordManagerView : public ChromeViews::View, // View methods. virtual void Layout(); virtual gfx::Size GetPreferredSize(); - virtual void ViewHierarchyChanged(bool is_add, ChromeViews::View* parent, - ChromeViews::View* child); + virtual void ViewHierarchyChanged(bool is_add, views::View* parent, + views::View* child); - // ChromeViews::TableViewObserver implementation. + // views::TableViewObserver implementation. virtual void OnSelectionChanged(); // NativeButton::Listener implementation. - virtual void ButtonPressed(ChromeViews::NativeButton* sender); + virtual void ButtonPressed(views::NativeButton* sender); - // ChromeViews::DialogDelegate methods: + // views::DialogDelegate methods: virtual int GetDialogButtons() const; virtual bool CanResize() const; virtual bool CanMaximize() const; @@ -130,7 +130,7 @@ class PasswordManagerView : public ChromeViews::View, virtual bool HasAlwaysOnTopMenu() const; virtual std::wstring GetWindowTitle() const; virtual void WindowClosing(); - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: // Wire up buttons, the model, and the table view, and query the DB for @@ -145,13 +145,13 @@ class PasswordManagerView : public ChromeViews::View, // Components in this view. PasswordManagerTableModel table_model_; - ChromeViews::TableView* table_view_; + views::TableView* table_view_; // The buttons and labels. MultiLabelButtons show_button_; - ChromeViews::NativeButton remove_button_; - ChromeViews::NativeButton remove_all_button_; - ChromeViews::Label password_label_; + views::NativeButton remove_button_; + views::NativeButton remove_all_button_; + views::Label password_label_; DISALLOW_EVIL_CONSTRUCTORS(PasswordManagerView); }; diff --git a/chrome/browser/views/restart_message_box.cc b/chrome/browser/views/restart_message_box.cc index 1cfafff..596e16b 100644 --- a/chrome/browser/views/restart_message_box.cc +++ b/chrome/browser/views/restart_message_box.cc @@ -42,7 +42,7 @@ bool RestartMessageBox::IsModal() const { return true; } -ChromeViews::View* RestartMessageBox::GetContentsView() { +views::View* RestartMessageBox::GetContentsView() { return message_box_view_; } @@ -57,8 +57,7 @@ RestartMessageBox::RestartMessageBox(HWND parent_hwnd) { l10n_util::GetString(IDS_OPTIONS_RESTART_REQUIRED).c_str(), std::wstring(), kDialogWidth); - ChromeViews::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), - this)->Show(); + views::Window::CreateChromeWindow(parent_hwnd, gfx::Rect(), this)->Show(); } RestartMessageBox::~RestartMessageBox() { diff --git a/chrome/browser/views/restart_message_box.h b/chrome/browser/views/restart_message_box.h index e272bee..53f7d28 100644 --- a/chrome/browser/views/restart_message_box.h +++ b/chrome/browser/views/restart_message_box.h @@ -12,21 +12,21 @@ class MessageBoxView; // A dialog box that tells the user that s/he needs to restart Chrome // for a change to take effect. -class RestartMessageBox : public ChromeViews::DialogDelegate { +class RestartMessageBox : public views::DialogDelegate { public: // This box is modal to |parent_hwnd|. static void ShowMessageBox(HWND parent_hwnd); protected: - // ChromeViews::DialogDelegate: + // views::DialogDelegate: virtual int GetDialogButtons() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual std::wstring GetWindowTitle() const; - // ChromeViews::WindowDelegate: + // views::WindowDelegate: virtual void WindowClosing(); virtual bool IsModal() const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); private: explicit RestartMessageBox(HWND parent_hwnd); diff --git a/chrome/browser/views/sad_tab_view.h b/chrome/browser/views/sad_tab_view.h index 4f27199..37d8d99 100644 --- a/chrome/browser/views/sad_tab_view.h +++ b/chrome/browser/views/sad_tab_view.h @@ -12,7 +12,7 @@ // // SadTabView // -// A ChromeViews::View subclass used to render the presentation of the crashed +// A views::View subclass used to render the presentation of the crashed // "sad tab" in the browser window when a renderer is destroyed unnaturally. // // Note that since this view is not (currently) part of a Container or @@ -23,12 +23,12 @@ // processing will work. // /////////////////////////////////////////////////////////////////////////////// -class SadTabView : public ChromeViews::View { +class SadTabView : public views::View { public: SadTabView(); virtual ~SadTabView() {} - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); diff --git a/chrome/browser/views/shelf_item_dialog.cc b/chrome/browser/views/shelf_item_dialog.cc index 7e1db6b..bb3a056 100644 --- a/chrome/browser/views/shelf_item_dialog.cc +++ b/chrome/browser/views/shelf_item_dialog.cc @@ -26,8 +26,8 @@ #include "generated_resources.h" #include "net/base/net_util.h" -using ChromeViews::ColumnSet; -using ChromeViews::GridLayout; +using views::ColumnSet; +using views::GridLayout; // Preferred height of the table. static const int kTableWidth = 300; @@ -45,7 +45,7 @@ static SkBitmap* default_fav_icon = NULL; // How long we query entry points for. static const int kPossibleURLTimeScope = 30; -class PossibleURLModel : public ChromeViews::TableModel { +class PossibleURLModel : public views::TableModel { public: PossibleURLModel() : profile_(NULL) { if (!default_fav_icon) { @@ -195,7 +195,7 @@ class PossibleURLModel : public ChromeViews::TableModel { } } - virtual void SetObserver(ChromeViews::TableModelObserver* observer) { + virtual void SetObserver(views::TableModelObserver* observer) { observer_ = observer; } @@ -217,7 +217,7 @@ class PossibleURLModel : public ChromeViews::TableModel { Profile* profile_; // Our observer. - ChromeViews::TableModelObserver* observer_; + views::TableModelObserver* observer_; // Our consumer for favicon requests. CancelableRequestConsumerT<size_t, NULL> consumer_; @@ -249,24 +249,19 @@ ShelfItemDialog::ShelfItemDialog(ShelfItemDialogDelegate* delegate, url_table_model_.reset(new PossibleURLModel()); - ChromeViews::TableColumn col1(IDS_ASI_PAGE_COLUMN, - ChromeViews::TableColumn::LEFT, -1, - 50); + views::TableColumn col1(IDS_ASI_PAGE_COLUMN, views::TableColumn::LEFT, -1, + 50); col1.sortable = true; - ChromeViews::TableColumn col2(IDS_ASI_URL_COLUMN, - ChromeViews::TableColumn::LEFT, -1, - 50); + views::TableColumn col2(IDS_ASI_URL_COLUMN, views::TableColumn::LEFT, -1, + 50); col2.sortable = true; - std::vector<ChromeViews::TableColumn> cols; + std::vector<views::TableColumn> cols; cols.push_back(col1); cols.push_back(col2); - url_table_ = new ChromeViews::TableView(url_table_model_.get(), - cols, - ChromeViews::ICON_AND_TEXT, - true, - true, - true); + url_table_ = new views::TableView(url_table_model_.get(), cols, + views::ICON_AND_TEXT, true, true, + true); url_table_->SetObserver(this); // Yummy layout code. @@ -287,12 +282,12 @@ ShelfItemDialog::ShelfItemDialog(ShelfItemDialogDelegate* delegate, if (show_title) { layout->StartRow(0, labels_column_set_id); - ChromeViews::Label* title_label = new ChromeViews::Label(); - title_label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Label* title_label = new views::Label(); + title_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); title_label->SetText(l10n_util::GetString(IDS_ASI_TITLE_LABEL)); layout->AddView(title_label); - title_field_ = new ChromeViews::TextField(); + title_field_ = new views::TextField(); title_field_->SetController(this); layout->AddView(title_field_); @@ -302,20 +297,20 @@ ShelfItemDialog::ShelfItemDialog(ShelfItemDialogDelegate* delegate, } layout->StartRow(0, labels_column_set_id); - ChromeViews::Label* url_label = new ChromeViews::Label(); - url_label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Label* url_label = new views::Label(); + url_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); url_label->SetText(l10n_util::GetString(IDS_ASI_URL)); layout->AddView(url_label); - url_field_ = new ChromeViews::TextField(); + url_field_ = new views::TextField(); url_field_->SetController(this); layout->AddView(url_field_); layout->AddPaddingRow(0, kUnrelatedControlVerticalSpacing); layout->StartRow(0, single_column_view_set_id); - ChromeViews::Label* description_label = new ChromeViews::Label(); - description_label->SetHorizontalAlignment(ChromeViews::Label::ALIGN_LEFT); + views::Label* description_label = new views::Label(); + description_label->SetHorizontalAlignment(views::Label::ALIGN_LEFT); description_label->SetText(l10n_util::GetString(IDS_ASI_DESCRIPTION)); description_label->SetFont( description_label->GetFont().DeriveFont(0, ChromeFont::BOLD)); @@ -328,8 +323,8 @@ ShelfItemDialog::ShelfItemDialog(ShelfItemDialogDelegate* delegate, layout->AddPaddingRow(0, kRelatedControlVerticalSpacing); - AddAccelerator(ChromeViews::Accelerator(VK_ESCAPE, false, false, false)); - AddAccelerator(ChromeViews::Accelerator(VK_RETURN, false, false, false)); + AddAccelerator(views::Accelerator(VK_ESCAPE, false, false, false)); + AddAccelerator(views::Accelerator(VK_RETURN, false, false, false)); } ShelfItemDialog::~ShelfItemDialog() { @@ -338,7 +333,7 @@ ShelfItemDialog::~ShelfItemDialog() { void ShelfItemDialog::Show(HWND parent) { DCHECK(!window()); - ChromeViews::Window::CreateChromeWindow(parent, gfx::Rect(), this)->Show(); + views::Window::CreateChromeWindow(parent, gfx::Rect(), this)->Show(); if (title_field_) { title_field_->SetText(l10n_util::GetString(IDS_ASI_DEFAULT_TITLE)); title_field_->SelectAll(); @@ -407,7 +402,7 @@ void ShelfItemDialog::InitiateTitleAutoFill(const GURL& url) { NewCallback(this, &ShelfItemDialog::OnURLInfoAvailable)); } -void ShelfItemDialog::ContentsChanged(ChromeViews::TextField* sender, +void ShelfItemDialog::ContentsChanged(views::TextField* sender, const std::wstring& new_contents) { // If the user has edited the title field we no longer want to autofill it // so we reset the expected handle to an impossible value. @@ -434,7 +429,7 @@ bool ShelfItemDialog::IsDialogButtonEnabled(DialogButton button) const { return true; } -ChromeViews::View* ShelfItemDialog::GetContentsView() { +views::View* ShelfItemDialog::GetContentsView() { return this; } @@ -447,17 +442,17 @@ void ShelfItemDialog::PerformModelChange() { } gfx::Size ShelfItemDialog::GetPreferredSize() { - return gfx::Size(ChromeViews::Window::GetLocalizedContentsSize( + return gfx::Size(views::Window::GetLocalizedContentsSize( IDS_SHELFITEM_DIALOG_WIDTH_CHARS, IDS_SHELFITEM_DIALOG_HEIGHT_LINES)); } bool ShelfItemDialog::AcceleratorPressed( - const ChromeViews::Accelerator& accelerator) { + const views::Accelerator& accelerator) { if (accelerator.GetKeyCode() == VK_ESCAPE) { window()->Close(); } else if (accelerator.GetKeyCode() == VK_RETURN) { - ChromeViews::FocusManager* fm = ChromeViews::FocusManager::GetFocusManager( + views::FocusManager* fm = views::FocusManager::GetFocusManager( GetContainer()->GetHWND()); if (fm->GetFocusedView() == url_table_) { // Return on table behaves like a double click. diff --git a/chrome/browser/views/shelf_item_dialog.h b/chrome/browser/views/shelf_item_dialog.h index 6c0c587..fe6e8bb3 100644 --- a/chrome/browser/views/shelf_item_dialog.h +++ b/chrome/browser/views/shelf_item_dialog.h @@ -14,7 +14,7 @@ #include "chrome/views/view.h" #include "chrome/views/window.h" -namespace ChromeViews { +namespace views { class Button; class Label; } @@ -40,10 +40,10 @@ class ShelfItemDialogDelegate { // ShelfItemDialog deletes itself when the dialog is closed. // //////////////////////////////////////////////////////////////////////////////// -class ShelfItemDialog : public ChromeViews::View, - public ChromeViews::DialogDelegate, - public ChromeViews::TextField::Controller, - public ChromeViews::TableViewObserver { +class ShelfItemDialog : public views::View, + public views::DialogDelegate, + public views::TextField::Controller, + public views::TableViewObserver { public: ShelfItemDialog(ShelfItemDialogDelegate* delegate, Profile* profile, @@ -63,18 +63,18 @@ class ShelfItemDialog : public ChromeViews::View, virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual bool Accept(); virtual bool IsDialogButtonEnabled(DialogButton button) const; - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // TextField::Controller. - virtual void ContentsChanged(ChromeViews::TextField* sender, + virtual void ContentsChanged(views::TextField* sender, const std::wstring& new_contents); - virtual void HandleKeystroke(ChromeViews::TextField* sender, + virtual void HandleKeystroke(views::TextField* sender, UINT message, TCHAR key, UINT repeat_count, UINT flags) {} // Overridden from View. virtual gfx::Size GetPreferredSize(); - virtual bool AcceleratorPressed(const ChromeViews::Accelerator& accelerator); + virtual bool AcceleratorPressed(const views::Accelerator& accelerator); // TableViewObserver. virtual void OnSelectionChanged(); @@ -101,16 +101,16 @@ class ShelfItemDialog : public ChromeViews::View, Profile* profile_; // URL Field. - ChromeViews::TextField* url_field_; + views::TextField* url_field_; // Title field. This is NULL if we're not showing the title. - ChromeViews::TextField* title_field_; + views::TextField* title_field_; // The table model. scoped_ptr<PossibleURLModel> url_table_model_; // The table of visited urls. - ChromeViews::TableView* url_table_; + views::TableView* url_table_; // Handle of the title request we are expecting. CancelableRequestProvider::Handle expected_title_handle_; diff --git a/chrome/browser/views/standard_layout.h b/chrome/browser/views/standard_layout.h index 37e239bc..17e3855 100644 --- a/chrome/browser/views/standard_layout.h +++ b/chrome/browser/views/standard_layout.h @@ -67,8 +67,8 @@ const int kButtonHEdgeMargin = 7; const int kRelatedButtonHSpacing = 6; // Creates a GridLayout with kPanel*Margin insets. -static ChromeViews::GridLayout* CreatePanelGridLayout(ChromeViews::View* host) { - ChromeViews::GridLayout* layout = new ChromeViews::GridLayout(host); +static views::GridLayout* CreatePanelGridLayout(views::View* host) { + views::GridLayout* layout = new views::GridLayout(host); layout->SetInsets(kPanelVertMargin, kPanelHorizMargin, kPanelVertMargin, kPanelHorizMargin); return layout; diff --git a/chrome/browser/views/star_toggle.cc b/chrome/browser/views/star_toggle.cc index d51b440..4f986a3 100644 --- a/chrome/browser/views/star_toggle.cc +++ b/chrome/browser/views/star_toggle.cc @@ -44,11 +44,11 @@ gfx::Size StarToggle::GetPreferredSize() { return gfx::Size(state_off_->width(), state_off_->height()); } -bool StarToggle::OnMouseDragged(const ChromeViews::MouseEvent& e) { +bool StarToggle::OnMouseDragged(const views::MouseEvent& e) { return e.IsLeftMouseButton(); } -bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) { +bool StarToggle::OnMousePressed(const views::MouseEvent& e) { if (e.IsLeftMouseButton() && HitTest(e.location())) { RequestFocus(); return true; @@ -56,13 +56,13 @@ bool StarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) { return false; } -void StarToggle::OnMouseReleased(const ChromeViews::MouseEvent& e, +void StarToggle::OnMouseReleased(const views::MouseEvent& e, bool canceled) { if (e.IsLeftMouseButton() && HitTest(e.location())) SwitchState(); } -bool StarToggle::OnKeyPressed(const ChromeViews::KeyEvent& e) { +bool StarToggle::OnKeyPressed(const views::KeyEvent& e) { if ((e.GetCharacter() == L' ') || (e.GetCharacter() == L'\n')) { SwitchState(); return true; diff --git a/chrome/browser/views/star_toggle.h b/chrome/browser/views/star_toggle.h index e5e71e8..4ac8fa2 100644 --- a/chrome/browser/views/star_toggle.h +++ b/chrome/browser/views/star_toggle.h @@ -14,7 +14,7 @@ // Delegate when the state changes. // //////////////////////////////////////////////////////////////////////////////// -class StarToggle : public ChromeViews::View { +class StarToggle : public views::View { public: class Delegate { public: @@ -42,10 +42,10 @@ class StarToggle : public ChromeViews::View { // Overriden from view. void Paint(ChromeCanvas* canvas); gfx::Size GetPreferredSize(); - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& e, bool canceled); - bool OnKeyPressed(const ChromeViews::KeyEvent& e); + virtual bool OnMousePressed(const views::MouseEvent& e); + virtual bool OnMouseDragged(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& e, bool canceled); + bool OnKeyPressed(const views::KeyEvent& e); private: // The state. diff --git a/chrome/browser/views/status_bubble.cc b/chrome/browser/views/status_bubble.cc index fab001c..31c675f 100644 --- a/chrome/browser/views/status_bubble.cc +++ b/chrome/browser/views/status_bubble.cc @@ -64,11 +64,11 @@ static const int kFramerate = 25; // View ----------------------------------------------------------------------- // StatusView manages the display of the bubble, applying text changes and // fading in or out the bubble as required. -class StatusBubble::StatusView : public ChromeViews::Label, +class StatusBubble::StatusView : public views::Label, public Animation, public AnimationDelegate { public: - StatusView(StatusBubble* status_bubble, ChromeViews::ContainerWin* popup) + StatusView(StatusBubble* status_bubble, views::ContainerWin* popup) : Animation(kFramerate, this), status_bubble_(status_bubble), popup_(popup), @@ -152,7 +152,7 @@ class StatusBubble::StatusView : public ChromeViews::Label, StatusBubble* status_bubble_; // Handle to the HWND that contains us. - ChromeViews::ContainerWin* popup_; + views::ContainerWin* popup_; // The currently-displayed text. std::wstring text_; @@ -413,7 +413,7 @@ void StatusBubble::StatusView::Paint(ChromeCanvas* canvas) { int text_width = std::min(static_cast<int>(parent_rect.right - parent_rect.left - kTextPositionX - kTextPadding), - static_cast<int>(ChromeViews::Label::GetFont() + static_cast<int>(views::Label::GetFont() .GetStringWidth(text_))); // Draw highlight text and then the text body. In order to make sure the text @@ -425,7 +425,7 @@ void StatusBubble::StatusView::Paint(ChromeCanvas* canvas) { parent_rect.bottom - parent_rect.top); body_bounds.set_x(MirroredLeftPointForRect(body_bounds)); canvas->DrawStringInt(text_, - ChromeViews::Label::GetFont(), + views::Label::GetFont(), kTextHighlightColor, body_bounds.x() + 1, body_bounds.y() + 1, @@ -433,7 +433,7 @@ void StatusBubble::StatusView::Paint(ChromeCanvas* canvas) { body_bounds.height()); canvas->DrawStringInt(text_, - ChromeViews::Label::GetFont(), + views::Label::GetFont(), kTextColor, body_bounds.x(), body_bounds.y(), @@ -443,7 +443,7 @@ void StatusBubble::StatusView::Paint(ChromeCanvas* canvas) { // StatusBubble --------------------------------------------------------------- -StatusBubble::StatusBubble(ChromeViews::Container* frame) +StatusBubble::StatusBubble(views::Container* frame) : popup_(NULL), frame_(frame), view_(NULL), @@ -465,7 +465,7 @@ StatusBubble::~StatusBubble() { void StatusBubble::Init() { if (!popup_) { - popup_ = new ChromeViews::ContainerWin(); + popup_ = new views::ContainerWin(); popup_->set_delete_on_destroy(false); if (!view_) { @@ -566,7 +566,7 @@ void StatusBubble::AvoidMouse() { // Get the position of the frame. gfx::Point top_left; - ChromeViews::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); + views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); // Get the cursor position relative to the popup. cursor_location.x -= (top_left.x() + position_.x); @@ -620,7 +620,7 @@ void StatusBubble::AvoidMouse() { void StatusBubble::Reposition() { if (popup_) { gfx::Point top_left; - ChromeViews::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); + views::View::ConvertPointToScreen(frame_->GetRootView(), &top_left); popup_->MoveWindow(top_left.x() + position_.x, top_left.y() + position_.y, diff --git a/chrome/browser/views/status_bubble.h b/chrome/browser/views/status_bubble.h index 28d189c..981eda7 100644 --- a/chrome/browser/views/status_bubble.h +++ b/chrome/browser/views/status_bubble.h @@ -16,7 +16,7 @@ class GURL; // to allow users to see where hovered links point to. class StatusBubble { public: - explicit StatusBubble(ChromeViews::Container* frame); + explicit StatusBubble(views::Container* frame); ~StatusBubble(); // Sets the bubble contents to a specific string and causes the bubble @@ -74,10 +74,10 @@ class StatusBubble { // We use a HWND for the popup so that it may float above any HWNDs in our // UI (the location bar, for example). - ChromeViews::ContainerWin* popup_; + views::ContainerWin* popup_; double opacity_; - ChromeViews::Container* frame_; + views::Container* frame_; StatusView* view_; DISALLOW_EVIL_CONSTRUCTORS(StatusBubble); diff --git a/chrome/browser/views/tab_contents_container_view.cc b/chrome/browser/views/tab_contents_container_view.cc index a8ed55a..7a506fc 100644 --- a/chrome/browser/views/tab_contents_container_view.cc +++ b/chrome/browser/views/tab_contents_container_view.cc @@ -16,9 +16,9 @@ #include "chrome/views/container.h" #include "chrome/views/root_view.h" -using ChromeViews::FocusTraversable; -using ChromeViews::FocusManager; -using ChromeViews::View; +using views::FocusTraversable; +using views::FocusManager; +using views::View; TabContentsContainerView::TabContentsContainerView() : tab_contents_(NULL) { SetID(VIEW_ID_TAB_CONTAINER); @@ -46,7 +46,7 @@ void TabContentsContainerView::SetTabContents(TabContents* tab_contents) { FocusManager::UninstallFocusSubclass(hwnd); } - ChromeViews::RootView* root_view = tab_contents_->GetContentsRootView(); + views::RootView* root_view = tab_contents_->GetContentsRootView(); if (root_view) { // Unlink the RootViews as a clean-up. root_view->SetFocusTraversableParent(NULL); @@ -79,7 +79,7 @@ void TabContentsContainerView::SetTabContents(TabContents* tab_contents) { AddObservers(); - ChromeViews::RootView* root_view = tab_contents_->GetContentsRootView(); + views::RootView* root_view = tab_contents_->GetContentsRootView(); if (root_view) { // Link the RootViews for proper focus traversal (note that we skip the // TabContentsContainerView as it acts as a FocusTraversable proxy). @@ -88,7 +88,7 @@ void TabContentsContainerView::SetTabContents(TabContents* tab_contents) { } } -ChromeViews::FocusTraversable* TabContentsContainerView::GetFocusTraversable() { +views::FocusTraversable* TabContentsContainerView::GetFocusTraversable() { if (tab_contents_ && tab_contents_->GetContentsRootView()) return tab_contents_->GetContentsRootView(); return NULL; @@ -119,7 +119,7 @@ bool TabContentsContainerView::CanProcessTabKeyEvents() { return tab_contents_ && !tab_contents_->GetContentsRootView(); } -ChromeViews::FocusTraversable* +views::FocusTraversable* TabContentsContainerView::GetFocusTraversableParent() { if (tab_contents_ && tab_contents_->GetContentsRootView()) { // Since we link the RootView of the TabContents to the RootView that @@ -130,8 +130,7 @@ ChromeViews::FocusTraversable* return GetRootView(); } -ChromeViews::View* - TabContentsContainerView::GetFocusTraversableParentView() { +views::View* TabContentsContainerView::GetFocusTraversableParentView() { if (tab_contents_ && tab_contents_->GetContentsRootView()) { // Since we link the RootView of the TabContents to the RootView that // contains us, this should not be invoked. @@ -170,7 +169,7 @@ bool TabContentsContainerView::GetAccessibleRole(VARIANT* role) { } bool TabContentsContainerView::ShouldLookupAccelerators( - const ChromeViews::KeyEvent& e) { + const views::KeyEvent& e) { if (tab_contents_ && !tab_contents_->is_crashed() && tab_contents_->AsWebContents()) return false; diff --git a/chrome/browser/views/tab_contents_container_view.h b/chrome/browser/views/tab_contents_container_view.h index c904b73..46a1a9b 100644 --- a/chrome/browser/views/tab_contents_container_view.h +++ b/chrome/browser/views/tab_contents_container_view.h @@ -19,7 +19,7 @@ class TabContents; // This View contains the TabContents. // It takes care of linking the TabContents to the browser RootView so that the // focus can traverse from one to the other when pressing Tab/Shift-Tab. -class TabContentsContainerView : public ChromeViews::HWNDView, +class TabContentsContainerView : public views::HWNDView, public NotificationObserver { public: TabContentsContainerView(); @@ -30,7 +30,7 @@ class TabContentsContainerView : public ChromeViews::HWNDView, TabContents* GetTabContents() const { return tab_contents_; } // Overridden from View. - virtual ChromeViews::FocusTraversable* GetFocusTraversable(); + virtual views::FocusTraversable* GetFocusTraversable(); virtual bool IsFocusable() const; virtual void Focus(); virtual void RequestFocus(); @@ -38,8 +38,8 @@ class TabContentsContainerView : public ChromeViews::HWNDView, virtual bool CanProcessTabKeyEvents(); // Overridden from HWNDView. - virtual ChromeViews::FocusTraversable* GetFocusTraversableParent(); - virtual ChromeViews::View* GetFocusTraversableParentView(); + virtual views::FocusTraversable* GetFocusTraversableParent(); + virtual views::View* GetFocusTraversableParentView(); // NotificationObserver implementation. virtual void Observe(NotificationType type, @@ -54,7 +54,7 @@ class TabContentsContainerView : public ChromeViews::HWNDView, protected: // Web content should be given first crack at accelerators. This function // returns false if the current tab is a webcontents. - virtual bool ShouldLookupAccelerators(const ChromeViews::KeyEvent& e); + virtual bool ShouldLookupAccelerators(const views::KeyEvent& e); private: // Add or remove observers for events that we care about. diff --git a/chrome/browser/views/tab_icon_view.h b/chrome/browser/views/tab_icon_view.h index 304c224..11b22d4 100644 --- a/chrome/browser/views/tab_icon_view.h +++ b/chrome/browser/views/tab_icon_view.h @@ -14,7 +14,7 @@ class TabContents; // A view to display a tab fav icon or a throbber. // //////////////////////////////////////////////////////////////////////////////// -class TabIconView : public ChromeViews::View { +class TabIconView : public views::View { public: class TabContentsProvider { public: diff --git a/chrome/browser/views/tabs/dragged_tab_controller.cc b/chrome/browser/views/tabs/dragged_tab_controller.cc index cdbcd98..4f20e57 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.cc +++ b/chrome/browser/views/tabs/dragged_tab_controller.cc @@ -72,7 +72,7 @@ class WindowFinder { gfx::Point ConvertScreenPointToTabStripPoint(TabStrip* tabstrip, const gfx::Point& screen_point) { gfx::Point tabstrip_topleft; - ChromeViews::View::ConvertPointToScreen(tabstrip, &tabstrip_topleft); + views::View::ConvertPointToScreen(tabstrip, &tabstrip_topleft); return gfx::Point(screen_point.x() - tabstrip_topleft.x(), screen_point.y() - tabstrip_topleft.y()); } @@ -273,7 +273,7 @@ void DraggedTabController::DidProcessMessage(const MSG& msg) { void DraggedTabController::InitWindowCreatePoint() { window_create_point_.SetPoint(mouse_offset_.x(), mouse_offset_.y()); Tab* first_tab = attached_tabstrip_->GetTabAt(0); - ChromeViews::View::ConvertPointToContainer(first_tab, &window_create_point_); + views::View::ConvertPointToContainer(first_tab, &window_create_point_); } gfx::Point DraggedTabController::GetWindowCreatePoint() const { @@ -723,10 +723,9 @@ gfx::Point DraggedTabController::GetCursorScreenPoint() const { return gfx::Point(pt); } -gfx::Rect DraggedTabController::GetViewScreenBounds( - ChromeViews::View* view) const { +gfx::Rect DraggedTabController::GetViewScreenBounds(views::View* view) const { gfx::Point view_topleft; - ChromeViews::View::ConvertPointToScreen(view, &view_topleft); + views::View::ConvertPointToScreen(view, &view_topleft); gfx::Rect view_screen_bounds = view->GetLocalBounds(true); view_screen_bounds.Offset(view_topleft.x(), view_topleft.y()); return view_screen_bounds; diff --git a/chrome/browser/views/tabs/dragged_tab_controller.h b/chrome/browser/views/tabs/dragged_tab_controller.h index 5874661..041d2337 100644 --- a/chrome/browser/views/tabs/dragged_tab_controller.h +++ b/chrome/browser/views/tabs/dragged_tab_controller.h @@ -11,7 +11,7 @@ #include "chrome/browser/views/tabs/tab_renderer.h" #include "chrome/common/notification_service.h" -namespace ChromeViews { +namespace views { class MouseEvent; class View; } @@ -192,7 +192,7 @@ class DraggedTabController : public TabContentsDelegate, gfx::Point GetCursorScreenPoint() const; // Returns the bounds (in screen coordinates) of the specified View. - gfx::Rect GetViewScreenBounds(ChromeViews::View* tabstrip) const; + gfx::Rect GetViewScreenBounds(views::View* tabstrip) const; // Utility to convert the specified TabStripModel index to something valid // for the attached TabStrip. @@ -270,7 +270,7 @@ class DraggedTabController : public TabContentsDelegate, // The last view that had focus in the window containing |source_tab_|. This // is saved so that focus can be restored properly when a drag begins and // ends within this same window. - ChromeViews::View* old_focused_view_; + views::View* old_focused_view_; bool in_destructor_; diff --git a/chrome/browser/views/tabs/dragged_tab_view.cc b/chrome/browser/views/tabs/dragged_tab_view.cc index ecbcadc..6e1fbb1 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.cc +++ b/chrome/browser/views/tabs/dragged_tab_view.cc @@ -38,7 +38,7 @@ DraggedTabView::DraggedTabView(TabContents* datasource, renderer_->UpdateData(datasource); - container_ = new ChromeViews::ContainerWin; + container_ = new views::ContainerWin; container_->set_window_style(WS_POPUP); container_->set_window_ex_style( WS_EX_LAYERED | WS_EX_TOPMOST | WS_EX_TOOLWINDOW); @@ -138,7 +138,7 @@ void DraggedTabView::AnimationCanceled(const Animation* animation) { } /////////////////////////////////////////////////////////////////////////////// -// DraggedTabView, ChromeViews::View overrides: +// DraggedTabView, views::View overrides: void DraggedTabView::Paint(ChromeCanvas* canvas) { if (attached_) { diff --git a/chrome/browser/views/tabs/dragged_tab_view.h b/chrome/browser/views/tabs/dragged_tab_view.h index 0f4d626..6076acc 100644 --- a/chrome/browser/views/tabs/dragged_tab_view.h +++ b/chrome/browser/views/tabs/dragged_tab_view.h @@ -12,7 +12,7 @@ #include "chrome/views/view.h" #include "skia/include/SkBitmap.h" -namespace ChromeViews { +namespace views { class ContainerWin; } namespace gfx { @@ -23,7 +23,7 @@ class Tab; class TabContents; class TabRenderer; -class DraggedTabView : public ChromeViews::View, +class DraggedTabView : public views::View, public AnimationDelegate { public: DraggedTabView(TabContents* datasource, @@ -58,7 +58,7 @@ class DraggedTabView : public ChromeViews::View, virtual void AnimationEnded(const Animation* animation); virtual void AnimationCanceled(const Animation* animation); - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); virtual gfx::Size GetPreferredSize(); @@ -76,7 +76,7 @@ class DraggedTabView : public ChromeViews::View, int ScaleValue(int value); // The window that contains the DraggedTabView. - ChromeViews::ContainerWin* container_; + views::ContainerWin* container_; // The renderer that paints the Tab shape. scoped_ptr<TabRenderer> renderer_; diff --git a/chrome/browser/views/tabs/hwnd_photobooth.cc b/chrome/browser/views/tabs/hwnd_photobooth.cc index 5096565..052c4aa 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.cc +++ b/chrome/browser/views/tabs/hwnd_photobooth.cc @@ -143,7 +143,7 @@ void HWNDPhotobooth::CreateCaptureWindow(HWND initial_hwnd) { gfx::Point window_position = GetCaptureWindowPosition(); gfx::Rect capture_bounds(window_position.x(), window_position.y(), contents_rect.Width(), contents_rect.Height()); - capture_window_ = new ChromeViews::ContainerWin; + capture_window_ = new views::ContainerWin; capture_window_->set_window_style(WS_POPUP); // WS_EX_TOOLWINDOW ensures the capture window doesn't produce a Taskbar // button. diff --git a/chrome/browser/views/tabs/hwnd_photobooth.h b/chrome/browser/views/tabs/hwnd_photobooth.h index d3f79bb..e3fb423 100644 --- a/chrome/browser/views/tabs/hwnd_photobooth.h +++ b/chrome/browser/views/tabs/hwnd_photobooth.h @@ -9,7 +9,7 @@ #include "base/gfx/rect.h" class ChromeCanvas; -namespace ChromeViews { +namespace views { class ContainerWin; } @@ -50,7 +50,7 @@ class HWNDPhotobooth { void CreateCaptureWindow(HWND initial_hwnd); // The nearly off-screen photo-booth layered window used to hold the HWND. - ChromeViews::ContainerWin* capture_window_; + views::ContainerWin* capture_window_; // The current HWND being captured. HWND current_hwnd_; diff --git a/chrome/browser/views/tabs/tab.cc b/chrome/browser/views/tabs/tab.cc index a64a073..e170b76 100644 --- a/chrome/browser/views/tabs/tab.cc +++ b/chrome/browser/views/tabs/tab.cc @@ -20,12 +20,12 @@ static const SkScalar kTabCapWidth = 15; static const SkScalar kTabTopCurveWidth = 4; static const SkScalar kTabBottomCurveWidth = 3; -class TabContextMenuController : public ChromeViews::MenuDelegate { +class TabContextMenuController : public views::MenuDelegate { public: explicit TabContextMenuController(Tab* tab) : tab_(tab), last_command_(TabStripModel::CommandFirst) { - menu_.reset(new ChromeViews::MenuItemView(this)); + menu_.reset(new views::MenuItemView(this)); menu_->AppendMenuItemWithLabel(TabStripModel::CommandNewTab, l10n_util::GetString(IDS_TAB_CXMENU_NEWTAB)); menu_->AppendSeparator(); @@ -54,11 +54,11 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { void RunMenuAt(int x, int y) { menu_->RunMenuAt(tab_->GetContainer()->GetHWND(), gfx::Rect(x, y, 0, 0), - ChromeViews::MenuItemView::TOPLEFT, true); + views::MenuItemView::TOPLEFT, true); } private: - // ChromeViews::MenuDelegate implementation: + // views::MenuDelegate implementation: virtual bool IsCommandEnabled(int id) const { // The MenuItemView used to contain the contents of the Context Menu itself // has a command id of 0, and it will check to see if it's enabled for @@ -78,7 +78,7 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { tab_); } - virtual void SelectionChanged(ChromeViews::MenuItemView* menu) { + virtual void SelectionChanged(views::MenuItemView* menu) { TabStripModel::ContextMenuCommand command = static_cast<TabStripModel::ContextMenuCommand>(menu->GetCommand()); tab_->delegate()->StopHighlightTabsForCommand(last_command_, tab_); @@ -88,7 +88,7 @@ class TabContextMenuController : public ChromeViews::MenuDelegate { private: // The context menu. - scoped_ptr<ChromeViews::MenuItemView> menu_; + scoped_ptr<views::MenuItemView> menu_; // The Tab the context menu was brought up for. Tab* tab_; @@ -124,7 +124,7 @@ bool Tab::IsSelected() const { } /////////////////////////////////////////////////////////////////////////////// -// Tab, ChromeViews::View overrides: +// Tab, views::View overrides: bool Tab::HasHitTestMask() const { return true; @@ -134,7 +134,7 @@ void Tab::GetHitTestMask(gfx::Path* mask) const { MakePathForTab(mask); } -bool Tab::OnMousePressed(const ChromeViews::MouseEvent& event) { +bool Tab::OnMousePressed(const views::MouseEvent& event) { if (event.IsOnlyLeftMouseButton()) { // Store whether or not we were selected just now... we only want to be // able to drag foreground tabs, so we don't start dragging the tab if @@ -147,13 +147,12 @@ bool Tab::OnMousePressed(const ChromeViews::MouseEvent& event) { return true; } -bool Tab::OnMouseDragged(const ChromeViews::MouseEvent& event) { +bool Tab::OnMouseDragged(const views::MouseEvent& event) { delegate_->ContinueDrag(event); return true; } -void Tab::OnMouseReleased(const ChromeViews::MouseEvent& event, - bool canceled) { +void Tab::OnMouseReleased(const views::MouseEvent& event, bool canceled) { // Notify the drag helper that we're done with any potential drag operations. // Clean up the drag helper, which is re-created on the next mouse press. delegate_->EndDrag(canceled); @@ -177,7 +176,7 @@ bool Tab::GetTooltipText(int x, int y, std::wstring* tooltip) { bool Tab::GetTooltipTextOrigin(int x, int y, CPoint* origin) { ChromeFont font; origin->x = title_bounds().x() + 10; - origin->y = -ChromeViews::TooltipManager::GetTooltipHeight() - 4; + origin->y = -views::TooltipManager::GetTooltipHeight() - 4; return true; } @@ -195,9 +194,9 @@ bool Tab::GetAccessibleName(std::wstring* name) { } /////////////////////////////////////////////////////////////////////////////// -// Tab, ChromeViews::ContextMenuController implementation: +// Tab, views::ContextMenuController implementation: -void Tab::ShowContextMenu(ChromeViews::View* source, int x, int y, +void Tab::ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture) { TabContextMenuController controller(this); controller.RunMenuAt(x, y); @@ -205,9 +204,9 @@ void Tab::ShowContextMenu(ChromeViews::View* source, int x, int y, /////////////////////////////////////////////////////////////////////////////// -// ChromeViews::BaseButton::ButtonListener implementation: +// views::BaseButton::ButtonListener implementation: -void Tab::ButtonPressed(ChromeViews::BaseButton* sender) { +void Tab::ButtonPressed(views::BaseButton* sender) { if (sender == close_button()) delegate_->CloseTab(this); } diff --git a/chrome/browser/views/tabs/tab.h b/chrome/browser/views/tabs/tab.h index 369a39d..5534e82 100644 --- a/chrome/browser/views/tabs/tab.h +++ b/chrome/browser/views/tabs/tab.h @@ -24,8 +24,8 @@ class Profile; // /////////////////////////////////////////////////////////////////////////////// class Tab : public TabRenderer, - public ChromeViews::ContextMenuController, - public ChromeViews::BaseButton::ButtonListener { + public views::ContextMenuController, + public views::BaseButton::ButtonListener { public: static const std::string kTabClassName; @@ -60,11 +60,10 @@ class Tab : public TabRenderer, virtual void StopAllHighlighting() = 0; // Potentially starts a drag for the specified Tab. - virtual void MaybeStartDrag(Tab* tab, - const ChromeViews::MouseEvent& event) = 0; + virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event) = 0; // Continues dragging a Tab. - virtual void ContinueDrag(const ChromeViews::MouseEvent& event) = 0; + virtual void ContinueDrag(const views::MouseEvent& event) = 0; // Ends dragging a Tab. |canceled| is true if the drag was aborted in a way // other than the user releasing the mouse. @@ -85,12 +84,12 @@ class Tab : public TabRenderer, virtual bool IsSelected() const; private: - // ChromeViews::View overrides: + // views::View overrides: virtual bool HasHitTestMask() const; virtual void GetHitTestMask(gfx::Path* mask) const; - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event); - virtual bool OnMouseDragged(const ChromeViews::MouseEvent& event); - virtual void OnMouseReleased(const ChromeViews::MouseEvent& event, + virtual bool OnMousePressed(const views::MouseEvent& event); + virtual bool OnMouseDragged(const views::MouseEvent& event); + virtual void OnMouseReleased(const views::MouseEvent& event, bool canceled); virtual bool GetTooltipText(int x, int y, std::wstring* tooltip); virtual bool GetTooltipTextOrigin(int x, int y, CPoint* origin); @@ -98,14 +97,14 @@ class Tab : public TabRenderer, virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); - // ChromeViews::ContextMenuController overrides: - virtual void ShowContextMenu(ChromeViews::View* source, + // views::ContextMenuController overrides: + virtual void ShowContextMenu(views::View* source, int x, int y, bool is_mouse_gesture); - // ChromeViews::BaseButton::ButtonListener overrides: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // views::BaseButton::ButtonListener overrides: + virtual void ButtonPressed(views::BaseButton* sender); // Creates a path that contains the clickable region of the tab's visual // representation. Used by GetViewForPoint for hit-testing. diff --git a/chrome/browser/views/tabs/tab_dragging_test.cc b/chrome/browser/views/tabs/tab_dragging_test.cc index 631a0f0..642d34f 100644 --- a/chrome/browser/views/tabs/tab_dragging_test.cc +++ b/chrome/browser/views/tabs/tab_dragging_test.cc @@ -113,7 +113,7 @@ TEST_F(TabDraggingTest, Tab1Tab2) { end.x = start.x + 2*bounds1.width()/3; end.y = start.y; ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -217,7 +217,7 @@ TEST_F(TabDraggingTest, Tab1Tab3) { end.x = start.x + bounds1.width()/2 + bounds2.width() + bounds3.width()/2; end.y = start.y; ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now check for expected results. @@ -331,7 +331,7 @@ TEST_F(TabDraggingTest, Tab1Tab3Escape) { // Simulate drag with 'true' as the last parameter. This will interrupt // in-flight with Escape. ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, true)); // Now check for expected results. @@ -457,7 +457,7 @@ TEST_F(TabDraggingTest, Tab2OutOfTabStrip) { // Simulate tab drag. ASSERT_TRUE(browser->SimulateDrag(start, end, - ChromeViews::Event::EF_LEFT_BUTTON_DOWN, + views::Event::EF_LEFT_BUTTON_DOWN, false)); // Now, first make sure that the old window has only two tabs remaining. diff --git a/chrome/browser/views/tabs/tab_renderer.cc b/chrome/browser/views/tabs/tab_renderer.cc index 99548a0..f1d00b3 100644 --- a/chrome/browser/views/tabs/tab_renderer.cc +++ b/chrome/browser/views/tabs/tab_renderer.cc @@ -164,24 +164,24 @@ int GetContentHeight() { // // This is a Button subclass that causes middle clicks to be forwarded to the // parent View by explicitly not handling them in OnMousePressed. -class TabCloseButton : public ChromeViews::Button { +class TabCloseButton : public views::Button { public: TabCloseButton() : Button() {} virtual ~TabCloseButton() {} - virtual bool OnMousePressed(const ChromeViews::MouseEvent& event) { + virtual bool OnMousePressed(const views::MouseEvent& event) { return !event.IsOnlyMiddleMouseButton(); } // We need to let the parent know about mouse state so that it // can highlight itself appropriately. Note that Exit events // fire before Enter events, so this works. - virtual void OnMouseEntered(const ChromeViews::MouseEvent& event) { + virtual void OnMouseEntered(const views::MouseEvent& event) { BaseButton::OnMouseEntered(event); GetParent()->OnMouseEntered(event); } - virtual void OnMouseExited(const ChromeViews::MouseEvent& event) { + virtual void OnMouseExited(const views::MouseEvent& event) { BaseButton::OnMouseExited(event); GetParent()->OnMouseExited(event); } @@ -247,9 +247,9 @@ TabRenderer::TabRenderer() // Add the Close Button. close_button_ = new TabCloseButton; - close_button_->SetImage(ChromeViews::Button::BS_NORMAL, close_button_n); - close_button_->SetImage(ChromeViews::Button::BS_HOT, close_button_h); - close_button_->SetImage(ChromeViews::Button::BS_PUSHED, close_button_p); + close_button_->SetImage(views::Button::BS_NORMAL, close_button_n); + close_button_->SetImage(views::Button::BS_HOT, close_button_h); + close_button_->SetImage(views::Button::BS_PUSHED, close_button_p); AddChildView(close_button_); hover_animation_.reset(new SlideAnimation(this)); @@ -364,7 +364,7 @@ std::wstring TabRenderer::GetTitle() const { } //////////////////////////////////////////////////////////////////////////////// -// TabRenderer, ChromeViews::View overrides: +// TabRenderer, views::View overrides: void TabRenderer::Paint(ChromeCanvas* canvas) { // Don't paint if we're narrower than we can render correctly. (This should @@ -507,8 +507,8 @@ void TabRenderer::Layout() { // are not represented as child Views (which is the preferred method). // Instead, these UI elements are drawn directly on the canvas from within // Tab::Paint(). The Tab's child Views (for example, the Tab's close button - // which is a ChromeViews::Button instance) are automatically mirrored by the - // mirroring infrastructure in ChromeViews. The elements Tab draws directly + // which is a views::Button instance) are automatically mirrored by the + // mirroring infrastructure in views. The elements Tab draws directly // on the canvas need to be manually mirrored if the View's layout is // right-to-left. favicon_bounds_.set_x(MirroredLeftPointForRect(favicon_bounds_)); @@ -516,12 +516,12 @@ void TabRenderer::Layout() { download_icon_bounds_.set_x(MirroredLeftPointForRect(download_icon_bounds_)); } -void TabRenderer::OnMouseEntered(const ChromeViews::MouseEvent& e) { +void TabRenderer::OnMouseEntered(const views::MouseEvent& e) { hover_animation_->SetTweenType(SlideAnimation::EASE_OUT); hover_animation_->Show(); } -void TabRenderer::OnMouseExited(const ChromeViews::MouseEvent& e) { +void TabRenderer::OnMouseExited(const views::MouseEvent& e) { hover_animation_->SetTweenType(SlideAnimation::EASE_IN); hover_animation_->Hide(); } diff --git a/chrome/browser/views/tabs/tab_renderer.h b/chrome/browser/views/tabs/tab_renderer.h index a956b1b..9cad816 100644 --- a/chrome/browser/views/tabs/tab_renderer.h +++ b/chrome/browser/views/tabs/tab_renderer.h @@ -22,7 +22,7 @@ class TabContents; // A View that renders a Tab, either in a TabStrip or in a DraggedTabView. // /////////////////////////////////////////////////////////////////////////////// -class TabRenderer : public ChromeViews::View, +class TabRenderer : public views::View, public AnimationDelegate { public: // Possible animation states. @@ -64,18 +64,18 @@ class TabRenderer : public ChromeViews::View, static gfx::Size GetStandardSize(); protected: - ChromeViews::Button* close_button() const { return close_button_; } + views::Button* close_button() const { return close_button_; } const gfx::Rect& title_bounds() const { return title_bounds_; } // Returns the title of the Tab. std::wstring GetTitle() const; private: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual void Paint(ChromeCanvas* canvas); virtual void Layout(); - virtual void OnMouseEntered(const ChromeViews::MouseEvent& event); - virtual void OnMouseExited(const ChromeViews::MouseEvent& event); + virtual void OnMouseEntered(const views::MouseEvent& event); + virtual void OnMouseExited(const views::MouseEvent& event); // Overridden from AnimationDelegate: virtual void AnimationProgressed(const Animation* animation); @@ -124,7 +124,7 @@ class TabRenderer : public ChromeViews::View, int animation_frame_; // Close Button. - ChromeViews::Button* close_button_; + views::Button* close_button_; // Hover animation. scoped_ptr<SlideAnimation> hover_animation_; diff --git a/chrome/browser/views/tabs/tab_strip.cc b/chrome/browser/views/tabs/tab_strip.cc index f487074..72f7d28 100644 --- a/chrome/browser/views/tabs/tab_strip.cc +++ b/chrome/browser/views/tabs/tab_strip.cc @@ -32,7 +32,7 @@ #undef min #undef max -using ChromeViews::DropTargetEvent; +using views::DropTargetEvent; static const int kDefaultAnimationDurationMs = 100; static const int kResizeLayoutAnimationDurationMs = 166; @@ -60,13 +60,13 @@ static inline int Round(double x) { // // A subclass of button that hit-tests to the shape of the new tab button. -class NewTabButton : public ChromeViews::Button { +class NewTabButton : public views::Button { public: NewTabButton() {} virtual ~NewTabButton() {} protected: - // Overridden from ChromeViews::View: + // Overridden from views::View: virtual bool HasHitTestMask() const { return true; } @@ -355,7 +355,7 @@ class RemoveTabAnimation : public TabStrip::TabAnimation { POINT pt; GetCursorPos(&pt); - ChromeViews::Container* vc = tabstrip_->GetContainer(); + views::Container* vc = tabstrip_->GetContainer(); RECT wr; GetWindowRect(vc->GetHWND(), &wr); pt.x -= wr.left; @@ -526,7 +526,7 @@ bool TabStrip::CanProcessInputEvents() const { } bool TabStrip::PointIsWithinWindowCaption(const gfx::Point& point) { - ChromeViews::View* v = GetViewForPoint(point); + views::View* v = GetViewForPoint(point); // If there is no control at this location, claim the hit was in the title // bar to get a move action. @@ -596,7 +596,7 @@ gfx::Rect TabStrip::GetIdealBounds(int index) { } /////////////////////////////////////////////////////////////////////////////// -// TabStrip, ChromeViews::View overrides: +// TabStrip, views::View overrides: void TabStrip::PaintChildren(ChromeCanvas* canvas) { // Paint the tabs in reverse order, so they stack to the left. @@ -634,7 +634,7 @@ void TabStrip::PaintChildren(ChromeCanvas* canvas) { } // Overridden to support automation. See automation_proxy_uitest.cc. -ChromeViews::View* TabStrip::GetViewByID(int view_id) const { +views::View* TabStrip::GetViewByID(int view_id) const { if (GetTabCount() > 0) { if (view_id == VIEW_ID_TAB_LAST) { return GetTabAt(GetTabCount() - 1); @@ -742,15 +742,15 @@ void TabStrip::SetAccessibleName(const std::wstring& name) { accessible_name_.assign(name); } -ChromeViews::View* TabStrip::GetViewForPoint(const gfx::Point& point) { +views::View* TabStrip::GetViewForPoint(const gfx::Point& point) { return GetViewForPoint(point, false); } -ChromeViews::View* TabStrip::GetViewForPoint(const gfx::Point& point, - bool can_create_floating) { +views::View* TabStrip::GetViewForPoint(const gfx::Point& point, + bool can_create_floating) { // Return any view that isn't a Tab or this TabStrip immediately. We don't // want to interfere. - ChromeViews::View* v = View::GetViewForPoint(point, can_create_floating); + views::View* v = View::GetViewForPoint(point, can_create_floating); if (v && v != this && v->GetClassName() != Tab::kTabClassName) return v; @@ -1004,7 +1004,7 @@ void TabStrip::StopAllHighlighting() { GetTabAt(i)->StopPulse(); } -void TabStrip::MaybeStartDrag(Tab* tab, const ChromeViews::MouseEvent& event) { +void TabStrip::MaybeStartDrag(Tab* tab, const views::MouseEvent& event) { // Don't accidentally start any drag operations during animations if the // mouse is down... during an animation tabs are being resized automatically, // so the View system can misinterpret this easily if the mouse is down that @@ -1015,7 +1015,7 @@ void TabStrip::MaybeStartDrag(Tab* tab, const ChromeViews::MouseEvent& event) { drag_controller_->CaptureDragInfo(gfx::Point(event.x(), event.y())); } -void TabStrip::ContinueDrag(const ChromeViews::MouseEvent& event) { +void TabStrip::ContinueDrag(const views::MouseEvent& event) { // We can get called even if |MaybeStartDrag| wasn't called in the event of // a TabStrip animation when the mouse button is down. In this case we should // _not_ continue the drag because it can lead to weird bugs. @@ -1029,9 +1029,9 @@ void TabStrip::EndDrag(bool canceled) { } /////////////////////////////////////////////////////////////////////////////// -// TabStrip, ChromeViews::BaseButton::ButtonListener implementation: +// TabStrip, views::BaseButton::ButtonListener implementation: -void TabStrip::ButtonPressed(ChromeViews::BaseButton* sender) { +void TabStrip::ButtonPressed(views::BaseButton* sender) { if (sender == newtab_button_) model_->AddBlankTab(true); } @@ -1101,10 +1101,10 @@ void TabStrip::Init() { SkBitmap* bitmap; bitmap = rb.GetBitmapNamed(IDR_NEWTAB_BUTTON); - newtab_button_->SetImage(ChromeViews::Button::BS_NORMAL, bitmap); - newtab_button_->SetImage(ChromeViews::Button::BS_PUSHED, + newtab_button_->SetImage(views::Button::BS_NORMAL, bitmap); + newtab_button_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_P)); - newtab_button_->SetImage(ChromeViews::Button::BS_HOT, + newtab_button_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_NEWTAB_BUTTON_H)); newtab_button_size_.SetSize(bitmap->width(), bitmap->height()); @@ -1375,7 +1375,7 @@ void TabStrip::SetDropIndex(int index, bool drop_before) { drop_bounds.height(), SWP_NOACTIVATE | SWP_SHOWWINDOW); } -int TabStrip::GetDropEffect(const ChromeViews::DropTargetEvent& event) { +int TabStrip::GetDropEffect(const views::DropTargetEvent& event) { const int source_ops = event.GetSourceOperations(); if (source_ops & DragDropTypes::DRAG_COPY) return DragDropTypes::DRAG_COPY; @@ -1396,12 +1396,12 @@ TabStrip::DropInfo::DropInfo(int drop_index, bool drop_before, bool point_down) : drop_index(drop_index), drop_before(drop_before), point_down(point_down) { - arrow_window = new ChromeViews::ContainerWin(); + arrow_window = new views::ContainerWin; arrow_window->set_window_style(WS_POPUP); arrow_window->set_window_ex_style(WS_EX_TOPMOST | WS_EX_NOACTIVATE | WS_EX_LAYERED | WS_EX_TRANSPARENT); - arrow_view = new ChromeViews::ImageView; + arrow_view = new views::ImageView; arrow_view->SetImage(GetDropArrowImage(point_down)); arrow_window->Init( diff --git a/chrome/browser/views/tabs/tab_strip.h b/chrome/browser/views/tabs/tab_strip.h index 3f464a8..3b96279e 100644 --- a/chrome/browser/views/tabs/tab_strip.h +++ b/chrome/browser/views/tabs/tab_strip.h @@ -17,7 +17,7 @@ class DraggedTabController; class ScopedMouseCloseWidthCalculator; class TabStripModel; -namespace ChromeViews { +namespace views { class ImageView; } @@ -34,10 +34,10 @@ class ImageView; // in response to dragged tabs. // /////////////////////////////////////////////////////////////////////////////// -class TabStrip : public ChromeViews::View, +class TabStrip : public views::View, public TabStripModelObserver, public Tab::TabDelegate, - public ChromeViews::Button::ButtonListener, + public views::Button::ButtonListener, public MessageLoopForUI::Observer { public: TabStrip(TabStripModel* model); @@ -96,23 +96,23 @@ class TabStrip : public ChromeViews::View, // Retrieve the ideal bounds for the Tab at the specified index. gfx::Rect GetIdealBounds(int index); - // ChromeViews::View overrides: + // views::View overrides: virtual void PaintChildren(ChromeCanvas* canvas); - virtual ChromeViews::View* GetViewByID(int id) const; + virtual views::View* GetViewByID(int id) const; virtual void Layout(); virtual gfx::Size GetPreferredSize(); // NOTE: the drag and drop methods are invoked from FrameView. This is done to // allow for a drop region that extends outside the bounds of the TabStrip. - virtual void OnDragEntered(const ChromeViews::DropTargetEvent& event); - virtual int OnDragUpdated(const ChromeViews::DropTargetEvent& event); + virtual void OnDragEntered(const views::DropTargetEvent& event); + virtual int OnDragUpdated(const views::DropTargetEvent& event); virtual void OnDragExited(); - virtual int OnPerformDrop(const ChromeViews::DropTargetEvent& event); + virtual int OnPerformDrop(const views::DropTargetEvent& event); virtual bool GetAccessibleRole(VARIANT* role); virtual bool GetAccessibleName(std::wstring* name); virtual void SetAccessibleName(const std::wstring& name); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point); - virtual ChromeViews::View* GetViewForPoint(const gfx::Point& point, - bool can_create_floating); + virtual views::View* GetViewForPoint(const gfx::Point& point); + virtual views::View* GetViewForPoint(const gfx::Point& point, + bool can_create_floating); protected: // TabStripModelObserver implementation: @@ -141,13 +141,12 @@ class TabStrip : public ChromeViews::View, virtual void StopHighlightTabsForCommand( TabStripModel::ContextMenuCommand command_id, Tab* tab); virtual void StopAllHighlighting(); - virtual void MaybeStartDrag(Tab* tab, - const ChromeViews::MouseEvent& event); - virtual void ContinueDrag(const ChromeViews::MouseEvent& event); + virtual void MaybeStartDrag(Tab* tab, const views::MouseEvent& event); + virtual void ContinueDrag(const views::MouseEvent& event); virtual void EndDrag(bool canceled); - // ChromeViews::Button::ButtonListener implementation: - virtual void ButtonPressed(ChromeViews::BaseButton* sender); + // views::Button::ButtonListener implementation: + virtual void ButtonPressed(views::BaseButton* sender); // MessageLoop::Observer implementation: virtual void WillProcessMessage(const MSG& msg); @@ -220,14 +219,14 @@ class TabStrip : public ChromeViews::View, gfx::Rect GetDropBounds(int drop_index, bool drop_before, bool* is_beneath); // Updates the location of the drop based on the event. - void UpdateDropIndex(const ChromeViews::DropTargetEvent& event); + void UpdateDropIndex(const views::DropTargetEvent& event); // Sets the location of the drop, repainting as necessary. void SetDropIndex(int index, bool drop_before); // Returns the drop effect for dropping a URL on the tab strip. This does // not query the data in anyway, it only looks at the source operations. - int GetDropEffect(const ChromeViews::DropTargetEvent& event); + int GetDropEffect(const views::DropTargetEvent& event); // Returns the image to use for indicating a drop on a tab. If is_down is // true, this returns an arrow pointing down. @@ -299,7 +298,7 @@ class TabStrip : public ChromeViews::View, base::RepeatingTimer<TabStrip> loading_animation_timer_; // The "New Tab" button. - ChromeViews::Button* newtab_button_; + views::Button* newtab_button_; gfx::Size newtab_button_size_; gfx::Size actual_newtab_button_size_; @@ -341,8 +340,8 @@ class TabStrip : public ChromeViews::View, bool point_down; // Renders the drop indicator. - ChromeViews::ContainerWin* arrow_window; - ChromeViews::ImageView* arrow_view; + views::ContainerWin* arrow_window; + views::ImageView* arrow_view; private: DISALLOW_EVIL_CONSTRUCTORS(DropInfo); diff --git a/chrome/browser/views/toolbar_star_toggle.cc b/chrome/browser/views/toolbar_star_toggle.cc index 050fc02..a44ebac 100644 --- a/chrome/browser/views/toolbar_star_toggle.cc +++ b/chrome/browser/views/toolbar_star_toggle.cc @@ -38,7 +38,7 @@ void ToolbarStarToggle::ShowStarBubble(const GURL& url, bool newly_bookmarked) { } gfx::Point star_location; - ChromeViews::View::ConvertPointToScreen(this, &star_location); + views::View::ConvertPointToScreen(this, &star_location); // Shift the x location by 1 as visually the center of the star appears 1 // pixel to the right. By doing this bubble arrow points to the center // of the star. @@ -49,13 +49,13 @@ void ToolbarStarToggle::ShowStarBubble(const GURL& url, bool newly_bookmarked) { is_bubble_showing_ = true; } -bool ToolbarStarToggle::OnMousePressed(const ChromeViews::MouseEvent& e) { +bool ToolbarStarToggle::OnMousePressed(const views::MouseEvent& e) { ignore_click_ = ((TimeTicks::Now() - bubble_closed_time_).InMilliseconds() < kDisallowClickMS); return ToggleButton::OnMousePressed(e); } -void ToolbarStarToggle::OnMouseReleased(const ChromeViews::MouseEvent& e, +void ToolbarStarToggle::OnMouseReleased(const views::MouseEvent& e, bool canceled) { ToggleButton::OnMouseReleased(e, canceled); ignore_click_ = false; diff --git a/chrome/browser/views/toolbar_star_toggle.h b/chrome/browser/views/toolbar_star_toggle.h index 320fa0b..5f829cb 100644 --- a/chrome/browser/views/toolbar_star_toggle.h +++ b/chrome/browser/views/toolbar_star_toggle.h @@ -16,7 +16,7 @@ class GURL; // user to star the current page. ToolbarStarToggle manages showing the // InfoBubble and rendering the appropriate state while the bubble is visible. -class ToolbarStarToggle : public ChromeViews::ToggleButton, +class ToolbarStarToggle : public views::ToggleButton, public InfoBubbleDelegate { public: explicit ToolbarStarToggle(BrowserToolbarView* host); @@ -28,11 +28,10 @@ class ToolbarStarToggle : public ChromeViews::ToggleButton, // Overridden to update ignore_click_ based on whether the mouse was clicked // quickly after the bubble was hidden. - virtual bool OnMousePressed(const ChromeViews::MouseEvent& e); + virtual bool OnMousePressed(const views::MouseEvent& e); // Overridden to set ignore_click_ to false. - virtual void OnMouseReleased(const ChromeViews::MouseEvent& e, - bool canceled); + virtual void OnMouseReleased(const views::MouseEvent& e, bool canceled); virtual void OnDragDone(); // Only invokes super if ignore_click_ is true and the bubble isn't showing. diff --git a/chrome/browser/views/toolbar_view.cc b/chrome/browser/views/toolbar_view.cc index 0554b06..a7f26e3 100644 --- a/chrome/browser/views/toolbar_view.cc +++ b/chrome/browser/views/toolbar_view.cc @@ -111,29 +111,23 @@ void BrowserToolbarView::SetProfile(Profile* profile) { void BrowserToolbarView::CreateLeftSideControls() { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - back_ = new ChromeViews::ButtonDropDown(back_menu_model_.get()); - back_->SetImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_BACK)); - back_->SetImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_BACK_H)); - back_->SetImage(ChromeViews::Button::BS_PUSHED, - rb.GetBitmapNamed(IDR_BACK_P)); - back_->SetImage(ChromeViews::Button::BS_DISABLED, - rb.GetBitmapNamed(IDR_BACK_D)); + back_ = new views::ButtonDropDown(back_menu_model_.get()); + back_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_BACK)); + back_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_BACK_H)); + back_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_BACK_P)); + back_->SetImage(views::Button::BS_DISABLED, rb.GetBitmapNamed(IDR_BACK_D)); back_->SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_BACK)); back_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_BACK)); back_->SetID(VIEW_ID_BACK_BUTTON); AddChildView(back_); controller_->AddManagedButton(back_, IDC_BACK); - forward_ = new ChromeViews::ButtonDropDown(forward_menu_model_.get()); - forward_->SetImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_FORWARD)); - forward_->SetImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_FORWARD_H)); - forward_->SetImage(ChromeViews::Button::BS_PUSHED, + forward_ = new views::ButtonDropDown(forward_menu_model_.get()); + forward_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_FORWARD)); + forward_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_FORWARD_H)); + forward_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_FORWARD_P)); - forward_->SetImage(ChromeViews::Button::BS_DISABLED, + forward_->SetImage(views::Button::BS_DISABLED, rb.GetBitmapNamed(IDR_FORWARD_D)); forward_->SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_FORWARD)); forward_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_FORWARD)); @@ -141,26 +135,20 @@ void BrowserToolbarView::CreateLeftSideControls() { AddChildView(forward_); controller_->AddManagedButton(forward_, IDC_FORWARD); - reload_ = new ChromeViews::Button(); - reload_->SetImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_RELOAD)); - reload_->SetImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_RELOAD_H)); - reload_->SetImage(ChromeViews::Button::BS_PUSHED, - rb.GetBitmapNamed(IDR_RELOAD_P)); + reload_ = new views::Button(); + reload_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_RELOAD)); + reload_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_RELOAD_H)); + reload_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_RELOAD_P)); reload_->SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_RELOAD)); reload_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_RELOAD)); reload_->SetID(VIEW_ID_RELOAD_BUTTON); AddChildView(reload_); controller_->AddManagedButton(reload_, IDC_RELOAD); - home_ = new ChromeViews::Button(); - home_->SetImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_HOME)); - home_->SetImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_HOME_H)); - home_->SetImage(ChromeViews::Button::BS_PUSHED, - rb.GetBitmapNamed(IDR_HOME_P)); + home_ = new views::Button(); + home_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_HOME)); + home_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_HOME_H)); + home_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_HOME_P)); home_->SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_HOME)); home_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_HOME)); AddChildView(home_); @@ -171,19 +159,15 @@ void BrowserToolbarView::CreateCenterStack(Profile *profile) { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); star_ = new ToolbarStarToggle(this); - star_->SetImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_STAR)); - star_->SetImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_STAR_H)); - star_->SetImage(ChromeViews::Button::BS_PUSHED, - rb .GetBitmapNamed(IDR_STAR_P)); - star_->SetImage(ChromeViews::Button::BS_DISABLED, - rb .GetBitmapNamed(IDR_STAR_D)); - star_->SetToggledImage(ChromeViews::Button::BS_NORMAL, + star_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_STAR)); + star_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_STAR_H)); + star_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_STAR_P)); + star_->SetImage(views::Button::BS_DISABLED, rb.GetBitmapNamed(IDR_STAR_D)); + star_->SetToggledImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_STARRED)); - star_->SetToggledImage(ChromeViews::Button::BS_HOT, + star_->SetToggledImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_STARRED_H)); - star_->SetToggledImage(ChromeViews::Button::BS_PUSHED, + star_->SetToggledImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_STARRED_P)); star_->SetDragController(this); star_->SetTooltipText(l10n_util::GetString(IDS_TOOLTIP_STAR)); @@ -200,14 +184,12 @@ void BrowserToolbarView::CreateCenterStack(Profile *profile) { // The Go button. go_ = new GoButton(location_bar_, controller_); - go_->SetImage(ChromeViews::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_GO)); - go_->SetImage(ChromeViews::Button::BS_HOT, rb.GetBitmapNamed(IDR_GO_H)); - go_->SetImage(ChromeViews::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_GO_P)); - go_->SetToggledImage(ChromeViews::Button::BS_NORMAL, - rb.GetBitmapNamed(IDR_STOP)); - go_->SetToggledImage(ChromeViews::Button::BS_HOT, - rb.GetBitmapNamed(IDR_STOP_H)); - go_->SetToggledImage(ChromeViews::Button::BS_PUSHED, + go_->SetImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_GO)); + go_->SetImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_GO_H)); + go_->SetImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_GO_P)); + go_->SetToggledImage(views::Button::BS_NORMAL, rb.GetBitmapNamed(IDR_STOP)); + go_->SetToggledImage(views::Button::BS_HOT, rb.GetBitmapNamed(IDR_STOP_H)); + go_->SetToggledImage(views::Button::BS_PUSHED, rb.GetBitmapNamed(IDR_STOP_P)); go_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_GO)); go_->SetID(VIEW_ID_GO_BUTTON); @@ -234,8 +216,7 @@ void BrowserToolbarView::OnInputInProgress(bool in_progress) { void BrowserToolbarView::CreateRightSideControls(Profile* profile) { ResourceBundle &rb = ResourceBundle::GetSharedInstance(); - page_menu_ = - new ChromeViews::MenuButton(std::wstring(), this, false); + page_menu_ = new views::MenuButton(std::wstring(), this, false); // We use different menu button images if the locale is right-to-left. if (UILayoutIsRightToLeft()) @@ -248,7 +229,7 @@ void BrowserToolbarView::CreateRightSideControls(Profile* profile) { page_menu_->SetID(VIEW_ID_PAGE_MENU); AddChildView(page_menu_); - app_menu_ = new ChromeViews::MenuButton(std::wstring(), this, false); + app_menu_ = new views::MenuButton(std::wstring(), this, false); if (UILayoutIsRightToLeft()) app_menu_->SetIcon(*rb.GetBitmapNamed(IDR_MENU_CHROME_RTL)); else @@ -385,7 +366,7 @@ void BrowserToolbarView::WillLoseFocus() { acc_focused_view_ = NULL; } -bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { +bool BrowserToolbarView::OnKeyPressed(const views::KeyEvent& e) { // Paranoia check, button should be initialized upon toolbar gaining focus. if (!acc_focused_view_) return false; @@ -410,7 +391,7 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { if (GetContainer()->GetTooltipManager()) GetContainer()->GetTooltipManager()->HideKeyboardTooltip(); // Safe to cast, given to above view id check. - static_cast<ChromeViews::MenuButton*>(acc_focused_view_)->Activate(); + static_cast<views::MenuButton*>(acc_focused_view_)->Activate(); if (!acc_focused_view_) { // Activate triggered a focus change, don't try to change focus. return true; @@ -456,7 +437,7 @@ bool BrowserToolbarView::OnKeyPressed(const ChromeViews::KeyEvent& e) { return false; } -bool BrowserToolbarView::OnKeyReleased(const ChromeViews::KeyEvent& e) { +bool BrowserToolbarView::OnKeyReleased(const views::KeyEvent& e) { // Paranoia check, button should be initialized upon toolbar gaining focus. if (!acc_focused_view_) return false; @@ -595,8 +576,7 @@ bool BrowserToolbarView::IsItemChecked(int id) const { return EncodingMenuControllerDelegate::IsItemChecked(id); } -void BrowserToolbarView::RunMenu(ChromeViews::View* source, - const CPoint& pt, +void BrowserToolbarView::RunMenu(views::View* source, const CPoint& pt, HWND hwnd) { switch (source->GetID()) { case VIEW_ID_PAGE_MENU: @@ -658,9 +638,7 @@ int BrowserToolbarView::GetNextAccessibleViewIndex(int view_index, return view_index; } -int BrowserToolbarView::GetDragOperations(ChromeViews::View* sender, - int x, - int y) { +int BrowserToolbarView::GetDragOperations(views::View* sender, int x, int y) { DCHECK(sender == star_); if (model_->input_in_progress() || !tab_ || !tab_->ShouldDisplayURL() || !tab_->GetURL().is_valid()) { @@ -674,7 +652,7 @@ int BrowserToolbarView::GetDragOperations(ChromeViews::View* sender, return DragDropTypes::DRAG_COPY | DragDropTypes::DRAG_LINK; } -void BrowserToolbarView::WriteDragData(ChromeViews::View* sender, +void BrowserToolbarView::WriteDragData(views::View* sender, int press_x, int press_y, OSExchangeData* data) { @@ -716,19 +694,19 @@ void BrowserToolbarView::Observe(NotificationType type, } bool BrowserToolbarView::GetAcceleratorInfo(int id, - ChromeViews::Accelerator* accel) { + views::Accelerator* accel) { // 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. switch (id) { case IDC_CUT: - *accel = ChromeViews::Accelerator(L'X', false, true, false); + *accel = views::Accelerator(L'X', false, true, false); return true; case IDC_COPY: - *accel = ChromeViews::Accelerator(L'C', false, true, false); + *accel = views::Accelerator(L'C', false, true, false); return true; case IDC_PASTE: - *accel = ChromeViews::Accelerator(L'V', false, true, false); + *accel = views::Accelerator(L'V', false, true, false); return true; } // Else, we retrieve the accelerator information from the frame. diff --git a/chrome/browser/views/toolbar_view.h b/chrome/browser/views/toolbar_view.h index 104dcfae..a475320 100644 --- a/chrome/browser/views/toolbar_view.h +++ b/chrome/browser/views/toolbar_view.h @@ -32,10 +32,10 @@ class ToolbarStarToggle; // rendering the Toolbar used in the Browser Window // /////////////////////////////////////////////////////////////////////////////// -class BrowserToolbarView : public ChromeViews::View, +class BrowserToolbarView : public views::View, public EncodingMenuControllerDelegate, - public ChromeViews::ViewMenuDelegate, - public ChromeViews::DragController, + public views::ViewMenuDelegate, + public views::DragController, public LocationBarView::Delegate, public NotificationObserver { public: @@ -45,22 +45,22 @@ class BrowserToolbarView : public ChromeViews::View, // Create the contents of the Browser Toolbar void Init(Profile* profile); - // ChromeViews::View + // views::View virtual void Layout(); virtual void DidGainFocus(); virtual void WillLoseFocus(); - virtual bool OnKeyPressed(const ChromeViews::KeyEvent& e); - virtual bool OnKeyReleased(const ChromeViews::KeyEvent& e); + virtual bool OnKeyPressed(const views::KeyEvent& e); + virtual bool OnKeyReleased(const views::KeyEvent& e); virtual gfx::Size GetPreferredSize(); // Overridden from EncodingMenuControllerDelegate: virtual bool IsItemChecked(int id) const; // Overridden from Menu::BaseControllerDelegate: - virtual bool GetAcceleratorInfo(int id, ChromeViews::Accelerator* accel); + virtual bool GetAcceleratorInfo(int id, views::Accelerator* accel); - // ChromeViews::MenuDelegate - virtual void RunMenu(ChromeViews::View* source, const CPoint& pt, HWND hwnd); + // views::MenuDelegate + virtual void RunMenu(views::View* source, const CPoint& pt, HWND hwnd); // Sets the profile which is active on the currently-active tab. void SetProfile(Profile* profile); @@ -97,7 +97,7 @@ class BrowserToolbarView : public ChromeViews::View, // first accessible child, based on the above policy. int GetNextAccessibleViewIndex(int view_index, bool nav_left); - ChromeViews::View* GetAccFocusedChildView() { + views::View* GetAccFocusedChildView() { return acc_focused_view_; } @@ -157,18 +157,18 @@ class BrowserToolbarView : public ChromeViews::View, std::wstring accessible_name_; // Child view currently having MSAA focus (location bar excluded from arrow // navigation). - ChromeViews::View* acc_focused_view_; + views::View* acc_focused_view_; // Controls - ChromeViews::Button* back_; - ChromeViews::Button* forward_; - ChromeViews::Button* reload_; - ChromeViews::Button* home_; + views::Button* back_; + views::Button* forward_; + views::Button* reload_; + views::Button* home_; ToolbarStarToggle* star_; LocationBarView* location_bar_; GoButton* go_; - ChromeViews::MenuButton* page_menu_; - ChromeViews::MenuButton* app_menu_; + views::MenuButton* page_menu_; + views::MenuButton* app_menu_; Profile* profile_; Browser* browser_; diff --git a/chrome/browser/views/user_data_dir_dialog.cc b/chrome/browser/views/user_data_dir_dialog.cc index 01d181a..8189331 100644 --- a/chrome/browser/views/user_data_dir_dialog.cc +++ b/chrome/browser/views/user_data_dir_dialog.cc @@ -29,7 +29,7 @@ UserDataDirDialog::UserDataDirDialog(const std::wstring& user_data_dir) message_box_view_ = new MessageBoxView(MessageBoxView::kIsConfirmMessageBox, message_text.c_str(), std::wstring(), kDialogWidth); - ChromeViews::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show(); + views::Window::CreateChromeWindow(NULL, gfx::Rect(), this)->Show(); } UserDataDirDialog::~UserDataDirDialog() { @@ -82,7 +82,7 @@ bool UserDataDirDialog::Cancel() { return true; } -ChromeViews::View* UserDataDirDialog::GetContentsView() { +views::View* UserDataDirDialog::GetContentsView() { return message_box_view_; } diff --git a/chrome/browser/views/user_data_dir_dialog.h b/chrome/browser/views/user_data_dir_dialog.h index d9811a8..42d9aae 100644 --- a/chrome/browser/views/user_data_dir_dialog.h +++ b/chrome/browser/views/user_data_dir_dialog.h @@ -14,11 +14,11 @@ #include "chrome/views/dialog_delegate.h" class MessageBoxView; -namespace ChromeViews { +namespace views { class Window; } -class UserDataDirDialog : public ChromeViews::DialogDelegate, +class UserDataDirDialog : public views::DialogDelegate, public MessageLoopForUI::Dispatcher, public SelectFileDialog::Listener { public: @@ -31,7 +31,7 @@ class UserDataDirDialog : public ChromeViews::DialogDelegate, std::wstring user_data_dir() { return user_data_dir_; } - // ChromeViews::DialogDelegate Methods: + // views::DialogDelegate Methods: virtual int GetDialogButtons() const; virtual std::wstring GetDialogButtonLabel(DialogButton button) const; virtual std::wstring GetWindowTitle() const; @@ -39,10 +39,10 @@ class UserDataDirDialog : public ChromeViews::DialogDelegate, virtual bool Accept(); virtual bool Cancel(); - // ChromeViews::WindowDelegate Methods: + // views::WindowDelegate Methods: virtual bool IsAlwaysOnTop() const { return false; } virtual bool IsModal() const { return false; } - virtual ChromeViews::View* GetContentsView(); + virtual views::View* GetContentsView(); // MessageLoop::Dispatcher Method: virtual bool Dispatch(const MSG& msg); diff --git a/chrome/browser/web_contents.cc b/chrome/browser/web_contents.cc index 1139393..b635785 100644 --- a/chrome/browser/web_contents.cc +++ b/chrome/browser/web_contents.cc @@ -1329,8 +1329,8 @@ void WebContents::PasswordFormsSeen( void WebContents::TakeFocus(bool reverse) { // TODO(brettw) move this to the view. - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(view_->GetContainerHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(view_->GetContainerHWND()); // We may not have a focus manager if the tab has been switched before this // message arrived. diff --git a/chrome/browser/web_contents_view_win.cc b/chrome/browser/web_contents_view_win.cc index 44eb993..96aeabd 100644 --- a/chrome/browser/web_contents_view_win.cc +++ b/chrome/browser/web_contents_view_win.cc @@ -192,12 +192,12 @@ void WebContentsViewWin::HandleKeyboardEvent(const WebKeyboardEvent& event) { // The renderer returned a keyboard event it did not process. This may be // a keyboard shortcut that we have to process. if (event.type == WebInputEvent::KEY_DOWN) { - ChromeViews::FocusManager* focus_manager = - ChromeViews::FocusManager::GetFocusManager(GetHWND()); + views::FocusManager* focus_manager = + views::FocusManager::GetFocusManager(GetHWND()); // We may not have a focus_manager at this point (if the tab has been // switched by the time this message returned). if (focus_manager) { - ChromeViews::Accelerator accelerator(event.key_code, + views::Accelerator accelerator(event.key_code, (event.modifiers & WebInputEvent::SHIFT_KEY) == WebInputEvent::SHIFT_KEY, (event.modifiers & WebInputEvent::CTRL_KEY) == diff --git a/chrome/browser/web_contents_view_win.h b/chrome/browser/web_contents_view_win.h index 36bcbe7..3a905be 100644 --- a/chrome/browser/web_contents_view_win.h +++ b/chrome/browser/web_contents_view_win.h @@ -16,7 +16,7 @@ class WebDropTarget; // Windows-specific implementation of the WebContentsView. It is a HWND that // contains all of the contents of the tab and associated child views. class WebContentsViewWin : public WebContentsView, - public ChromeViews::ContainerWin { + public views::ContainerWin { public: // The corresponding WebContents is passed in the constructor, and manages our // lifetime. This doesn't need to be the case, but is this way currently |