OLD | NEW |
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 "content/browser/web_contents/aura/overscroll_navigation_overlay.h" | 5 #include "content/browser/web_contents/aura/overscroll_navigation_overlay.h" |
6 | 6 |
7 #include "content/browser/frame_host/navigation_entry_impl.h" | 7 #include "content/browser/frame_host/navigation_entry_impl.h" |
8 #include "content/browser/renderer_host/render_view_host_impl.h" | 8 #include "content/browser/renderer_host/render_view_host_impl.h" |
9 #include "content/browser/web_contents/aura/image_window_delegate.h" | 9 #include "content/browser/web_contents/aura/image_window_delegate.h" |
10 #include "content/browser/web_contents/web_contents_impl.h" | 10 #include "content/browser/web_contents/web_contents_impl.h" |
(...skipping 21 matching lines...) Expand all Loading... |
32 void SetImage(const gfx::Image& image) { | 32 void SetImage(const gfx::Image& image) { |
33 image_ = image; | 33 image_ = image; |
34 image_size_ = image.AsImageSkia().size(); | 34 image_size_ = image.AsImageSkia().size(); |
35 } | 35 } |
36 const gfx::Image& image() const { return image_; } | 36 const gfx::Image& image() const { return image_; } |
37 | 37 |
38 private: | 38 private: |
39 // Overridden from ui::LayerDelegate: | 39 // Overridden from ui::LayerDelegate: |
40 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { | 40 virtual void OnPaintLayer(gfx::Canvas* canvas) OVERRIDE { |
41 if (image_.IsEmpty()) { | 41 if (image_.IsEmpty()) { |
42 canvas->DrawColor(SK_ColorGRAY); | 42 canvas->DrawColor(SK_ColorWHITE); |
43 } else { | 43 } else { |
44 SkISize size = canvas->sk_canvas()->getDeviceSize(); | 44 SkISize size = canvas->sk_canvas()->getDeviceSize(); |
45 if (size.width() != image_size_.width() || | 45 if (size.width() != image_size_.width() || |
46 size.height() != image_size_.height()) { | 46 size.height() != image_size_.height()) { |
47 canvas->DrawColor(SK_ColorWHITE); | 47 canvas->DrawColor(SK_ColorWHITE); |
48 } | 48 } |
49 canvas->DrawImageInt(image_.AsImageSkia(), 0, 0); | 49 canvas->DrawImageInt(image_.AsImageSkia(), 0, 0); |
50 } | 50 } |
51 } | 51 } |
52 | 52 |
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
293 // pending entry has been created. | 293 // pending entry has been created. |
294 int committed_entry_id = | 294 int committed_entry_id = |
295 web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID(); | 295 web_contents_->GetController().GetLastCommittedEntry()->GetUniqueID(); |
296 if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) { | 296 if (committed_entry_id == pending_entry_id_ || !pending_entry_id_) { |
297 loading_complete_ = true; | 297 loading_complete_ = true; |
298 StopObservingIfDone(); | 298 StopObservingIfDone(); |
299 } | 299 } |
300 } | 300 } |
301 | 301 |
302 } // namespace content | 302 } // namespace content |
OLD | NEW |