diff options
author | Allan Sandfeld Jensen <allan.jensen@theqtcompany.com> | 2016-09-14 16:52:41 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2016-09-14 14:57:58 +0000 |
commit | 1ca3e7634f3989aec9631cfbcfd5a46bde4ebf24 (patch) | |
tree | c9faa91be97094e1451ae126819a3672bd7358de /chromium/ui | |
parent | e20ba3c57b50674f625b5088faa0fe9a076c0617 (diff) | |
download | qtwebengine-chromium-1ca3e7634f3989aec9631cfbcfd5a46bde4ebf24.tar.gz |
BASELINE: Update Chromium to 53.0.2785.117
Change-Id: Ie4ea15fc770a1973f58739ce99df06c98d3dda79
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/ui')
17 files changed, 299 insertions, 125 deletions
diff --git a/chromium/ui/android/BUILD.gn b/chromium/ui/android/BUILD.gn index 4387a952eaa..784714ab3cb 100644 --- a/chromium/ui/android/BUILD.gn +++ b/chromium/ui/android/BUILD.gn @@ -117,7 +117,7 @@ java_strings_grd("ui_strings_grd") { "values-uk/android_ui_strings.xml", "values-vi/android_ui_strings.xml", "values-zh-rCN/android_ui_strings.xml", - "values-zh/android_ui_strings.xml", + "values-zh-rTW/android_ui_strings.xml", ] } diff --git a/chromium/ui/arc/notification/arc_custom_notification_item.cc b/chromium/ui/arc/notification/arc_custom_notification_item.cc index 0ef1db6884b..79e4a9a8589 100644 --- a/chromium/ui/arc/notification/arc_custom_notification_item.cc +++ b/chromium/ui/arc/notification/arc_custom_notification_item.cc @@ -7,7 +7,7 @@ #include "base/memory/ptr_util.h" #include "base/strings/string16.h" #include "base/strings/utf_string_conversions.h" -#include "components/exo/notification_surface.h" +#include "components/arc/bitmap/bitmap_type_converters.h" #include "ui/arc/notification/arc_custom_notification_view.h" #include "ui/message_center/notification.h" #include "ui/message_center/notification_types.h" @@ -24,14 +24,7 @@ class ArcNotificationDelegate : public message_center::NotificationDelegate { : item_(item) {} std::unique_ptr<views::View> CreateCustomContent() override { - if (!surface_) - return nullptr; - - return base::MakeUnique<ArcCustomNotificationView>(item_, surface_); - } - - void set_notification_surface(exo::NotificationSurface* surface) { - surface_ = surface; + return base::MakeUnique<ArcCustomNotificationView>(item_); } private: @@ -39,7 +32,6 @@ class ArcNotificationDelegate : public message_center::NotificationDelegate { ~ArcNotificationDelegate() override {} ArcCustomNotificationItem* const item_; - exo::NotificationSurface* surface_ = nullptr; DISALLOW_COPY_AND_ASSIGN(ArcNotificationDelegate); }; @@ -55,13 +47,9 @@ ArcCustomNotificationItem::ArcCustomNotificationItem( message_center, notification_key, profile_id) { - ArcNotificationSurfaceManager::Get()->AddObserver(this); } ArcCustomNotificationItem::~ArcCustomNotificationItem() { - if (ArcNotificationSurfaceManager::Get()) - ArcNotificationSurfaceManager::Get()->RemoveObserver(this); - FOR_EACH_OBSERVER(Observer, observers_, OnItemDestroying()); } @@ -92,13 +80,18 @@ void ArcCustomNotificationItem::UpdateWithArcNotificationData( GURL(), // empty origin url, for system component notifier_id, rich_data, new ArcNotificationDelegate(this))); - exo::NotificationSurface* surface = - ArcNotificationSurfaceManager::Get()->GetSurface(notification_key()); - if (surface) - OnNotificationSurfaceAdded(surface); - pinned_ = rich_data.pinned; - FOR_EACH_OBSERVER(Observer, observers_, OnItemPinnedChanged()); + + if (data.snapshot_image.is_null()) { + snapshot_ = gfx::ImageSkia(); + } else { + snapshot_ = gfx::ImageSkia(gfx::ImageSkiaRep( + data.snapshot_image.To<SkBitmap>(), data.snapshot_image_scale)); + } + + FOR_EACH_OBSERVER(Observer, observers_, OnItemUpdated()); + + AddToMessageCenter(); } void ArcCustomNotificationItem::CloseFromCloseButton() { @@ -116,24 +109,17 @@ void ArcCustomNotificationItem::RemoveObserver(Observer* observer) { observers_.RemoveObserver(observer); } -void ArcCustomNotificationItem::OnNotificationSurfaceAdded( - exo::NotificationSurface* surface) { - if (!pending_notification() || - surface->notification_id() != notification_key()) { - return; - } - - static_cast<ArcNotificationDelegate*>(pending_notification()->delegate()) - ->set_notification_surface(surface); - AddToMessageCenter(); +void ArcCustomNotificationItem::IncrementWindowRefCount() { + ++window_ref_count_; + if (window_ref_count_ == 1) + manager()->CreateNotificationWindow(notification_key()); } -void ArcCustomNotificationItem::OnNotificationSurfaceRemoved( - exo::NotificationSurface* surface) { - if (surface->notification_id() != notification_key()) - return; - - FOR_EACH_OBSERVER(Observer, observers_, OnItemNotificationSurfaceRemoved()); +void ArcCustomNotificationItem::DecrementWindowRefCount() { + DCHECK_GT(window_ref_count_, 0); + --window_ref_count_; + if (window_ref_count_ == 0) + manager()->CloseNotificationWindow(notification_key()); } } // namespace arc diff --git a/chromium/ui/arc/notification/arc_custom_notification_item.h b/chromium/ui/arc/notification/arc_custom_notification_item.h index 14c9446a7b0..c2069aa4320 100644 --- a/chromium/ui/arc/notification/arc_custom_notification_item.h +++ b/chromium/ui/arc/notification/arc_custom_notification_item.h @@ -8,24 +8,19 @@ #include "base/macros.h" #include "base/observer_list.h" #include "ui/arc/notification/arc_notification_item.h" -#include "ui/arc/notification/arc_notification_surface_manager.h" +#include "ui/gfx/image/image_skia.h" namespace arc { -class ArcCustomNotificationItem - : public ArcNotificationItem, - public ArcNotificationSurfaceManager::Observer { +class ArcCustomNotificationItem : public ArcNotificationItem { public: class Observer { public: // Invoked when the notification data for this item has changed. virtual void OnItemDestroying() = 0; - // Invoked when the pinned stated is changed. - virtual void OnItemPinnedChanged() = 0; - - // Invoked when the notification surface for this item is gone. - virtual void OnItemNotificationSurfaceRemoved() = 0; + // Invoked when the notification data for the item is updated. + virtual void OnItemUpdated() = 0; protected: virtual ~Observer() = default; @@ -45,14 +40,22 @@ class ArcCustomNotificationItem void AddObserver(Observer* observer); void RemoveObserver(Observer* observer); + // Increment |window_ref_count_| and a CreateNotificationWindow request + // is sent when |window_ref_count_| goes from zero to one. + void IncrementWindowRefCount(); + + // Decrement |window_ref_count_| and a CloseNotificationWindow request + // is sent when |window_ref_count_| goes from one to zero. + void DecrementWindowRefCount(); + bool pinned() const { return pinned_; } + const gfx::ImageSkia& snapshot() const { return snapshot_; } private: - // ArcNotificationSurfaceManager::Observer: - void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; - void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; - bool pinned_ = false; + gfx::ImageSkia snapshot_; + int window_ref_count_ = 0; + base::ObserverList<Observer> observers_; DISALLOW_COPY_AND_ASSIGN(ArcCustomNotificationItem); diff --git a/chromium/ui/arc/notification/arc_custom_notification_view.cc b/chromium/ui/arc/notification/arc_custom_notification_view.cc index 7c171d135e8..8e0c9c9068d 100644 --- a/chromium/ui/arc/notification/arc_custom_notification_view.cc +++ b/chromium/ui/arc/notification/arc_custom_notification_view.cc @@ -12,6 +12,8 @@ #include "ui/compositor/layer_animation_observer.h" #include "ui/display/screen.h" #include "ui/events/event_handler.h" +#include "ui/gfx/canvas.h" +#include "ui/gfx/image/image_skia.h" #include "ui/gfx/transform.h" #include "ui/message_center/message_center_style.h" #include "ui/resources/grit/ui_resources.h" @@ -31,7 +33,17 @@ class ArcCustomNotificationView::EventForwarder : public ui::EventHandler { private: // ui::EventHandler - void OnEvent(ui::Event* event) override { owner_->OnEvent(event); } + void OnEvent(ui::Event* event) override { + // Do not forward event targeted to the floating close button so that + // keyboard press and tap are handled properly. + if (owner_->floating_close_button_widget_ && event->target() && + owner_->floating_close_button_widget_->GetNativeWindow() == + event->target()) { + return; + } + + owner_->OnEvent(event); + } ArcCustomNotificationView* const owner_; @@ -104,40 +116,56 @@ class ArcCustomNotificationView::SlideHelper }; ArcCustomNotificationView::ArcCustomNotificationView( - ArcCustomNotificationItem* item, - exo::NotificationSurface* surface) - : item_(item), event_forwarder_(new EventForwarder(this)) { - SetSurface(surface); + ArcCustomNotificationItem* item) + : item_(item), + notification_key_(item->notification_key()), + event_forwarder_(new EventForwarder(this)) { + item_->IncrementWindowRefCount(); item_->AddObserver(this); - OnItemPinnedChanged(); + + ArcNotificationSurfaceManager::Get()->AddObserver(this); + exo::NotificationSurface* surface = + ArcNotificationSurfaceManager::Get()->GetSurface(notification_key_); + if (surface) + OnNotificationSurfaceAdded(surface); // Create a layer as an anchor to insert surface copy during a slide. SetPaintToLayer(true); + UpdatePreferredSize(); } ArcCustomNotificationView::~ArcCustomNotificationView() { SetSurface(nullptr); - if (item_) + if (item_) { + item_->DecrementWindowRefCount(); item_->RemoveObserver(this); + } + + if (ArcNotificationSurfaceManager::Get()) + ArcNotificationSurfaceManager::Get()->RemoveObserver(this); } void ArcCustomNotificationView::CreateFloatingCloseButton() { + if (!surface_) + return; + floating_close_button_ = new views::ImageButton(this); floating_close_button_->set_background( views::Background::CreateSolidBackground(SK_ColorTRANSPARENT)); - floating_close_button_->SetBorder( - views::Border::CreateEmptyBorder(5, 5, 5, 5)); + + // The sizes below are in DIPs. + constexpr int kPaddingFromBorder = 4; + constexpr int kImageSize = 16; + constexpr int kTouchExtendedPadding = + message_center::kControlButtonSize - kImageSize - kPaddingFromBorder; + floating_close_button_->SetBorder(views::Border::CreateEmptyBorder( + kPaddingFromBorder, kTouchExtendedPadding, kTouchExtendedPadding, + kPaddingFromBorder)); ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); floating_close_button_->SetImage( views::CustomButton::STATE_NORMAL, - rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE)); - floating_close_button_->SetImage( - views::CustomButton::STATE_HOVERED, - rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE_HOVER)); - floating_close_button_->SetImage( - views::CustomButton::STATE_PRESSED, - rb.GetImageSkiaNamed(IDR_NOTIFICATION_CLOSE_PRESSED)); + rb.GetImageSkiaNamed(IDR_ARC_NOTIFICATION_CLOSE)); floating_close_button_->set_animate_on_state_change(false); floating_close_button_->SetAccessibleName(l10n_util::GetStringUTF16( IDS_MESSAGE_CENTER_CLOSE_NOTIFICATION_BUTTON_ACCESSIBLE_NAME)); @@ -168,11 +196,21 @@ void ArcCustomNotificationView::SetSurface(exo::NotificationSurface* surface) { if (surface_ && surface_->window()) { surface_->window()->AddObserver(this); surface_->window()->AddPreTargetHandler(event_forwarder_.get()); + + if (GetWidget()) + AttachSurface(); + + UpdatePinnedState(); } } void ArcCustomNotificationView::UpdatePreferredSize() { - gfx::Size preferred_size = surface_->GetSize(); + gfx::Size preferred_size = + surface_ ? surface_->GetSize() : item_ ? item_->snapshot().size() + : gfx::Size(); + if (preferred_size.IsEmpty()) + return; + if (preferred_size.width() != message_center::kNotificationWidth) { const float scale = static_cast<float>(message_center::kNotificationWidth) / preferred_size.width(); @@ -199,6 +237,34 @@ void ArcCustomNotificationView::UpdateCloseButtonVisiblity() { floating_close_button_widget_->Hide(); } +void ArcCustomNotificationView::UpdatePinnedState() { + if (item_->pinned() && floating_close_button_widget_) { + floating_close_button_widget_.reset(); + } else if (!item_->pinned() && !floating_close_button_widget_) { + CreateFloatingCloseButton(); + } +} + +void ArcCustomNotificationView::UpdateSnapshot() { + // Bail if we have a |surface_| because it controls the sizes and paints UI. + if (surface_) + return; + + UpdatePreferredSize(); + SchedulePaint(); +} + +void ArcCustomNotificationView::AttachSurface() { + if (!GetWidget()) + return; + + UpdatePreferredSize(); + Attach(surface_->window()); + + // Creates slide helper after this view is added to its parent. + slide_helper_.reset(new SlideHelper(this)); +} + void ArcCustomNotificationView::ViewHierarchyChanged( const views::View::ViewHierarchyChangedDetails& details) { views::Widget* widget = GetWidget(); @@ -219,11 +285,7 @@ void ArcCustomNotificationView::ViewHierarchyChanged( if (!widget || !surface_ || !details.is_add) return; - UpdatePreferredSize(); - Attach(surface_->window()); - - // Creates slide helper after this view is added to its parent. - slide_helper_.reset(new SlideHelper(this)); + AttachSurface(); } void ArcCustomNotificationView::Layout() { @@ -256,6 +318,19 @@ void ArcCustomNotificationView::Layout() { UpdateCloseButtonVisiblity(); } +void ArcCustomNotificationView::OnPaint(gfx::Canvas* canvas) { + views::NativeViewHost::OnPaint(canvas); + + // Bail if there is a |surface_| or no item or no snapshot image. + if (surface_ || !item_ || item_->snapshot().isNull()) + return; + const gfx::Rect contents_bounds = GetContentsBounds(); + canvas->DrawImageInt(item_->snapshot(), 0, 0, item_->snapshot().width(), + item_->snapshot().height(), contents_bounds.x(), + contents_bounds.y(), contents_bounds.width(), + contents_bounds.height(), false); +} + void ArcCustomNotificationView::OnKeyEvent(ui::KeyEvent* event) { // Forward to parent CustomNotificationView to handle keyboard dismissal. parent()->OnKeyEvent(event); @@ -290,7 +365,7 @@ void ArcCustomNotificationView::OnWindowBoundsChanged( } void ArcCustomNotificationView::OnWindowDestroying(aura::Window* window) { - window->RemoveObserver(this); + SetSurface(nullptr); } void ArcCustomNotificationView::OnItemDestroying() { @@ -302,15 +377,24 @@ void ArcCustomNotificationView::OnItemDestroying() { SetSurface(nullptr); } -void ArcCustomNotificationView::OnItemPinnedChanged() { - if (item_->pinned() && floating_close_button_widget_) { - floating_close_button_widget_.reset(); - } else if (!item_->pinned() && !floating_close_button_widget_) { - CreateFloatingCloseButton(); - } +void ArcCustomNotificationView::OnItemUpdated() { + UpdatePinnedState(); + UpdateSnapshot(); } -void ArcCustomNotificationView::OnItemNotificationSurfaceRemoved() { +void ArcCustomNotificationView::OnNotificationSurfaceAdded( + exo::NotificationSurface* surface) { + if (surface->notification_id() != notification_key_) + return; + + SetSurface(surface); +} + +void ArcCustomNotificationView::OnNotificationSurfaceRemoved( + exo::NotificationSurface* surface) { + if (surface->notification_id() != notification_key_) + return; + SetSurface(nullptr); } diff --git a/chromium/ui/arc/notification/arc_custom_notification_view.h b/chromium/ui/arc/notification/arc_custom_notification_view.h index 4f2a4e3ebc1..2c0b58d67d8 100644 --- a/chromium/ui/arc/notification/arc_custom_notification_view.h +++ b/chromium/ui/arc/notification/arc_custom_notification_view.h @@ -10,6 +10,7 @@ #include "base/macros.h" #include "ui/arc/notification/arc_custom_notification_item.h" +#include "ui/arc/notification/arc_notification_surface_manager.h" #include "ui/aura/window_observer.h" #include "ui/views/controls/button/button.h" #include "ui/views/controls/native/native_view_host.h" @@ -25,13 +26,14 @@ class Widget; namespace arc { -class ArcCustomNotificationView : public views::NativeViewHost, - public views::ButtonListener, - public aura::WindowObserver, - public ArcCustomNotificationItem::Observer { +class ArcCustomNotificationView + : public views::NativeViewHost, + public views::ButtonListener, + public aura::WindowObserver, + public ArcCustomNotificationItem::Observer, + public ArcNotificationSurfaceManager::Observer { public: - ArcCustomNotificationView(ArcCustomNotificationItem* item, - exo::NotificationSurface* surface); + explicit ArcCustomNotificationView(ArcCustomNotificationItem* item); ~ArcCustomNotificationView() override; private: @@ -42,11 +44,15 @@ class ArcCustomNotificationView : public views::NativeViewHost, void SetSurface(exo::NotificationSurface* surface); void UpdatePreferredSize(); void UpdateCloseButtonVisiblity(); + void UpdatePinnedState(); + void UpdateSnapshot(); + void AttachSurface(); // views::NativeViewHost void ViewHierarchyChanged( const ViewHierarchyChangedDetails& details) override; void Layout() override; + void OnPaint(gfx::Canvas* canvas) override; void OnKeyEvent(ui::KeyEvent* event) override; void OnGestureEvent(ui::GestureEvent* event) override; void OnMouseEntered(const ui::MouseEvent& event) override; @@ -63,12 +69,17 @@ class ArcCustomNotificationView : public views::NativeViewHost, // ArcCustomNotificationItem::Observer void OnItemDestroying() override; - void OnItemPinnedChanged() override; - void OnItemNotificationSurfaceRemoved() override; + void OnItemUpdated() override; + + // ArcNotificationSurfaceManager::Observer: + void OnNotificationSurfaceAdded(exo::NotificationSurface* surface) override; + void OnNotificationSurfaceRemoved(exo::NotificationSurface* surface) override; ArcCustomNotificationItem* item_ = nullptr; exo::NotificationSurface* surface_ = nullptr; + const std::string notification_key_; + // A pre-target event handler to forward events on the surface to this view. // Using a pre-target event handler instead of a target handler on the surface // window because it has descendant aura::Window and the events on them need diff --git a/chromium/ui/arc/notification/arc_notification_item.h b/chromium/ui/arc/notification/arc_notification_item.h index e59515e5d34..3c5131b075f 100644 --- a/chromium/ui/arc/notification/arc_notification_item.h +++ b/chromium/ui/arc/notification/arc_notification_item.h @@ -39,6 +39,8 @@ class ArcNotificationItem { void Click(); void ButtonClick(int button_index); + const std::string& notification_key() const { return notification_key_; } + protected: static int ConvertAndroidPriority(int android_priority); static gfx::Image ConvertAndroidSmallIcon( @@ -59,9 +61,9 @@ class ArcNotificationItem { bool CalledOnValidThread() const; const AccountId& profile_id() const { return profile_id_; } - const std::string& notification_key() const { return notification_key_; } const std::string& notification_id() const { return notification_id_; } message_center::MessageCenter* message_center() { return message_center_; } + ArcNotificationManager* manager() { return manager_; } message_center::Notification* pending_notification() { return notification_.get(); diff --git a/chromium/ui/arc/notification/arc_notification_manager.cc b/chromium/ui/arc/notification/arc_notification_manager.cc index 0c226ce8682..ef70ba88a6d 100644 --- a/chromium/ui/arc/notification/arc_notification_manager.cc +++ b/chromium/ui/arc/notification/arc_notification_manager.cc @@ -13,6 +13,13 @@ namespace arc { +namespace { + +// Min version to support Create/CloseNotificationWindow. +constexpr int kMinVersionNotificationWindow = 7; + +} // namespace + ArcNotificationManager::ArcNotificationManager(ArcBridgeService* bridge_service, const AccountId& main_profile_id) : ArcNotificationManager(bridge_service, @@ -191,6 +198,57 @@ void ArcNotificationManager::SendNotificationButtonClickedOnChrome( notifications_instance->SendNotificationEventToAndroid(key, command); } +void ArcNotificationManager::CreateNotificationWindow(const std::string& key) { + if (items_.find(key) == items_.end()) { + VLOG(3) << "Chrome requests to create window on notification (key: " << key + << "), but it is gone."; + return; + } + + auto* notifications_instance = + arc_bridge_service()->notifications()->instance(); + // On shutdown, the ARC channel may quit earlier then notifications. + if (!notifications_instance) { + VLOG(2) << "Request to create window for ARC Notification (key: " << key + << "), but the ARC channel has already gone."; + return; + } + + if (arc_bridge_service()->notifications()->version() < + kMinVersionNotificationWindow) { + VLOG(2) + << "NotificationInstance does not support CreateNotificationWindow."; + return; + } + + notifications_instance->CreateNotificationWindow(key); +} + +void ArcNotificationManager::CloseNotificationWindow(const std::string& key) { + if (items_.find(key) == items_.end()) { + VLOG(3) << "Chrome requests to close window on notification (key: " << key + << "), but it is gone."; + return; + } + + auto* notifications_instance = + arc_bridge_service()->notifications()->instance(); + // On shutdown, the ARC channel may quit earlier then notifications. + if (!notifications_instance) { + VLOG(2) << "Request to close window for ARC Notification (key: " << key + << "), but the ARC channel has already gone."; + return; + } + + if (arc_bridge_service()->notifications()->version() < + kMinVersionNotificationWindow) { + VLOG(2) << "NotificationInstance does not support CloseNotificationWindow."; + return; + } + + notifications_instance->CloseNotificationWindow(key); +} + void ArcNotificationManager::OnToastPosted(mojom::ArcToastDataPtr data) { ash::Shell::GetInstance()->toast_manager()->Show( ash::ToastData(data->id, data->text, data->duration, data->dismiss_text)); diff --git a/chromium/ui/arc/notification/arc_notification_manager.h b/chromium/ui/arc/notification/arc_notification_manager.h index 26fe9692f7c..d8932e1b63f 100644 --- a/chromium/ui/arc/notification/arc_notification_manager.h +++ b/chromium/ui/arc/notification/arc_notification_manager.h @@ -49,6 +49,8 @@ class ArcNotificationManager void SendNotificationClickedOnChrome(const std::string& key); void SendNotificationButtonClickedOnChrome(const std::string& key, int button_index); + void CreateNotificationWindow(const std::string& key); + void CloseNotificationWindow(const std::string& key); private: const AccountId main_profile_id_; diff --git a/chromium/ui/gl/BUILD.gn b/chromium/ui/gl/BUILD.gn index 9aa8c1e0b21..ff658533ba1 100644 --- a/chromium/ui/gl/BUILD.gn +++ b/chromium/ui/gl/BUILD.gn @@ -125,10 +125,7 @@ component("gl") { configs += [ "//build/config:precompiled_headers" ] defines = [ "GL_IMPLEMENTATION" ] - include_dirs = [ - "//third_party/swiftshader/include", - "//third_party/mesa/src/include", - ] + include_dirs = [ "//third_party/mesa/src/include" ] all_dependent_configs = [ ":gl_config" ] @@ -239,6 +236,10 @@ component("gl") { libs = [ "dwmapi.lib" ] ldflags = [ "/DELAYLOAD:dwmapi.dll" ] + if (is_official_build) { + include_dirs += [ "//third_party/swiftshader/include" ] + } + data_deps = [ "//third_party/angle:libEGL", "//third_party/angle:libGLESv2", diff --git a/chromium/ui/gl/gl.gyp b/chromium/ui/gl/gl.gyp index 0178fa37d7c..58ac977ce07 100644 --- a/chromium/ui/gl/gl.gyp +++ b/chromium/ui/gl/gl.gyp @@ -26,7 +26,6 @@ 'GL_IMPLEMENTATION', ], 'include_dirs': [ - '<(DEPTH)/third_party/swiftshader/include', '<(DEPTH)/third_party/khronos', ], 'export_dependent_settings': [ @@ -242,6 +241,9 @@ '<(DEPTH)/third_party/angle/src/angle.gyp:libEGL', '<(DEPTH)/third_party/angle/src/angle.gyp:libGLESv2', ], + 'include_dirs': [ + '<(DEPTH)/third_party/swiftshader/include', + ], }], ['OS=="mac"', { 'sources': [ diff --git a/chromium/ui/gl/gl_image_ozone_native_pixmap.cc b/chromium/ui/gl/gl_image_ozone_native_pixmap.cc index 977f02e424f..207a83e2488 100644 --- a/chromium/ui/gl/gl_image_ozone_native_pixmap.cc +++ b/chromium/ui/gl/gl_image_ozone_native_pixmap.cc @@ -96,6 +96,32 @@ EGLint FourCC(gfx::BufferFormat format) { return 0; } +#if !defined(ARCH_CPU_X86_FAMILY) +bool IsFormatCrCb(gfx::BufferFormat format) { + switch (format) { + case gfx::BufferFormat::YVU_420: + return true; + case gfx::BufferFormat::R_8: + case gfx::BufferFormat::BGR_565: + case gfx::BufferFormat::RGBA_8888: + case gfx::BufferFormat::RGBX_8888: + case gfx::BufferFormat::BGRA_8888: + case gfx::BufferFormat::BGRX_8888: + case gfx::BufferFormat::ATC: + case gfx::BufferFormat::ATCIA: + case gfx::BufferFormat::DXT1: + case gfx::BufferFormat::DXT5: + case gfx::BufferFormat::ETC1: + case gfx::BufferFormat::RGBA_4444: + case gfx::BufferFormat::YUV_420_BIPLANAR: + case gfx::BufferFormat::UYVY_422: + return false; + } + NOTREACHED(); + return false; +} +#endif + } // namespace GLImageOzoneNativePixmap::GLImageOzoneNativePixmap(const gfx::Size& size, @@ -137,16 +163,32 @@ bool GLImageOzoneNativePixmap::Initialize(ui::NativePixmap* pixmap, attrs.push_back(EGL_LINUX_DRM_FOURCC_EXT); attrs.push_back(FourCC(format)); - for (size_t plane = 0; - plane < gfx::NumberOfPlanesForBufferFormat(pixmap->GetBufferFormat()); - ++plane) { - attrs.push_back(EGL_DMA_BUF_PLANE0_FD_EXT + plane * 3); - attrs.push_back( - pixmap->GetDmaBufFd(plane < pixmap->GetDmaBufFdCount() ? plane : 0)); - attrs.push_back(EGL_DMA_BUF_PLANE0_OFFSET_EXT + plane * 3); - attrs.push_back(pixmap->GetDmaBufOffset(plane)); - attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + plane * 3); - attrs.push_back(pixmap->GetDmaBufPitch(plane)); + for (size_t attrs_plane = 0; + attrs_plane < + gfx::NumberOfPlanesForBufferFormat(pixmap->GetBufferFormat()); + ++attrs_plane) { + size_t pixmap_plane = attrs_plane; + +// TODO(dcastagna): Intel mesa flips V and U when the fourcc format is a +// CrCb format therefore we don't need to. +// Once crbug.com/646137 is addressed this ifdef (but not its content) can be +// removed. +#if !defined(ARCH_CPU_X86_FAMILY) + // EGL_EXT_image_dma_buf_import always expects U and V as plane 1 and 2 in + // case of a YUV/YVU format. We swap U and V plane indexes for CrCb + // multi-planar formats. + if (IsFormatCrCb(format) && + gfx::NumberOfPlanesForBufferFormat(pixmap->GetBufferFormat()) == 3 && + attrs_plane) { + pixmap_plane = 3 - attrs_plane; + } +#endif + attrs.push_back(pixmap->GetDmaBufFd( + pixmap_plane < pixmap->GetDmaBufFdCount() ? pixmap_plane : 0)); + attrs.push_back(EGL_DMA_BUF_PLANE0_OFFSET_EXT + attrs_plane * 3); + attrs.push_back(pixmap->GetDmaBufOffset(pixmap_plane)); + attrs.push_back(EGL_DMA_BUF_PLANE0_PITCH_EXT + attrs_plane * 3); + attrs.push_back(pixmap->GetDmaBufPitch(pixmap_plane)); } attrs.push_back(EGL_NONE); diff --git a/chromium/ui/login/display_manager.js b/chromium/ui/login/display_manager.js index 626bf7b9181..702590d13f7 100644 --- a/chromium/ui/login/display_manager.js +++ b/chromium/ui/login/display_manager.js @@ -42,8 +42,6 @@ /** @const */ var ACCELERATOR_KIOSK_ENABLE = 'kiosk_enable'; /** @const */ var ACCELERATOR_VERSION = 'version'; /** @const */ var ACCELERATOR_RESET = 'reset'; -/** @const */ var ACCELERATOR_FOCUS_PREV = 'focus_prev'; -/** @const */ var ACCELERATOR_FOCUS_NEXT = 'focus_next'; /** @const */ var ACCELERATOR_DEVICE_REQUISITION = 'device_requisition'; /** @const */ var ACCELERATOR_DEVICE_REQUISITION_REMORA = 'device_requisition_remora'; @@ -285,7 +283,7 @@ cr.define('cr.ui.login', function() { set forceKeyboardFlow(value) { this.forceKeyboardFlow_ = value; if (value) { - keyboard.initializeKeyboardFlow(); + keyboard.initializeKeyboardFlow(false); cr.ui.DropDown.enableKeyboardFlow(); for (var i = 0; i < this.screens_.length; ++i) { var screen = $(this.screens_[i]); @@ -376,14 +374,6 @@ cr.define('cr.ui.login', function() { if (currentStepId == SCREEN_GAIA_SIGNIN) chrome.send('toggleEasyBootstrap'); } - - // Handle special accelerators for keyboard enhanced navigation flow. - if (this.forceKeyboardFlow_) { - if (name == ACCELERATOR_FOCUS_PREV) - keyboard.raiseKeyFocusPrevious(document.activeElement); - else if (name == ACCELERATOR_FOCUS_NEXT) - keyboard.raiseKeyFocusNext(document.activeElement); - } }, /** diff --git a/chromium/ui/message_center/views/message_center_bubble.cc b/chromium/ui/message_center/views/message_center_bubble.cc index 8b1b7705c64..d922c78f792 100644 --- a/chromium/ui/message_center/views/message_center_bubble.cc +++ b/chromium/ui/message_center/views/message_center_bubble.cc @@ -107,15 +107,6 @@ void MessageCenterBubble::InitializeContents( // |new_bubble_view| actually wants. See crbug.com/169390. bubble_view()->Layout(); UpdateBubbleView(); - views::FocusManager* focus_manager = bubble_view()->GetFocusManager(); - // new_bubble_view should be a top level view and have a focus manager. - DCHECK(focus_manager); - views::View* next_focusable_view = focus_manager - ->GetNextFocusableView(nullptr, nullptr, false, false); - // The bubble may not have any focusable view (eg. on lock screen). In such - // case, |next_focusable_view| is null. - if (next_focusable_view) - next_focusable_view->RequestFocus(); } void MessageCenterBubble::OnBubbleViewDestroyed() { diff --git a/chromium/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc b/chromium/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc index eba9b9a9ce2..8d619eba491 100644 --- a/chromium/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc +++ b/chromium/ui/ozone/platform/drm/host/drm_gpu_platform_support_host.cc @@ -254,7 +254,8 @@ bool DrmGpuPlatformSupportHost::OnMessageReceivedForDrmOverlayManager( IPC_BEGIN_MESSAGE_MAP(DrmGpuPlatformSupportHost, message) IPC_MESSAGE_HANDLER(OzoneHostMsg_OverlayCapabilitiesReceived, OnOverlayResult) - // TODO(rjk): insert the extra + // TODO(rjk): insert the extra + IPC_MESSAGE_UNHANDLED(handled = false) IPC_END_MESSAGE_MAP() return handled; } diff --git a/chromium/ui/resources/default_100_percent/common/arc_notification_close.png b/chromium/ui/resources/default_100_percent/common/arc_notification_close.png Binary files differnew file mode 100644 index 00000000000..132fdb54ed2 --- /dev/null +++ b/chromium/ui/resources/default_100_percent/common/arc_notification_close.png diff --git a/chromium/ui/resources/default_200_percent/common/arc_notification_close.png b/chromium/ui/resources/default_200_percent/common/arc_notification_close.png Binary files differnew file mode 100644 index 00000000000..ade12e3a3d2 --- /dev/null +++ b/chromium/ui/resources/default_200_percent/common/arc_notification_close.png diff --git a/chromium/ui/resources/ui_resources.grd b/chromium/ui/resources/ui_resources.grd index 6813702c7c6..b663ed1024d 100644 --- a/chromium/ui/resources/ui_resources.grd +++ b/chromium/ui/resources/ui_resources.grd @@ -152,6 +152,7 @@ <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_CLOSE" file="common/notification_close.png"/> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_CLOSE_HOVER" file="common/notification_close_hover.png"/> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_CLOSE_PRESSED" file="common/notification_close_pressed.png"/> + <structure type="chrome_scaled_image" name="IDR_ARC_NOTIFICATION_CLOSE" file="common/arc_notification_close.png"/> </if> <if expr="desktop_linux and use_aura"> <structure type="chrome_scaled_image" name="IDR_NOTIFICATION_BUBBLE_CLOSE" file="common/notification_bubble_close.png"/> |