diff options
-rw-r--r-- | chrome/browser/ui/views/accessibility_event_router_views_unittest.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/chrome_views_delegate.cc | 13 | ||||
-rw-r--r-- | chrome/browser/ui/views/chrome_views_delegate.h | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.cc | 4 | ||||
-rw-r--r-- | chrome/browser/ui/views/frame/browser_view.h | 2 | ||||
-rw-r--r-- | chrome/browser/ui/views/menu_model_adapter_test.cc | 21 | ||||
-rw-r--r-- | chrome/browser/ui/views/task_manager_view.cc | 11 | ||||
-rw-r--r-- | views/desktop/desktop_views_delegate.cc | 4 | ||||
-rw-r--r-- | views/desktop/desktop_views_delegate.h | 4 | ||||
-rw-r--r-- | views/test/test_views_delegate.cc | 4 | ||||
-rw-r--r-- | views/test/test_views_delegate.h | 4 | ||||
-rw-r--r-- | views/views_delegate.h | 4 | ||||
-rw-r--r-- | views/widget/widget_delegate.cc | 8 | ||||
-rw-r--r-- | views/widget/widget_delegate.h | 2 |
15 files changed, 44 insertions, 49 deletions
diff --git a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc index 3526b0a..18ba9cd 100644 --- a/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc +++ b/chrome/browser/ui/views/accessibility_event_router_views_unittest.cc @@ -33,12 +33,12 @@ class AccessibilityViewsDelegate : public views::ViewsDelegate { virtual ui::Clipboard* GetClipboard() const OVERRIDE { return NULL; } virtual views::View* GetDefaultParentView() OVERRIDE { return NULL; } virtual void SaveWindowPlacement(const views::Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE { } virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE { return false; diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc index 0667da3..1a6a478 100644 --- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc +++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view_test.cc @@ -72,11 +72,11 @@ class ViewsDelegateImpl : public views::ViewsDelegate { virtual ui::Clipboard* GetClipboard() const OVERRIDE { return NULL; } virtual views::View* GetDefaultParentView() OVERRIDE { return NULL; } virtual void SaveWindowPlacement(const views::Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE {} virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE { return false; diff --git a/chrome/browser/ui/views/chrome_views_delegate.cc b/chrome/browser/ui/views/chrome_views_delegate.cc index a6b7eef..90bff7d 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.cc +++ b/chrome/browser/ui/views/chrome_views_delegate.cc @@ -59,15 +59,15 @@ views::View* ChromeViewsDelegate::GetDefaultParentView() { } void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) { PrefService* prefs = GetPrefsForWindow(window); if (!prefs) return; - DCHECK(prefs->FindPreference(WideToUTF8(window_name).c_str())); - DictionaryPrefUpdate update(prefs, WideToUTF8(window_name).c_str()); + DCHECK(prefs->FindPreference(window_name.c_str())); + DictionaryPrefUpdate update(prefs, window_name.c_str()); DictionaryValue* window_preferences = update.Get(); window_preferences->SetInteger("left", bounds.x()); window_preferences->SetInteger("top", bounds.y()); @@ -87,16 +87,15 @@ void ChromeViewsDelegate::SaveWindowPlacement(const views::Widget* window, } bool ChromeViewsDelegate::GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const { PrefService* prefs = g_browser_process->local_state(); if (!prefs) return false; - DCHECK(prefs->FindPreference(WideToUTF8(window_name).c_str())); - const DictionaryValue* dictionary = - prefs->GetDictionary(WideToUTF8(window_name).c_str()); + DCHECK(prefs->FindPreference(window_name.c_str())); + const DictionaryValue* dictionary = prefs->GetDictionary(window_name.c_str()); int left, top, right, bottom; if (!dictionary || !dictionary->GetInteger("left", &left) || !dictionary->GetInteger("top", &top) || diff --git a/chrome/browser/ui/views/chrome_views_delegate.h b/chrome/browser/ui/views/chrome_views_delegate.h index a874348..d926b37 100644 --- a/chrome/browser/ui/views/chrome_views_delegate.h +++ b/chrome/browser/ui/views/chrome_views_delegate.h @@ -23,11 +23,11 @@ class ChromeViewsDelegate : public views::ViewsDelegate { virtual ui::Clipboard* GetClipboard() const OVERRIDE; virtual views::View* GetDefaultParentView() OVERRIDE; virtual void SaveWindowPlacement(const views::Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE; virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; virtual void NotifyAccessibilityEvent( diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc index 0cf2a2d..3a14655 100644 --- a/chrome/browser/ui/views/frame/browser_view.cc +++ b/chrome/browser/ui/views/frame/browser_view.cc @@ -1648,8 +1648,8 @@ bool BrowserView::ExecuteWindowsCommand(int command_id) { return browser_->ExecuteCommandIfEnabled(command_id); } -std::wstring BrowserView::GetWindowName() const { - return UTF8ToWide(browser_->GetWindowPlacementKey()); +std::string BrowserView::GetWindowName() const { + return browser_->GetWindowPlacementKey(); } void BrowserView::SaveWindowPlacement(const gfx::Rect& bounds, diff --git a/chrome/browser/ui/views/frame/browser_view.h b/chrome/browser/ui/views/frame/browser_view.h index 8015321..57f9740 100644 --- a/chrome/browser/ui/views/frame/browser_view.h +++ b/chrome/browser/ui/views/frame/browser_view.h @@ -392,7 +392,7 @@ class BrowserView : public BrowserBubbleHost, virtual SkBitmap GetWindowIcon() OVERRIDE; virtual bool ShouldShowWindowIcon() const OVERRIDE; virtual bool ExecuteWindowsCommand(int command_id) OVERRIDE; - virtual std::wstring GetWindowName() const OVERRIDE; + virtual std::string GetWindowName() const OVERRIDE; virtual void SaveWindowPlacement(const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE; virtual bool GetSavedWindowPlacement( diff --git a/chrome/browser/ui/views/menu_model_adapter_test.cc b/chrome/browser/ui/views/menu_model_adapter_test.cc index 39a15da..d8cc598 100644 --- a/chrome/browser/ui/views/menu_model_adapter_test.cc +++ b/chrome/browser/ui/views/menu_model_adapter_test.cc @@ -36,19 +36,18 @@ class TestViewsDelegate : public views::ViewsDelegate { return NULL; } - virtual views::View* GetDefaultParentView() OVERRIDE - { + virtual views::View* GetDefaultParentView() OVERRIDE { return NULL; } virtual void SaveWindowPlacement(const views::Widget* widget, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE { } virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE { return false; @@ -58,17 +57,15 @@ class TestViewsDelegate : public views::ViewsDelegate { views::View* view, ui::AccessibilityTypes::Event event_type) OVERRIDE { } - virtual void NotifyMenuItemFocused( - const std::wstring& menu_name, - const std::wstring& menu_item_name, - int item_index, - int item_count, - bool has_submenu) OVERRIDE { + virtual void NotifyMenuItemFocused(const std::wstring& menu_name, + const std::wstring& menu_item_name, + int item_index, + int item_count, + bool has_submenu) OVERRIDE { } #if defined(OS_WIN) - virtual HICON GetDefaultWindowIcon() const OVERRIDE - { + virtual HICON GetDefaultWindowIcon() const OVERRIDE { return NULL; } #endif diff --git a/chrome/browser/ui/views/task_manager_view.cc b/chrome/browser/ui/views/task_manager_view.cc index fd5d423..e61a9cf 100644 --- a/chrome/browser/ui/views/task_manager_view.cc +++ b/chrome/browser/ui/views/task_manager_view.cc @@ -286,7 +286,7 @@ class TaskManagerView : public views::ButtonListener, virtual bool CanMaximize() const; virtual bool ExecuteWindowsCommand(int command_id); virtual std::wstring GetWindowTitle() const; - virtual std::wstring GetWindowName() const; + virtual std::string GetWindowName() const; virtual int GetDialogButtons() const; virtual void WindowClosing(); virtual views::View* GetContentsView(); @@ -634,7 +634,7 @@ bool TaskManagerView::ExecuteWindowsCommand(int command_id) { // Save the state. if (g_browser_process->local_state()) { DictionaryPrefUpdate update(g_browser_process->local_state(), - WideToUTF8(GetWindowName()).c_str()); + GetWindowName().c_str()); DictionaryValue* window_preferences = update.Get(); window_preferences->SetBoolean("always_on_top", is_always_on_top_); } @@ -648,8 +648,8 @@ std::wstring TaskManagerView::GetWindowTitle() const { return UTF16ToWide(l10n_util::GetStringUTF16(IDS_TASK_MANAGER_TITLE)); } -std::wstring TaskManagerView::GetWindowName() const { - return UTF8ToWide(prefs::kTaskManagerWindowPlacement); +std::string TaskManagerView::GetWindowName() const { + return prefs::kTaskManagerWindowPlacement; } int TaskManagerView::GetDialogButtons() const { @@ -775,8 +775,7 @@ bool TaskManagerView::GetSavedAlwaysOnTopState(bool* always_on_top) const { return false; const DictionaryValue* dictionary = - g_browser_process->local_state()->GetDictionary( - WideToUTF8(GetWindowName()).c_str()); + g_browser_process->local_state()->GetDictionary(GetWindowName().c_str()); return dictionary && dictionary->GetBoolean("always_on_top", always_on_top) && always_on_top; } diff --git a/views/desktop/desktop_views_delegate.cc b/views/desktop/desktop_views_delegate.cc index b0f7ea2..983055c 100644 --- a/views/desktop/desktop_views_delegate.cc +++ b/views/desktop/desktop_views_delegate.cc @@ -33,13 +33,13 @@ View* DesktopViewsDelegate::GetDefaultParentView() { } void DesktopViewsDelegate::SaveWindowPlacement(const Widget* widget, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) { } bool DesktopViewsDelegate::GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const { return false; diff --git a/views/desktop/desktop_views_delegate.h b/views/desktop/desktop_views_delegate.h index 1704a97..0b6e657 100644 --- a/views/desktop/desktop_views_delegate.h +++ b/views/desktop/desktop_views_delegate.h @@ -21,11 +21,11 @@ class DesktopViewsDelegate : public ViewsDelegate { virtual ui::Clipboard* GetClipboard() const OVERRIDE; virtual View* GetDefaultParentView() OVERRIDE; virtual void SaveWindowPlacement(const Widget* widget, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE; virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; virtual void NotifyAccessibilityEvent( diff --git a/views/test/test_views_delegate.cc b/views/test/test_views_delegate.cc index 7793dc4..3b1bd3b 100644 --- a/views/test/test_views_delegate.cc +++ b/views/test/test_views_delegate.cc @@ -32,13 +32,13 @@ View* TestViewsDelegate::GetDefaultParentView() { } void TestViewsDelegate::SaveWindowPlacement(const Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) { } bool TestViewsDelegate::GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui:: WindowShowState* show_state) const { return false; diff --git a/views/test/test_views_delegate.h b/views/test/test_views_delegate.h index 8d07bfc..a893851 100644 --- a/views/test/test_views_delegate.h +++ b/views/test/test_views_delegate.h @@ -33,11 +33,11 @@ class TestViewsDelegate : public ViewsDelegate { virtual ui::Clipboard* GetClipboard() const OVERRIDE; virtual View* GetDefaultParentView() OVERRIDE; virtual void SaveWindowPlacement(const Widget* window, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) OVERRIDE; virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const OVERRIDE; diff --git a/views/views_delegate.h b/views/views_delegate.h index 4b032c3..3499cbc 100644 --- a/views/views_delegate.h +++ b/views/views_delegate.h @@ -50,14 +50,14 @@ class VIEWS_EXPORT ViewsDelegate { // Saves the position, size and "show" state for the window with the // specified name. virtual void SaveWindowPlacement(const Widget* widget, - const std::wstring& window_name, + const std::string& window_name, const gfx::Rect& bounds, ui::WindowShowState show_state) = 0; // Retrieves the saved position and size and "show" state for the window with // the specified name. virtual bool GetSavedWindowPlacement( - const std::wstring& window_name, + const std::string& window_name, gfx::Rect* bounds, ui::WindowShowState* show_state) const = 0; diff --git a/views/widget/widget_delegate.cc b/views/widget/widget_delegate.cc index 25cb54a..fe447ee 100644 --- a/views/widget/widget_delegate.cc +++ b/views/widget/widget_delegate.cc @@ -93,13 +93,13 @@ bool WidgetDelegate::ExecuteWindowsCommand(int command_id) { return false; } -std::wstring WidgetDelegate::GetWindowName() const { - return std::wstring(); +std::string WidgetDelegate::GetWindowName() const { + return std::string(); } void WidgetDelegate::SaveWindowPlacement(const gfx::Rect& bounds, ui::WindowShowState show_state) { - std::wstring window_name = GetWindowName(); + std::string window_name = GetWindowName(); if (!ViewsDelegate::views_delegate || window_name.empty()) return; @@ -110,7 +110,7 @@ void WidgetDelegate::SaveWindowPlacement(const gfx::Rect& bounds, bool WidgetDelegate::GetSavedWindowPlacement( gfx::Rect* bounds, ui::WindowShowState* show_state) const { - std::wstring window_name = GetWindowName(); + std::string window_name = GetWindowName(); if (!ViewsDelegate::views_delegate || window_name.empty()) return false; diff --git a/views/widget/widget_delegate.h b/views/widget/widget_delegate.h index 5c73d4d..73f86a9 100644 --- a/views/widget/widget_delegate.h +++ b/views/widget/widget_delegate.h @@ -96,7 +96,7 @@ class VIEWS_EXPORT WidgetDelegate { // Returns the window's name identifier. Used to identify this window for // state restoration. - virtual std::wstring GetWindowName() const; + virtual std::string GetWindowName() const; // Saves the window's bounds and "show" state. By default this uses the // process' local state keyed by window name (See GetWindowName above). This |