chromium-style fixes (#12826)

This commit is contained in:
Jeremy Apthorp 2018-05-03 23:45:12 -07:00 committed by Shelley Vohr
parent 7be30bb249
commit b280ea5579
11 changed files with 30 additions and 21 deletions

View file

@ -323,7 +323,7 @@ void BrowserWindow::BlurWebView() {
}
bool BrowserWindow::IsWebViewFocused() {
auto host_view = web_contents()->GetRenderViewHost()->GetWidget()->GetView();
auto* host_view = web_contents()->GetRenderViewHost()->GetWidget()->GetView();
return host_view && host_view->HasFocus();
}

View file

@ -17,7 +17,7 @@ typedef base::Callback<void(const gfx::Rect&, const SkBitmap&)> OnPaintCallback;
class OffScreenOutputDevice : public viz::SoftwareOutputDevice {
public:
OffScreenOutputDevice(bool transparent, const OnPaintCallback& callback);
~OffScreenOutputDevice();
~OffScreenOutputDevice() override;
// viz::SoftwareOutputDevice:
void Resize(const gfx::Size& pixel_size, float scale_factor) override;

View file

@ -641,11 +641,11 @@ void OffScreenRenderWidgetHostView::Destroy() {
// Guest RWHVs will be destroyed when the associated RWHVGuest is
// destroyed. This parent RWHV may be destroyed first, so disassociate
// the guest RWHVs here without destroying them.
for (auto guest_host_view : guest_host_views_)
for (auto* guest_host_view : guest_host_views_)
guest_host_view->parent_host_view_ = nullptr;
guest_host_views_.clear();
}
for (auto proxy_view : proxy_views_)
for (auto* proxy_view : proxy_views_)
proxy_view->RemoveObserver();
Hide();
}
@ -978,7 +978,7 @@ void OffScreenRenderWidgetHostView::OnPaint(const gfx::Rect& damage_rect,
bitmap, pos.x(), pos.y(), pos.width(), pos.height()));
}
for (auto proxy_view : proxy_views_) {
for (auto* proxy_view : proxy_views_) {
gfx::Rect pos = proxy_view->GetBounds();
damage.Union(pos);
damages.push_back(pos);
@ -1059,7 +1059,7 @@ void OffScreenRenderWidgetHostView::ProcessKeyboardEvent(
void OffScreenRenderWidgetHostView::ProcessMouseEvent(
const blink::WebMouseEvent& event,
const ui::LatencyInfo& latency) {
for (auto proxy_view : proxy_views_) {
for (auto* proxy_view : proxy_views_) {
gfx::Rect bounds = proxy_view->GetBounds();
if (bounds.Contains(event.PositionInWidget().x,
event.PositionInWidget().y)) {
@ -1098,7 +1098,7 @@ void OffScreenRenderWidgetHostView::ProcessMouseEvent(
void OffScreenRenderWidgetHostView::ProcessMouseWheelEvent(
const blink::WebMouseWheelEvent& event,
const ui::LatencyInfo& latency) {
for (auto proxy_view : proxy_views_) {
for (auto* proxy_view : proxy_views_) {
gfx::Rect bounds = proxy_view->GetBounds();
if (bounds.Contains(event.PositionInWidget().x,
event.PositionInWidget().y)) {
@ -1170,7 +1170,7 @@ void OffScreenRenderWidgetHostView::SetFrameRate(int frame_rate) {
SetupFrameRate(true);
for (auto guest_host_view : guest_host_views_)
for (auto* guest_host_view : guest_host_views_)
guest_host_view->SetFrameRate(frame_rate);
}

View file

@ -218,7 +218,7 @@ class OffScreenRenderWidgetHostView
void RemoveGuestHostView(OffScreenRenderWidgetHostView* guest_host);
void AddViewProxy(OffscreenViewProxy* proxy);
void RemoveViewProxy(OffscreenViewProxy* proxy);
void ProxyViewDestroyed(OffscreenViewProxy* proxy);
void ProxyViewDestroyed(OffscreenViewProxy* proxy) override;
void RegisterGuestViewFrameSwappedCallback(
content::RenderWidgetHostViewGuest* guest_host_view);
@ -227,7 +227,7 @@ class OffScreenRenderWidgetHostView
void OnPaint(const gfx::Rect& damage_rect, const SkBitmap& bitmap);
void OnPopupPaint(const gfx::Rect& damage_rect, const SkBitmap& bitmap);
void OnProxyViewPaint(const gfx::Rect& damage_rect);
void OnProxyViewPaint(const gfx::Rect& damage_rect) override;
bool IsPopupWidget() const { return popup_type_ != blink::kWebPopupTypeNone; }

View file

@ -104,7 +104,7 @@ OffScreenWebContentsView::CreateViewForWidget(
render_widget_host->GetView());
}
auto relay = NativeWindowRelay::FromWebContents(web_contents_);
auto* relay = NativeWindowRelay::FromWebContents(web_contents_);
return new OffScreenRenderWidgetHostView(
transparent_, painting_, GetFrameRate(), callback_, render_widget_host,
nullptr, relay->window.get());
@ -113,7 +113,7 @@ OffScreenWebContentsView::CreateViewForWidget(
content::RenderWidgetHostViewBase*
OffScreenWebContentsView::CreateViewForPopupWidget(
content::RenderWidgetHost* render_widget_host) {
auto relay = NativeWindowRelay::FromWebContents(web_contents_);
auto* relay = NativeWindowRelay::FromWebContents(web_contents_);
content::WebContentsImpl* web_contents_impl =
static_cast<content::WebContentsImpl*>(web_contents_);

View file

@ -24,7 +24,7 @@ class OffScreenWebContentsView : public content::WebContentsView,
public content::RenderViewHostDelegateView {
public:
OffScreenWebContentsView(bool transparent, const OnPaintCallback& callback);
~OffScreenWebContentsView();
~OffScreenWebContentsView() override;
void SetWebContents(content::WebContents*);

View file

@ -58,6 +58,7 @@ struct UtteranceContinuousParameters {
// Information about one voice.
struct VoiceData {
VoiceData();
VoiceData(const VoiceData&);
~VoiceData();
std::string name;

View file

@ -45,7 +45,9 @@ UtteranceContinuousParameters::UtteranceContinuousParameters()
VoiceData::VoiceData()
: gender(TTS_GENDER_NONE), remote(false), native(false) {}
VoiceData::~VoiceData() {}
VoiceData::VoiceData(const VoiceData&) = default;
VoiceData::~VoiceData() = default;
//
// Utterance

View file

@ -28,7 +28,9 @@ PrintMsg_Print_Params::PrintMsg_Print_Params()
url(),
should_print_backgrounds(false) {}
PrintMsg_Print_Params::~PrintMsg_Print_Params() {}
PrintMsg_Print_Params::PrintMsg_Print_Params(const PrintMsg_Print_Params&) =
default;
PrintMsg_Print_Params::~PrintMsg_Print_Params() = default;
void PrintMsg_Print_Params::Reset() {
page_size = gfx::Size();
@ -53,8 +55,10 @@ void PrintMsg_Print_Params::Reset() {
}
PrintMsg_PrintPages_Params::PrintMsg_PrintPages_Params() : pages() {}
PrintMsg_PrintPages_Params::PrintMsg_PrintPages_Params(
const PrintMsg_PrintPages_Params&) = default;
PrintMsg_PrintPages_Params::~PrintMsg_PrintPages_Params() {}
PrintMsg_PrintPages_Params::~PrintMsg_PrintPages_Params() = default;
void PrintMsg_PrintPages_Params::Reset() {
params.Reset();

View file

@ -29,6 +29,7 @@
struct PrintMsg_Print_Params {
PrintMsg_Print_Params();
PrintMsg_Print_Params(const PrintMsg_Print_Params&);
~PrintMsg_Print_Params();
// Resets the members of the struct to 0.
@ -58,6 +59,7 @@ struct PrintMsg_Print_Params {
struct PrintMsg_PrintPages_Params {
PrintMsg_PrintPages_Params();
PrintMsg_PrintPages_Params(const PrintMsg_PrintPages_Params&);
~PrintMsg_PrintPages_Params();
// Resets the members of the struct to 0.

View file

@ -401,8 +401,6 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
void RestoreSize();
void CopySelection(const WebPreferences& preferences);
base::WeakPtrFactory<PrepareFrameAndViewForPrint> weak_ptr_factory_;
FrameReference frame_;
blink::WebNode node_to_print_;
bool owns_web_view_;
@ -415,6 +413,8 @@ class PrepareFrameAndViewForPrint : public blink::WebViewClient,
bool should_print_selection_only_;
bool is_printing_started_;
base::WeakPtrFactory<PrepareFrameAndViewForPrint> weak_ptr_factory_;
DISALLOW_COPY_AND_ASSIGN(PrepareFrameAndViewForPrint);
};
@ -423,14 +423,14 @@ PrepareFrameAndViewForPrint::PrepareFrameAndViewForPrint(
blink::WebLocalFrame* frame,
const blink::WebNode& node,
bool ignore_css_margins)
: weak_ptr_factory_(this),
frame_(frame),
: frame_(frame),
node_to_print_(node),
owns_web_view_(false),
expected_pages_count_(0),
should_print_backgrounds_(params.should_print_backgrounds),
should_print_selection_only_(params.selection_only),
is_printing_started_(false) {
is_printing_started_(false),
weak_ptr_factory_(this) {
PrintMsg_Print_Params print_params = params;
if (!should_print_selection_only_ ||
!PrintingNodeOrPdfFrame(frame, node_to_print_)) {