summaryrefslogtreecommitdiff
path: root/apps
diff options
context:
space:
mode:
authorTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
committerTorne (Richard Coles) <torne@google.com>2014-08-19 13:00:08 +0100
commit6e8cce623b6e4fe0c9e4af605d675dd9d0338c38 (patch)
tree8d824ad26fac42e008142b86aa9631b2be7e4705 /apps
parent4f7316adb45db5ec3c9c1181ba9510c004566df8 (diff)
downloadchromium_org-6e8cce623b6e4fe0c9e4af605d675dd9d0338c38.tar.gz
Merge from Chromium at DEPS revision 290040
This commit was generated by merge_to_master.py. Change-Id: I694ec52d1e0b553f163c2faf4373d63270ab1aac
Diffstat (limited to 'apps')
-rw-r--r--apps/DEPS1
-rw-r--r--apps/app_shim/chrome_main_app_mode_mac.mm3
-rw-r--r--apps/app_window.cc17
-rw-r--r--apps/app_window.h17
-rw-r--r--apps/app_window_geometry_cache.cc11
-rw-r--r--apps/app_window_geometry_cache.h5
-rw-r--r--apps/app_window_registry.cc8
-rw-r--r--apps/apps.gypi3
-rw-r--r--apps/custom_launcher_page_contents.cc3
-rw-r--r--apps/launcher.cc6
-rw-r--r--apps/ui/views/native_app_window_views.cc3
11 files changed, 40 insertions, 37 deletions
diff --git a/apps/DEPS b/apps/DEPS
index cfc3724257..97f9cb0a67 100644
--- a/apps/DEPS
+++ b/apps/DEPS
@@ -6,6 +6,7 @@ include_rules = [
"+content/public/test",
"+components/keyed_service",
"+components/pref_registry/pref_registry_syncable.h",
+ "+components/user_manager",
"+components/web_modal",
"+extensions",
"+net/base",
diff --git a/apps/app_shim/chrome_main_app_mode_mac.mm b/apps/app_shim/chrome_main_app_mode_mac.mm
index 18b8f9e1cf..8b91322a95 100644
--- a/apps/app_shim/chrome_main_app_mode_mac.mm
+++ b/apps/app_shim/chrome_main_app_mode_mac.mm
@@ -582,7 +582,8 @@ int ChromeAppModeStart(const app_mode::ChromeAppModeInfo* info) {
l10n_util::GetApplicationLocale(preferred_localization));
// Load localized strings.
- ResourceBundle::InitSharedInstanceLocaleOnly(locale, NULL);
+ ui::ResourceBundle::InitSharedInstanceWithLocale(
+ locale, NULL, ui::ResourceBundle::DO_NOT_LOAD_COMMON_RESOURCES);
// Launch the IO thread.
base::Thread::Options io_thread_options;
diff --git a/apps/app_window.cc b/apps/app_window.cc
index e13e1b01f7..eb4f81a2fd 100644
--- a/apps/app_window.cc
+++ b/apps/app_window.cc
@@ -160,13 +160,14 @@ AppWindow::CreateParams::CreateParams()
has_frame_color(false),
active_frame_color(SK_ColorBLACK),
inactive_frame_color(SK_ColorBLACK),
- transparent_background(false),
+ alpha_enabled(false),
creator_process_id(0),
state(ui::SHOW_STATE_DEFAULT),
hidden(false),
resizable(true),
focused(true),
- always_on_top(false) {}
+ always_on_top(false) {
+}
AppWindow::CreateParams::~CreateParams() {}
@@ -243,7 +244,7 @@ AppWindow::AppWindow(BrowserContext* context,
can_send_events_(false),
is_hidden_(false),
cached_always_on_top_(false),
- requested_transparent_background_(false) {
+ requested_alpha_enabled_(false) {
extensions::ExtensionsBrowserClient* client =
extensions::ExtensionsBrowserClient::Get();
CHECK(!client->IsGuestSession(context) || context->IsOffTheRecord())
@@ -283,7 +284,7 @@ void AppWindow::Init(const GURL& url,
if (new_params.state == ui::SHOW_STATE_FULLSCREEN)
new_params.always_on_top = false;
- requested_transparent_background_ = new_params.transparent_background;
+ requested_alpha_enabled_ = new_params.alpha_enabled;
AppsClient* apps_client = AppsClient::Get();
native_app_window_.reset(
@@ -731,9 +732,9 @@ void AppWindow::GetSerializedState(base::DictionaryValue* properties) const {
properties->SetBoolean("maximized", native_app_window_->IsMaximized());
properties->SetBoolean("alwaysOnTop", IsAlwaysOnTop());
properties->SetBoolean("hasFrameColor", native_app_window_->HasFrameColor());
- properties->SetBoolean("alphaEnabled",
- requested_transparent_background_ &&
- native_app_window_->CanHaveAlphaEnabled());
+ properties->SetBoolean(
+ "alphaEnabled",
+ requested_alpha_enabled_ && native_app_window_->CanHaveAlphaEnabled());
// These properties are undocumented and are to enable testing. Alpha is
// removed to
@@ -923,7 +924,7 @@ void AppWindow::MoveContents(WebContents* source, const gfx::Rect& pos) {
}
void AppWindow::NavigationStateChanged(const content::WebContents* source,
- unsigned changed_flags) {
+ content::InvalidateTypes changed_flags) {
if (changed_flags & content::INVALIDATE_TYPE_TITLE)
native_app_window_->UpdateWindowTitle();
else if (changed_flags & content::INVALIDATE_TYPE_TAB)
diff --git a/apps/app_window.h b/apps/app_window.h
index ba3b44861e..7e35b81bd2 100644
--- a/apps/app_window.h
+++ b/apps/app_window.h
@@ -152,7 +152,7 @@ class AppWindow : public content::NotificationObserver,
bool has_frame_color;
SkColor active_frame_color;
SkColor inactive_frame_color;
- bool transparent_background; // Only supported on ash.
+ bool alpha_enabled;
// The initial content/inner bounds specification (excluding any window
// decorations).
@@ -344,10 +344,8 @@ class AppWindow : public content::NotificationObserver,
// app.
void WindowEventsReady();
- // Whether the app window wants a transparent background.
- bool requested_transparent_background() const {
- return requested_transparent_background_;
- }
+ // Whether the app window wants to be alpha enabled.
+ bool requested_alpha_enabled() const { return requested_alpha_enabled_; }
protected:
virtual ~AppWindow();
@@ -370,8 +368,9 @@ class AppWindow : public content::NotificationObserver,
const OVERRIDE;
virtual void MoveContents(content::WebContents* source,
const gfx::Rect& pos) OVERRIDE;
- virtual void NavigationStateChanged(const content::WebContents* source,
- unsigned changed_flags) OVERRIDE;
+ virtual void NavigationStateChanged(
+ const content::WebContents* source,
+ content::InvalidateTypes changed_flags) OVERRIDE;
virtual void ToggleFullscreenModeForTab(content::WebContents* source,
bool enter_fullscreen) OVERRIDE;
virtual bool IsFullscreenForTabOrPending(const content::WebContents* source)
@@ -546,8 +545,8 @@ class AppWindow : public content::NotificationObserver,
// taskbar.
bool cached_always_on_top_;
- // Whether |transparent_background| was set in the CreateParams.
- bool requested_transparent_background_;
+ // Whether |alpha_enabled| was set in the CreateParams.
+ bool requested_alpha_enabled_;
DISALLOW_COPY_AND_ASSIGN(AppWindow);
};
diff --git a/apps/app_window_geometry_cache.cc b/apps/app_window_geometry_cache.cc
index ce6290ecec..667595f9ac 100644
--- a/apps/app_window_geometry_cache.cc
+++ b/apps/app_window_geometry_cache.cc
@@ -7,8 +7,6 @@
#include "base/bind.h"
#include "base/stl_util.h"
#include "base/strings/string_number_conversions.h"
-#include "chrome/browser/profiles/incognito_helpers.h"
-#include "chrome/browser/profiles/profile.h"
#include "components/keyed_service/content/browser_context_dependency_manager.h"
#include "extensions/browser/extension_prefs.h"
#include "extensions/browser/extension_prefs_factory.h"
@@ -27,12 +25,12 @@ const int kSyncTimeoutMilliseconds = 1000;
namespace apps {
AppWindowGeometryCache::AppWindowGeometryCache(
- Profile* profile,
+ content::BrowserContext* context,
extensions::ExtensionPrefs* prefs)
: prefs_(prefs),
sync_delay_(base::TimeDelta::FromMilliseconds(kSyncTimeoutMilliseconds)),
extension_registry_observer_(this) {
- extension_registry_observer_.Add(extensions::ExtensionRegistry::Get(profile));
+ extension_registry_observer_.Add(extensions::ExtensionRegistry::Get(context));
}
AppWindowGeometryCache::~AppWindowGeometryCache() {}
@@ -284,9 +282,8 @@ AppWindowGeometryCache::Factory::~Factory() {}
KeyedService* AppWindowGeometryCache::Factory::BuildServiceInstanceFor(
content::BrowserContext* context) const {
- Profile* profile = Profile::FromBrowserContext(context);
- return new AppWindowGeometryCache(profile,
- extensions::ExtensionPrefs::Get(profile));
+ return new AppWindowGeometryCache(context,
+ extensions::ExtensionPrefs::Get(context));
}
bool AppWindowGeometryCache::Factory::ServiceIsNULLWhileTesting() const {
diff --git a/apps/app_window_geometry_cache.h b/apps/app_window_geometry_cache.h
index 8813eea2b0..30f3ad06c4 100644
--- a/apps/app_window_geometry_cache.h
+++ b/apps/app_window_geometry_cache.h
@@ -22,8 +22,6 @@
#include "ui/base/ui_base_types.h"
#include "ui/gfx/rect.h"
-class Profile;
-
namespace extensions {
class ExtensionPrefs;
class ExtensionRegistry;
@@ -69,7 +67,8 @@ class AppWindowGeometryCache : public KeyedService,
virtual ~Observer() {}
};
- AppWindowGeometryCache(Profile* profile, extensions::ExtensionPrefs* prefs);
+ AppWindowGeometryCache(content::BrowserContext* context,
+ extensions::ExtensionPrefs* prefs);
virtual ~AppWindowGeometryCache();
diff --git a/apps/app_window_registry.cc b/apps/app_window_registry.cc
index c6482470e3..67c836ab35 100644
--- a/apps/app_window_registry.cc
+++ b/apps/app_window_registry.cc
@@ -280,13 +280,13 @@ void AppWindowRegistry::CloseAllAppWindows() {
void AppWindowRegistry::OnDevToolsStateChanged(
content::DevToolsAgentHost* agent_host,
bool attached) {
- content::RenderViewHost* rvh = agent_host->GetRenderViewHost();
+ content::WebContents* web_contents = agent_host->GetWebContents();
// Ignore unrelated notifications.
- if (!rvh ||
- rvh->GetSiteInstance()->GetProcess()->GetBrowserContext() != context_)
+ if (!web_contents || web_contents->GetBrowserContext() != context_)
return;
- std::string key = GetWindowKeyForRenderViewHost(this, rvh);
+ std::string key =
+ GetWindowKeyForRenderViewHost(this, web_contents->GetRenderViewHost());
if (key.empty())
return;
diff --git a/apps/apps.gypi b/apps/apps.gypi
index 63dbc48d88..357dcc5f1a 100644
--- a/apps/apps.gypi
+++ b/apps/apps.gypi
@@ -93,6 +93,9 @@
],
['enable_extensions==0',
{
+ 'dependencies!': [
+ 'browser_extensions',
+ ],
'sources/': [
['exclude', '.*'],
['include', 'ui/web_contents_sizer\.cc$'],
diff --git a/apps/custom_launcher_page_contents.cc b/apps/custom_launcher_page_contents.cc
index 2af3d3a963..1c5eeae741 100644
--- a/apps/custom_launcher_page_contents.cc
+++ b/apps/custom_launcher_page_contents.cc
@@ -14,6 +14,7 @@
#include "content/public/browser/site_instance.h"
#include "content/public/browser/web_contents.h"
#include "content/public/common/renderer_preferences.h"
+#include "extensions/browser/view_type_utils.h"
#include "extensions/common/extension_messages.h"
namespace apps {
@@ -45,6 +46,8 @@ void CustomLauncherPageContents::Initialize(content::BrowserContext* context,
context, extension_id_, web_contents_.get(), app_delegate_.get()));
web_contents_->SetDelegate(this);
+ extensions::SetViewType(web_contents(), extensions::VIEW_TYPE_LAUNCHER_PAGE);
+
// This observer will activate the extension when it is navigated to, which
// allows Dispatcher to give it the proper context and makes it behave like an
// extension.
diff --git a/apps/launcher.cc b/apps/launcher.cc
index ca463de5f1..aabbc64892 100644
--- a/apps/launcher.cc
+++ b/apps/launcher.cc
@@ -4,8 +4,8 @@
#include "apps/launcher.h"
-#include <utility>
#include <set>
+#include <utility>
#include "base/command_line.h"
#include "base/file_util.h"
@@ -40,7 +40,7 @@
#include "url/gurl.h"
#if defined(OS_CHROMEOS)
-#include "chrome/browser/chromeos/login/users/user_manager.h"
+#include "components/user_manager/user_manager.h"
#endif
namespace app_runtime = extensions::core_api::app_runtime;
@@ -318,7 +318,7 @@ void LaunchPlatformAppWithCommandLine(Profile* profile,
if (extensions::KioskModeInfo::IsKioskOnly(extension)) {
bool in_kiosk_mode = false;
#if defined(OS_CHROMEOS)
- chromeos::UserManager* user_manager = chromeos::UserManager::Get();
+ user_manager::UserManager* user_manager = user_manager::UserManager::Get();
in_kiosk_mode = user_manager && user_manager->IsLoggedInAsKioskApp();
#endif
if (!in_kiosk_mode) {
diff --git a/apps/ui/views/native_app_window_views.cc b/apps/ui/views/native_app_window_views.cc
index da84d8a182..b2135fca7e 100644
--- a/apps/ui/views/native_app_window_views.cc
+++ b/apps/ui/views/native_app_window_views.cc
@@ -262,8 +262,7 @@ void NativeAppWindowViews::OnWidgetActivationChanged(views::Widget* widget,
void NativeAppWindowViews::RenderViewCreated(
content::RenderViewHost* render_view_host) {
- if (app_window_->requested_transparent_background() &&
- CanHaveAlphaEnabled()) {
+ if (app_window_->requested_alpha_enabled() && CanHaveAlphaEnabled()) {
content::RenderWidgetHostView* view = render_view_host->GetView();
DCHECK(view);
view->SetBackgroundOpaque(false);