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

Side by Side Diff: chrome/browser/ui/web_contents_sizer.cc

Issue 503233003: Add AppDelegate::ResizeWebContents (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Call the right function Created 6 years, 3 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
« no previous file with comments | « chrome/browser/ui/web_contents_sizer.h ('k') | chrome/browser/ui/web_contents_sizer.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "apps/ui/web_contents_sizer.h" 5 #include "chrome/browser/ui/web_contents_sizer.h"
6 6
7 #include "content/public/browser/web_contents.h" 7 #include "content/public/browser/web_contents.h"
8 8
9 #if defined(USE_AURA) 9 #if defined(USE_AURA)
10 #include "ui/aura/window.h" 10 #include "ui/aura/window.h"
11 #elif defined(OS_ANDROID) 11 #elif defined(OS_ANDROID)
12 #include "content/public/browser/render_widget_host_view.h" 12 #include "content/public/browser/render_widget_host_view.h"
13 #endif 13 #endif
14 14
15 namespace apps {
16
17 void ResizeWebContents(content::WebContents* web_contents, 15 void ResizeWebContents(content::WebContents* web_contents,
18 const gfx::Size& new_size) { 16 const gfx::Size& new_size) {
19 #if defined(USE_AURA) 17 #if defined(USE_AURA)
20 aura::Window* window = web_contents->GetNativeView(); 18 aura::Window* window = web_contents->GetNativeView();
21 window->SetBounds(gfx::Rect(window->bounds().origin(), new_size)); 19 window->SetBounds(gfx::Rect(window->bounds().origin(), new_size));
22 #elif defined(OS_ANDROID) 20 #elif defined(OS_ANDROID)
23 content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView(); 21 content::RenderWidgetHostView* view = web_contents->GetRenderWidgetHostView();
24 if (view) 22 if (view)
25 view->SetSize(new_size); 23 view->SetSize(new_size);
26 #endif 24 #endif
27 } 25 }
28
29 } // namespace apps
OLDNEW
« no previous file with comments | « chrome/browser/ui/web_contents_sizer.h ('k') | chrome/browser/ui/web_contents_sizer.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698