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

Side by Side Diff: content/browser/web_contents/web_contents_view_android.cc

Issue 2380743003: Refactor ContentViewClient (2/6) (Closed)
Patch Set: // Do nothing Created 4 years 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/web_contents/web_contents_view_android.h" 5 #include "content/browser/web_contents/web_contents_view_android.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_string.h" 8 #include "base/android/jni_string.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "cc/layers/layer.h" 10 #include "cc/layers/layer.h"
(...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 : display::Screen::GetScreen()->GetPrimaryDisplay(); 138 : display::Screen::GetScreen()->GetPrimaryDisplay();
139 DisplayToScreenInfo(display, result); 139 DisplayToScreenInfo(display, result);
140 } 140 }
141 141
142 void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const { 142 void WebContentsViewAndroid::GetContainerBounds(gfx::Rect* out) const {
143 *out = content_view_core_ ? gfx::Rect(content_view_core_->GetViewSize()) 143 *out = content_view_core_ ? gfx::Rect(content_view_core_->GetViewSize())
144 : gfx::Rect(); 144 : gfx::Rect();
145 } 145 }
146 146
147 void WebContentsViewAndroid::SetPageTitle(const base::string16& title) { 147 void WebContentsViewAndroid::SetPageTitle(const base::string16& title) {
148 if (content_view_core_) 148 // Do nothing.
149 content_view_core_->SetTitle(title);
150 } 149 }
151 150
152 void WebContentsViewAndroid::SizeContents(const gfx::Size& size) { 151 void WebContentsViewAndroid::SizeContents(const gfx::Size& size) {
153 // TODO(klobag): Do we need to do anything else? 152 // TODO(klobag): Do we need to do anything else?
154 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView(); 153 RenderWidgetHostView* rwhv = web_contents_->GetRenderWidgetHostView();
155 if (rwhv) 154 if (rwhv)
156 rwhv->SetSize(size); 155 rwhv->SetSize(size);
157 } 156 }
158 157
159 void WebContentsViewAndroid::Focus() { 158 void WebContentsViewAndroid::Focus() {
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
365 // This is called when we the renderer asks us to take focus back (i.e., it has 364 // This is called when we the renderer asks us to take focus back (i.e., it has
366 // iterated past the last focusable element on the page). 365 // iterated past the last focusable element on the page).
367 void WebContentsViewAndroid::TakeFocus(bool reverse) { 366 void WebContentsViewAndroid::TakeFocus(bool reverse) {
368 if (web_contents_->GetDelegate() && 367 if (web_contents_->GetDelegate() &&
369 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse)) 368 web_contents_->GetDelegate()->TakeFocus(web_contents_, reverse))
370 return; 369 return;
371 web_contents_->GetRenderWidgetHostView()->Focus(); 370 web_contents_->GetRenderWidgetHostView()->Focus();
372 } 371 }
373 372
374 } // namespace content 373 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698