Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(179)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 944763002: Make Page Visibility API work when the browser window is visible or not Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use of SetWindowVisibility message Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/basictypes.h" 8 #include "base/basictypes.h"
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/callback_helpers.h" 10 #include "base/callback_helpers.h"
(...skipping 1412 matching lines...) Expand 10 before | Expand all | Expand 10 after
1423 aura::client::CursorClient* cursor_client = 1423 aura::client::CursorClient* cursor_client =
1424 aura::client::GetCursorClient(root_window); 1424 aura::client::GetCursorClient(root_window);
1425 if (cursor_client) { 1425 if (cursor_client) {
1426 cursor_client->UnlockCursor(); 1426 cursor_client->UnlockCursor();
1427 cursor_client->ShowCursor(); 1427 cursor_client->ShowCursor();
1428 } 1428 }
1429 1429
1430 host_->LostMouseLock(); 1430 host_->LostMouseLock();
1431 } 1431 }
1432 1432
1433 void RenderWidgetHostViewAura::SetWindowVisibility(bool visible) {
1434 if (host_)
1435 host_->Send(new ViewMsg_SetWindowVisibility(host_->GetRoutingID(),
1436 visible));
1437 }
1438
1433 //////////////////////////////////////////////////////////////////////////////// 1439 ////////////////////////////////////////////////////////////////////////////////
1434 // RenderWidgetHostViewAura, ui::TextInputClient implementation: 1440 // RenderWidgetHostViewAura, ui::TextInputClient implementation:
1435 void RenderWidgetHostViewAura::SetCompositionText( 1441 void RenderWidgetHostViewAura::SetCompositionText(
1436 const ui::CompositionText& composition) { 1442 const ui::CompositionText& composition) {
1437 if (!host_) 1443 if (!host_)
1438 return; 1444 return;
1439 1445
1440 // TODO(suzhe): convert both renderer_host and renderer to use 1446 // TODO(suzhe): convert both renderer_host and renderer to use
1441 // ui::CompositionText. 1447 // ui::CompositionText.
1442 std::vector<blink::WebCompositionUnderline> underlines; 1448 std::vector<blink::WebCompositionUnderline> underlines;
(...skipping 826 matching lines...) Expand 10 before | Expand all | Expand 10 after
2269 // RenderWidgetHostViewAura, aura::WindowTreeHostObserver implementation: 2275 // RenderWidgetHostViewAura, aura::WindowTreeHostObserver implementation:
2270 2276
2271 void RenderWidgetHostViewAura::OnHostMoved(const aura::WindowTreeHost* host, 2277 void RenderWidgetHostViewAura::OnHostMoved(const aura::WindowTreeHost* host,
2272 const gfx::Point& new_origin) { 2278 const gfx::Point& new_origin) {
2273 TRACE_EVENT1("ui", "RenderWidgetHostViewAura::OnHostMoved", 2279 TRACE_EVENT1("ui", "RenderWidgetHostViewAura::OnHostMoved",
2274 "new_origin", new_origin.ToString()); 2280 "new_origin", new_origin.ToString());
2275 2281
2276 UpdateScreenInfo(window_); 2282 UpdateScreenInfo(window_);
2277 } 2283 }
2278 2284
2285 void RenderWidgetHostViewAura::OnHostSetWindowVisibility(
2286 const aura::WindowTreeHost* host, bool visible) {
2287 SetWindowVisibility(visible);
2288 }
2279 //////////////////////////////////////////////////////////////////////////////// 2289 ////////////////////////////////////////////////////////////////////////////////
2280 // RenderWidgetHostViewAura, private: 2290 // RenderWidgetHostViewAura, private:
2281 2291
2282 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { 2292 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() {
2283 if (touch_editing_client_) 2293 if (touch_editing_client_)
2284 touch_editing_client_->OnViewDestroyed(); 2294 touch_editing_client_->OnViewDestroyed();
2285 2295
2286 delegated_frame_host_.reset(); 2296 delegated_frame_host_.reset();
2287 window_observer_.reset(); 2297 window_observer_.reset();
2288 if (window_->GetHost()) 2298 if (window_->GetHost())
(...skipping 404 matching lines...) Expand 10 before | Expand all | Expand 10 after
2693 2703
2694 //////////////////////////////////////////////////////////////////////////////// 2704 ////////////////////////////////////////////////////////////////////////////////
2695 // RenderWidgetHostViewBase, public: 2705 // RenderWidgetHostViewBase, public:
2696 2706
2697 // static 2707 // static
2698 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) { 2708 void RenderWidgetHostViewBase::GetDefaultScreenInfo(WebScreenInfo* results) {
2699 GetScreenInfoForWindow(results, NULL); 2709 GetScreenInfoForWindow(results, NULL);
2700 } 2710 }
2701 2711
2702 } // namespace content 2712 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698