Merge from Chromium at DEPS revision r198571
This commit was generated by merge_to_master.py.
Change-Id: I951118a03836157090561764dd2627f0add8118f
diff --git a/ash/shell/app_list.cc b/ash/shell/app_list.cc
index ebf2f87..7ee4d38 100644
--- a/ash/shell/app_list.cc
+++ b/ash/shell/app_list.cc
@@ -4,10 +4,10 @@
#include <string>
+#include "ash/session_state_delegate.h"
#include "ash/shell.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/toplevel_window.h"
-#include "ash/shell_delegate.h"
#include "base/basictypes.h"
#include "base/i18n/case_conversion.h"
#include "base/i18n/string_search.h"
@@ -109,7 +109,7 @@
break;
}
case LOCK_SCREEN: {
- Shell::GetInstance()->delegate()->LockScreen();
+ Shell::GetInstance()->session_state_delegate()->LockScreen();
break;
}
case WIDGETS_WINDOW: {
@@ -146,11 +146,11 @@
class ExampleSearchResult : public app_list::SearchResult {
public:
ExampleSearchResult(WindowTypeLauncherItem::Type type,
- const string16& query)
+ const base::string16& query)
: type_(type) {
SetIcon(WindowTypeLauncherItem::GetIcon(type_));
- string16 title = UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type_));
+ base::string16 title = UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type_));
set_title(title);
Tags title_tags;
@@ -160,7 +160,7 @@
// Note the following is not a proper way to handle i18n string.
title = base::i18n::ToLower(title);
size_t match_start = title.find(query);
- while (match_start != string16::npos) {
+ while (match_start != base::string16::npos) {
title_tags.push_back(Tag(Tag::MATCH,
match_start,
match_start + match_len));
@@ -168,7 +168,8 @@
}
set_title_tags(title_tags);
- string16 details = UTF8ToUTF16(WindowTypeLauncherItem::GetDetails(type_));
+ base::string16 details =
+ UTF8ToUTF16(WindowTypeLauncherItem::GetDetails(type_));
set_details(details);
Tags details_tags;
details_tags.push_back(Tag(Tag::DIM, 0, details.length()));
@@ -199,7 +200,7 @@
}
gfx::ImageSkia CreateSearchBoxIcon() {
- const string16 icon_text = ASCIIToUTF16("ash");
+ const base::string16 icon_text = ASCIIToUTF16("ash");
const gfx::Size icon_size(32, 32);
gfx::Canvas canvas(icon_size, ui::SCALE_FACTOR_100P,
@@ -249,7 +250,7 @@
}
virtual void StartSearch() OVERRIDE {
- string16 query;
+ base::string16 query;
TrimWhitespace(model_->search_box()->text(), TRIM_ALL, &query);
query = base::i18n::ToLower(query);
@@ -263,7 +264,8 @@
WindowTypeLauncherItem::Type type =
static_cast<WindowTypeLauncherItem::Type>(i);
- string16 title = UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type));
+ base::string16 title =
+ UTF8ToUTF16(WindowTypeLauncherItem::GetTitle(type));
if (base::i18n::StringSearchIgnoringCaseAndAccents(
query, title, NULL, NULL)) {
model_->results()->Add(new ExampleSearchResult(type, query));
@@ -293,19 +295,19 @@
return gfx::ImageSkia();
}
- virtual string16 GetCurrentUserName() {
- return string16();
+ virtual base::string16 GetCurrentUserName() OVERRIDE {
+ return base::string16();
}
- virtual string16 GetCurrentUserEmail() {
- return string16();
+ virtual base::string16 GetCurrentUserEmail() OVERRIDE {
+ return base::string16();
}
- virtual void OpenSettings() {
+ virtual void OpenSettings() OVERRIDE {
// Nothing needs to be done.
}
- virtual void OpenFeedback() {
+ virtual void OpenFeedback() OVERRIDE {
// Nothing needs to be done.
}
diff --git a/ash/shell/bubble.cc b/ash/shell/bubble.cc
index 649202d..1442bef 100644
--- a/ash/shell/bubble.cc
+++ b/ash/shell/bubble.cc
@@ -13,9 +13,9 @@
namespace shell {
struct BubbleConfig {
- string16 label;
+ base::string16 label;
views::View* anchor_view;
- views::BubbleBorder::ArrowLocation arrow;
+ views::BubbleBorder::Arrow arrow;
};
class ExampleBubbleDelegateView : public views::BubbleDelegateView {
@@ -31,7 +31,7 @@
}
private:
- string16 label_;
+ base::string16 label_;
};
void CreatePointyBubble(views::View* anchor_view) {
diff --git a/ash/shell/content_client/shell_browser_main_parts.cc b/ash/shell/content_client/shell_browser_main_parts.cc
index cb5975f..b2393e6 100644
--- a/ash/shell/content_client/shell_browser_main_parts.cc
+++ b/ash/shell/content_client/shell_browser_main_parts.cc
@@ -12,7 +12,7 @@
#include "base/command_line.h"
#include "base/i18n/icu_util.h"
#include "base/message_loop.h"
-#include "base/string_number_conversions.h"
+#include "base/strings/string_number_conversions.h"
#include "base/threading/thread.h"
#include "base/threading/thread_restrictions.h"
#include "content/public/common/content_switches.h"
@@ -35,8 +35,8 @@
#include "ui/message_center/message_center.h"
#endif
-#if defined(OS_LINUX)
-#include "ui/base/touch/touch_factory.h"
+#if defined(USE_X11)
+#include "ui/base/touch/touch_factory_x11.h"
#endif
#if defined(OS_CHROMEOS)
@@ -89,7 +89,7 @@
#if !defined(OS_MACOSX)
void ShellBrowserMainParts::PreMainMessageLoopStart() {
-#if defined(OS_LINUX)
+#if defined(USE_X11)
ui::TouchFactory::SetTouchDeviceListFromCommandLine();
#endif
}
@@ -135,7 +135,6 @@
}
void ShellBrowserMainParts::PostMainMessageLoopRun() {
- browser_context_.reset();
gfx::Screen* screen = Shell::GetInstance()->GetScreen();
screen->RemoveObserver(window_watcher_.get());
@@ -149,10 +148,16 @@
message_center::MessageCenter::Shutdown();
#endif
aura::Env::DeleteInstance();
+
+ // The keyboard may have created a WebContents. The WebContents is destroyed
+ // with the UI, and it needs the BrowserContext to be alive during its
+ // destruction. So destroy all of the UI elements before destroying the
+ // browser context.
+ browser_context_.reset();
}
bool ShellBrowserMainParts::MainMessageLoopRun(int* result_code) {
- MessageLoopForUI::current()->Run();
+ base::MessageLoopForUI::current()->Run();
return true;
}
diff --git a/ash/shell/content_client/shell_content_browser_client.cc b/ash/shell/content_client/shell_content_browser_client.cc
index 629d4b5..93fc834 100644
--- a/ash/shell/content_client/shell_content_browser_client.cc
+++ b/ash/shell/content_client/shell_content_browser_client.cc
@@ -5,6 +5,7 @@
#include "ash/shell/content_client/shell_content_browser_client.h"
#include "ash/shell/content_client/shell_browser_main_parts.h"
+#include "content/shell/shell_browser_context.h"
#include "third_party/skia/include/core/SkBitmap.h"
namespace ash {
@@ -23,6 +24,14 @@
return shell_browser_main_parts_;
}
+net::URLRequestContextGetter* ShellContentBrowserClient::CreateRequestContext(
+ content::BrowserContext* content_browser_context,
+ content::ProtocolHandlerMap* protocol_handlers) {
+ content::ShellBrowserContext* shell_context =
+ static_cast<content::ShellBrowserContext*>(content_browser_context);
+ return shell_context->CreateRequestContext(protocol_handlers);
+}
+
content::ShellBrowserContext* ShellContentBrowserClient::browser_context() {
return shell_browser_main_parts_->browser_context();
}
diff --git a/ash/shell/content_client/shell_content_browser_client.h b/ash/shell/content_client/shell_content_browser_client.h
index f4df45e..d90909a 100644
--- a/ash/shell/content_client/shell_content_browser_client.h
+++ b/ash/shell/content_client/shell_content_browser_client.h
@@ -29,6 +29,9 @@
// Overridden from content::ContentBrowserClient:
virtual content::BrowserMainParts* CreateBrowserMainParts(
const content::MainFunctionParams& parameters) OVERRIDE;
+ virtual net::URLRequestContextGetter* CreateRequestContext(
+ content::BrowserContext* browser_context,
+ content::ProtocolHandlerMap* protocol_handlers) OVERRIDE;
content::ShellBrowserContext* browser_context();
diff --git a/ash/shell/content_client/shell_main_delegate.cc b/ash/shell/content_client/shell_main_delegate.cc
index c356e45..014fae1 100644
--- a/ash/shell/content_client/shell_main_delegate.cc
+++ b/ash/shell/content_client/shell_main_delegate.cc
@@ -6,11 +6,8 @@
#include "ash/shell/content_client/shell_content_browser_client.h"
#include "base/command_line.h"
-#include "base/files/file_path.h"
-#include "base/path_service.h"
#include "content/public/common/content_switches.h"
#include "ui/base/resource/resource_bundle.h"
-#include "ui/base/ui_base_paths.h"
namespace ash {
namespace shell {
diff --git a/ash/shell/launcher_delegate_impl.cc b/ash/shell/launcher_delegate_impl.cc
index fd52c34..b38dee3 100644
--- a/ash/shell/launcher_delegate_impl.cc
+++ b/ash/shell/launcher_delegate_impl.cc
@@ -29,10 +29,11 @@
ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
}
-void LauncherDelegateImpl::ItemClicked(const ash::LauncherItem& item,
+void LauncherDelegateImpl::ItemSelected(const ash::LauncherItem& item,
const ui::Event& event) {
aura::Window* window = watcher_->GetWindowByID(item.id);
- ash::launcher::MoveToEventRootIfPanel(window, event);
+ if (window->type() == aura::client::WINDOW_TYPE_PANEL)
+ ash::wm::MoveWindowToEventRoot(window, event);
window->Show();
ash::wm::ActivateWindow(window);
}
@@ -41,7 +42,7 @@
return IDR_AURA_LAUNCHER_BROWSER_SHORTCUT;
}
-string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
+base::string16 LauncherDelegateImpl::GetTitle(const ash::LauncherItem& item) {
return watcher_->GetWindowByID(item.id)->title();
}
@@ -69,5 +70,15 @@
return true;
}
+void LauncherDelegateImpl::OnLauncherCreated(Launcher* launcher) {
+}
+
+void LauncherDelegateImpl::OnLauncherDestroyed(Launcher* launcher) {
+}
+
+bool LauncherDelegateImpl::IsPerAppLauncher() {
+ return false;
+}
+
} // namespace shell
} // namespace ash
diff --git a/ash/shell/launcher_delegate_impl.h b/ash/shell/launcher_delegate_impl.h
index edf58e8..e57b5b4 100644
--- a/ash/shell/launcher_delegate_impl.h
+++ b/ash/shell/launcher_delegate_impl.h
@@ -26,10 +26,10 @@
// LauncherDelegate overrides:
virtual void OnBrowserShortcutClicked(int event_flags) OVERRIDE;
- virtual void ItemClicked(const ash::LauncherItem& item,
+ virtual void ItemSelected(const ash::LauncherItem& item,
const ui::Event& event) OVERRIDE;
virtual int GetBrowserShortcutResourceId() OVERRIDE;
- virtual string16 GetTitle(const ash::LauncherItem& item) OVERRIDE;
+ virtual base::string16 GetTitle(const ash::LauncherItem& item) OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
const ash::LauncherItem& item,
aura::RootWindow* root) OVERRIDE;
@@ -39,6 +39,9 @@
virtual ash::LauncherID GetIDByWindow(aura::Window* window) OVERRIDE;
virtual bool IsDraggable(const ash::LauncherItem& item) OVERRIDE;
virtual bool ShouldShowTooltip(const LauncherItem& item) OVERRIDE;
+ virtual void OnLauncherCreated(Launcher* launcher) OVERRIDE;
+ virtual void OnLauncherDestroyed(Launcher* launcher) OVERRIDE;
+ virtual bool IsPerAppLauncher() OVERRIDE;
private:
// Used to update Launcher. Owned by main.
diff --git a/ash/shell/lock_view.cc b/ash/shell/lock_view.cc
index 5390ea7..95691b0 100644
--- a/ash/shell/lock_view.cc
+++ b/ash/shell/lock_view.cc
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
+#include "ash/session_state_delegate.h"
#include "ash/shell.h"
-#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/shell/example_factory.h"
#include "base/utf_string_conversions.h"
@@ -24,8 +24,8 @@
class LockView : public views::WidgetDelegateView,
public views::ButtonListener {
public:
- LockView() : unlock_button_(ALLOW_THIS_IN_INITIALIZER_LIST(
- new views::LabelButton(this, ASCIIToUTF16("Unlock")))) {
+ LockView()
+ : unlock_button_(new views::LabelButton(this, ASCIIToUTF16("Unlock"))) {
unlock_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
AddChildView(unlock_button_);
unlock_button_->set_focusable(true);
@@ -41,7 +41,7 @@
// Overridden from views::View:
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE {
canvas->FillRect(GetLocalBounds(), SK_ColorYELLOW);
- string16 text = ASCIIToUTF16("LOCKED!");
+ base::string16 text = ASCIIToUTF16("LOCKED!");
int string_width = font_.GetStringWidth(text);
canvas->DrawStringInt(text, font_, SK_ColorRED, (width() - string_width)/ 2,
(height() - font_.GetHeight()) / 2,
@@ -64,7 +64,7 @@
// Overridden from views::WidgetDelegateView:
virtual void WindowClosing() OVERRIDE {
- Shell::GetInstance()->delegate()->UnlockScreen();
+ Shell::GetInstance()->session_state_delegate()->UnlockScreen();
}
// Overridden from views::ButtonListener:
diff --git a/ash/shell/panel_window.cc b/ash/shell/panel_window.cc
index 80acf7d..0517b2d 100644
--- a/ash/shell/panel_window.cc
+++ b/ash/shell/panel_window.cc
@@ -65,7 +65,7 @@
canvas->FillRect(GetLocalBounds(), SK_ColorGREEN);
}
-string16 PanelWindow::GetWindowTitle() const {
+base::string16 PanelWindow::GetWindowTitle() const {
return ASCIIToUTF16(name_);
}
diff --git a/ash/shell/panel_window.h b/ash/shell/panel_window.h
index 2ac5d68..eefe5e3 100644
--- a/ash/shell/panel_window.h
+++ b/ash/shell/panel_window.h
@@ -37,7 +37,7 @@
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
// Overridden from views::WidgetDelegate:
- virtual string16 GetWindowTitle() const OVERRIDE;
+ virtual base::string16 GetWindowTitle() const OVERRIDE;
virtual View* GetContentsView() OVERRIDE;
virtual bool CanResize() const OVERRIDE;
virtual bool CanMaximize() const OVERRIDE;
diff --git a/ash/shell/shell_delegate_impl.cc b/ash/shell/shell_delegate_impl.cc
index 81b51c6..c5b1332 100644
--- a/ash/shell/shell_delegate_impl.cc
+++ b/ash/shell/shell_delegate_impl.cc
@@ -8,6 +8,8 @@
#include "ash/caps_lock_delegate_stub.h"
#include "ash/host/root_window_host_factory.h"
+#include "ash/session_state_delegate.h"
+#include "ash/session_state_delegate_stub.h"
#include "ash/shell/context_menu.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/launcher_delegate_impl.h"
@@ -16,14 +18,41 @@
#include "ash/wm/window_util.h"
#include "base/message_loop.h"
#include "ui/aura/window.h"
+#include "ui/keyboard/keyboard_controller_proxy.h"
+#include "ui/views/corewm/input_method_event_filter.h"
namespace ash {
+
+namespace {
+
+class DummyKeyboardControllerProxy : public keyboard::KeyboardControllerProxy {
+ public:
+ DummyKeyboardControllerProxy() {}
+ virtual ~DummyKeyboardControllerProxy() {}
+
+ private:
+ // Overridden from keyboard::KeyboardControllerProxy:
+ virtual content::BrowserContext* GetBrowserContext() OVERRIDE {
+ return Shell::GetInstance()->browser_context();
+ }
+
+ virtual ui::InputMethod* GetInputMethod() OVERRIDE {
+ return Shell::GetInstance()->input_method_filter()->input_method();
+ }
+
+ virtual void OnKeyboardBoundsChanged(const gfx::Rect& new_bounds) OVERRIDE {
+ }
+
+ DISALLOW_COPY_AND_ASSIGN(DummyKeyboardControllerProxy);
+};
+
+} // namespace
+
namespace shell {
ShellDelegateImpl::ShellDelegateImpl()
: watcher_(NULL),
launcher_delegate_(NULL),
- locked_(false),
spoken_feedback_enabled_(false),
high_contrast_enabled_(false),
screen_magnifier_enabled_(false),
@@ -39,19 +68,11 @@
launcher_delegate_->set_watcher(watcher);
}
-bool ShellDelegateImpl::IsUserLoggedIn() const {
- return true;
-}
-
-bool ShellDelegateImpl::IsSessionStarted() const {
- return true;
-}
-
-bool ShellDelegateImpl::IsGuestSession() const {
+bool ShellDelegateImpl::IsFirstRunAfterBoot() const {
return false;
}
-bool ShellDelegateImpl::IsFirstRunAfterBoot() const {
+bool ShellDelegateImpl::IsMultiProfilesEnabled() const {
return false;
}
@@ -59,25 +80,6 @@
return false;
}
-bool ShellDelegateImpl::CanLockScreen() const {
- return true;
-}
-
-void ShellDelegateImpl::LockScreen() {
- ash::shell::CreateLockScreen();
- locked_ = true;
- ash::Shell::GetInstance()->UpdateShelfVisibility();
-}
-
-void ShellDelegateImpl::UnlockScreen() {
- locked_ = false;
- ash::Shell::GetInstance()->UpdateShelfVisibility();
-}
-
-bool ShellDelegateImpl::IsScreenLocked() const {
- return locked_;
-}
-
void ShellDelegateImpl::PreInit() {
}
@@ -85,7 +87,7 @@
}
void ShellDelegateImpl::Exit() {
- MessageLoopForUI::current()->Quit();
+ base::MessageLoopForUI::current()->Quit();
}
void ShellDelegateImpl::NewTab() {
@@ -98,6 +100,10 @@
ash::shell::ToplevelWindow::CreateToplevelWindow(create_params);
}
+void ShellDelegateImpl::ToggleFullscreen() {
+ ToggleMaximized();
+}
+
void ShellDelegateImpl::ToggleMaximized() {
aura::Window* window = ash::wm::GetActiveWindow();
if (window)
@@ -116,11 +122,12 @@
void ShellDelegateImpl::RestoreTab() {
}
-bool ShellDelegateImpl::RotatePaneFocus(Shell::Direction direction) {
- return true;
+void ShellDelegateImpl::ShowKeyboardOverlay() {
}
-void ShellDelegateImpl::ShowKeyboardOverlay() {
+keyboard::KeyboardControllerProxy*
+ ShellDelegateImpl::CreateKeyboardControllerProxy() {
+ return new DummyKeyboardControllerProxy();
}
void ShellDelegateImpl::ShowTaskManager() {
@@ -167,6 +174,9 @@
return false;
}
+void ShellDelegateImpl::SilenceSpokenFeedback() const {
+}
+
app_list::AppListViewDelegate* ShellDelegateImpl::CreateAppListViewDelegate() {
return ash::shell::CreateAppListViewDelegate();
}
@@ -189,6 +199,10 @@
return new CapsLockDelegateStub;
}
+ash::SessionStateDelegate* ShellDelegateImpl::CreateSessionStateDelegate() {
+ return new SessionStateDelegateStub;
+}
+
aura::client::UserActionClient* ShellDelegateImpl::CreateUserActionClient() {
return NULL;
}
@@ -208,12 +222,14 @@
void ShellDelegateImpl::HandleMediaPrevTrack() {
}
-string16 ShellDelegateImpl::GetTimeRemainingString(base::TimeDelta delta) {
- return string16();
+base::string16 ShellDelegateImpl::GetTimeRemainingString(
+ base::TimeDelta delta) {
+ return base::string16();
}
-string16 ShellDelegateImpl::GetTimeDurationLongString(base::TimeDelta delta) {
- return string16();
+base::string16 ShellDelegateImpl::GetTimeDurationLongString(
+ base::TimeDelta delta) {
+ return base::string16();
}
void ShellDelegateImpl::SaveScreenMagnifierScale(double scale) {
@@ -231,8 +247,8 @@
return RootWindowHostFactory::Create();
}
-string16 ShellDelegateImpl::GetProductName() const {
- return string16();
+base::string16 ShellDelegateImpl::GetProductName() const {
+ return base::string16();
}
} // namespace shell
diff --git a/ash/shell/shell_delegate_impl.h b/ash/shell/shell_delegate_impl.h
index 15f61ae..fcb28c8 100644
--- a/ash/shell/shell_delegate_impl.h
+++ b/ash/shell/shell_delegate_impl.h
@@ -10,6 +10,10 @@
#include "ash/shell_delegate.h"
#include "base/compiler_specific.h"
+namespace keyboard {
+class KeyboardControllerProxy;
+}
+
namespace ash {
namespace shell {
@@ -23,27 +27,23 @@
void SetWatcher(WindowWatcher* watcher);
- virtual bool IsUserLoggedIn() const OVERRIDE;
- virtual bool IsSessionStarted() const OVERRIDE;
- virtual bool IsGuestSession() const OVERRIDE;
virtual bool IsFirstRunAfterBoot() const OVERRIDE;
+ virtual bool IsMultiProfilesEnabled() const OVERRIDE;
virtual bool IsRunningInForcedAppMode() const OVERRIDE;
- virtual bool CanLockScreen() const OVERRIDE;
- virtual void LockScreen() OVERRIDE;
- virtual void UnlockScreen() OVERRIDE;
- virtual bool IsScreenLocked() const OVERRIDE;
virtual void PreInit() OVERRIDE;
virtual void Shutdown() OVERRIDE;
virtual void Exit() OVERRIDE;
virtual void NewTab() OVERRIDE;
virtual void NewWindow(bool incognito) OVERRIDE;
+ virtual void ToggleFullscreen() OVERRIDE;
virtual void ToggleMaximized() OVERRIDE;
virtual void OpenFileManager(bool as_dialog) OVERRIDE;
virtual void OpenCrosh() OVERRIDE;
virtual void OpenMobileSetup(const std::string& service_path) OVERRIDE;
virtual void RestoreTab() OVERRIDE;
- virtual bool RotatePaneFocus(Shell::Direction direction) OVERRIDE;
virtual void ShowKeyboardOverlay() OVERRIDE;
+ virtual keyboard::KeyboardControllerProxy*
+ CreateKeyboardControllerProxy() OVERRIDE;
virtual void ShowTaskManager() OVERRIDE;
virtual content::BrowserContext* GetCurrentBrowserContext() OVERRIDE;
virtual void ToggleSpokenFeedback(
@@ -56,26 +56,29 @@
virtual bool IsMagnifierEnabled() const OVERRIDE;
virtual MagnifierType GetMagnifierType() const OVERRIDE;
virtual bool ShouldAlwaysShowAccessibilityMenu() const OVERRIDE;
+ virtual void SilenceSpokenFeedback() const OVERRIDE;
virtual app_list::AppListViewDelegate* CreateAppListViewDelegate() OVERRIDE;
virtual ash::LauncherDelegate* CreateLauncherDelegate(
ash::LauncherModel* model) OVERRIDE;
virtual ash::SystemTrayDelegate* CreateSystemTrayDelegate() OVERRIDE;
virtual ash::UserWallpaperDelegate* CreateUserWallpaperDelegate() OVERRIDE;
virtual ash::CapsLockDelegate* CreateCapsLockDelegate() OVERRIDE;
+ virtual ash::SessionStateDelegate* CreateSessionStateDelegate() OVERRIDE;
virtual aura::client::UserActionClient* CreateUserActionClient() OVERRIDE;
virtual void OpenFeedbackPage() OVERRIDE;
virtual void RecordUserMetricsAction(UserMetricsAction action) OVERRIDE;
virtual void HandleMediaNextTrack() OVERRIDE;
virtual void HandleMediaPlayPause() OVERRIDE;
virtual void HandleMediaPrevTrack() OVERRIDE;
- virtual string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE;
- virtual string16 GetTimeDurationLongString(base::TimeDelta delta) OVERRIDE;
+ virtual base::string16 GetTimeRemainingString(base::TimeDelta delta) OVERRIDE;
+ virtual base::string16 GetTimeDurationLongString(
+ base::TimeDelta delta) OVERRIDE;
virtual void SaveScreenMagnifierScale(double scale) OVERRIDE;
virtual double GetSavedScreenMagnifierScale() OVERRIDE;
virtual ui::MenuModel* CreateContextMenu(
aura::RootWindow* root_window) OVERRIDE;
virtual RootWindowHostFactory* CreateRootWindowHostFactory() OVERRIDE;
- virtual string16 GetProductName() const OVERRIDE;
+ virtual base::string16 GetProductName() const OVERRIDE;
private:
// Used to update Launcher. Owned by main.
@@ -83,7 +86,6 @@
LauncherDelegateImpl* launcher_delegate_;
- bool locked_;
bool spoken_feedback_enabled_;
bool high_contrast_enabled_;
bool screen_magnifier_enabled_;
diff --git a/ash/shell/toplevel_window.cc b/ash/shell/toplevel_window.cc
index 2a104bb..af18151 100644
--- a/ash/shell/toplevel_window.cc
+++ b/ash/shell/toplevel_window.cc
@@ -55,7 +55,7 @@
canvas->FillRect(GetLocalBounds(), SK_ColorDKGRAY);
}
-string16 ToplevelWindow::GetWindowTitle() const {
+base::string16 ToplevelWindow::GetWindowTitle() const {
return params_.persist_across_all_workspaces ?
ASCIIToUTF16("Examples: Toplevel Window (P)") :
ASCIIToUTF16("Examples: Toplevel Window");
diff --git a/ash/shell/toplevel_window.h b/ash/shell/toplevel_window.h
index ec398c2..22c23d0 100644
--- a/ash/shell/toplevel_window.h
+++ b/ash/shell/toplevel_window.h
@@ -29,7 +29,7 @@
virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
// Overridden from views::WidgetDelegate:
- virtual string16 GetWindowTitle() const OVERRIDE;
+ virtual base::string16 GetWindowTitle() const OVERRIDE;
virtual View* GetContentsView() OVERRIDE;
virtual bool CanResize() const OVERRIDE;
virtual bool CanMaximize() const OVERRIDE;
diff --git a/ash/shell/widgets.cc b/ash/shell/widgets.cc
index 234e5e3..9790a02 100644
--- a/ash/shell/widgets.cc
+++ b/ash/shell/widgets.cc
@@ -36,7 +36,7 @@
// Overridden from views::WidgetDelegate:
virtual views::View* GetContentsView() OVERRIDE;
- virtual string16 GetWindowTitle() const OVERRIDE;
+ virtual base::string16 GetWindowTitle() const OVERRIDE;
virtual bool CanResize() const OVERRIDE;
private:
@@ -119,7 +119,7 @@
return this;
}
-string16 WidgetsWindow::GetWindowTitle() const {
+base::string16 WidgetsWindow::GetWindowTitle() const {
return ASCIIToUTF16("Examples: Widgets");
}
diff --git a/ash/shell/window_type_launcher.cc b/ash/shell/window_type_launcher.cc
index 7b710bd..9c1a0b4 100644
--- a/ash/shell/window_type_launcher.cc
+++ b/ash/shell/window_type_launcher.cc
@@ -6,12 +6,12 @@
#include "ash/root_window_controller.h"
#include "ash/screensaver/screensaver_view.h"
+#include "ash/session_state_delegate.h"
#include "ash/shelf/shelf_widget.h"
#include "ash/shell.h"
#include "ash/shell/example_factory.h"
#include "ash/shell/panel_window.h"
#include "ash/shell/toplevel_window.h"
-#include "ash/shell_delegate.h"
#include "ash/shell_window_ids.h"
#include "ash/system/status_area_widget.h"
#include "ash/system/web_notification/web_notification_tray.h"
@@ -23,6 +23,7 @@
#include "ui/aura/window.h"
#include "ui/compositor/layer.h"
#include "ui/gfx/canvas.h"
+#include "ui/message_center/message_center.h"
#include "ui/message_center/notification_types.h"
#include "ui/views/controls/button/label_button.h"
#include "ui/views/controls/menu/menu_item_view.h"
@@ -53,8 +54,7 @@
explicit ModalWindow(ui::ModalType modal_type)
: modal_type_(modal_type),
color_(g_colors[g_color_index]),
- ALLOW_THIS_IN_INITIALIZER_LIST(open_button_(
- new views::LabelButton(this, ASCIIToUTF16("Moar!")))) {
+ open_button_(new views::LabelButton(this, ASCIIToUTF16("Moar!"))) {
++g_color_index %= arraysize(g_colors);
open_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
AddChildView(open_button_);
@@ -92,7 +92,7 @@
virtual bool CanResize() const OVERRIDE {
return true;
}
- virtual string16 GetWindowTitle() const OVERRIDE {
+ virtual base::string16 GetWindowTitle() const OVERRIDE {
return ASCIIToUTF16("Modal Window");
}
virtual ui::ModalType GetModalType() const OVERRIDE {
@@ -157,7 +157,7 @@
virtual bool CanResize() const OVERRIDE {
return true;
}
- virtual string16 GetWindowTitle() const OVERRIDE {
+ virtual base::string16 GetWindowTitle() const OVERRIDE {
return ASCIIToUTF16("Non-Modal Transient");
}
virtual void DeleteDelegate() OVERRIDE {
@@ -199,48 +199,36 @@
}
WindowTypeLauncher::WindowTypeLauncher()
- : ALLOW_THIS_IN_INITIALIZER_LIST(create_button_(
- new views::LabelButton(this, ASCIIToUTF16("Create Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(create_persistant_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Create Persistant Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(panel_button_(
- new views::LabelButton(this, ASCIIToUTF16("Create Panel")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(create_nonresizable_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Create Non-Resizable Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(bubble_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Create Pointy Bubble")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(lock_button_(
- new views::LabelButton(this, ASCIIToUTF16("Lock Screen")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(widgets_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Show Example Widgets")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(system_modal_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Open System Modal Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(window_modal_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Open Window Modal Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(child_modal_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Open Child Modal Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(transient_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Open Non-Modal Transient Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(examples_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Open Views Examples Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(show_hide_window_button_(
- new views::LabelButton(
- this, ASCIIToUTF16("Show/Hide a Window")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(show_screensaver_(
- new views::LabelButton(
- this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]")))),
- ALLOW_THIS_IN_INITIALIZER_LIST(show_web_notification_(
- new views::LabelButton(
- this, ASCIIToUTF16("Show a web/app notification")))) {
+ : create_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Create Window"))),
+ create_persistant_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Create Persistant Window"))),
+ panel_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Create Panel"))),
+ create_nonresizable_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Create Non-Resizable Window"))),
+ bubble_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Create Pointy Bubble"))),
+ lock_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Lock Screen"))),
+ widgets_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Show Example Widgets"))),
+ system_modal_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Open System Modal Window"))),
+ window_modal_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Open Window Modal Window"))),
+ child_modal_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Open Child Modal Window"))),
+ transient_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Open Non-Modal Transient Window"))),
+ examples_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Open Views Examples Window"))),
+ show_hide_window_button_(new views::LabelButton(
+ this, ASCIIToUTF16("Show/Hide a Window"))),
+ show_screensaver_(new views::LabelButton(
+ this, ASCIIToUTF16("Show the Screensaver [for 5 seconds]"))),
+ show_web_notification_(new views::LabelButton(
+ this, ASCIIToUTF16("Show a web/app notification"))) {
create_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
create_persistant_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
panel_button_->SetStyle(views::Button::STYLE_NATIVE_TEXTBUTTON);
@@ -307,7 +295,7 @@
return true;
}
-string16 WindowTypeLauncher::GetWindowTitle() const {
+base::string16 WindowTypeLauncher::GetWindowTitle() const {
return ASCIIToUTF16("Examples: Window Builder");
}
@@ -335,7 +323,7 @@
} else if (sender == bubble_button_) {
CreatePointyBubble(sender);
} else if (sender == lock_button_) {
- Shell::GetInstance()->delegate()->LockScreen();
+ Shell::GetInstance()->session_state_delegate()->LockScreen();
} else if (sender == widgets_button_) {
CreateWidgetsWindow();
} else if (sender == system_modal_button_) {
diff --git a/ash/shell/window_type_launcher.h b/ash/shell/window_type_launcher.h
index 51376e8..de2159e 100644
--- a/ash/shell/window_type_launcher.h
+++ b/ash/shell/window_type_launcher.h
@@ -48,7 +48,7 @@
// Overridden from views::WidgetDelegate:
virtual views::View* GetContentsView() OVERRIDE;
virtual bool CanResize() const OVERRIDE;
- virtual string16 GetWindowTitle() const OVERRIDE;
+ virtual base::string16 GetWindowTitle() const OVERRIDE;
virtual bool CanMaximize() const OVERRIDE;
// Overridden from views::ButtonListener: