| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/tab_first_render_watcher.h" | 5 #include "chrome/browser/tab_first_render_watcher.h" |
| 6 | 6 |
| 7 #include "content/browser/renderer_host/render_widget_host.h" | 7 #include "content/browser/renderer_host/render_widget_host.h" |
| 8 #include "content/browser/renderer_host/render_view_host.h" | 8 #include "content/browser/renderer_host/render_view_host.h" |
| 9 #include "content/public/browser/notification_details.h" | 9 #include "content/public/browser/notification_details.h" |
| 10 #include "content/public/browser/notification_source.h" | 10 #include "content/public/browser/notification_source.h" |
| 11 #include "content/public/browser/notification_types.h" | 11 #include "content/public/browser/notification_types.h" |
| 12 | 12 |
| 13 namespace chromeos { | |
| 14 | |
| 15 TabFirstRenderWatcher::TabFirstRenderWatcher(TabContents* tab, | 13 TabFirstRenderWatcher::TabFirstRenderWatcher(TabContents* tab, |
| 16 Delegate* delegate) | 14 Delegate* delegate) |
| 17 : state_(NONE), | 15 : state_(NONE), |
| 18 tab_contents_(tab), | 16 tab_contents_(tab), |
| 19 delegate_(delegate) { | 17 delegate_(delegate) { |
| 20 registrar_.Add(this, | 18 registrar_.Add(this, |
| 21 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, | 19 content::NOTIFICATION_RENDER_VIEW_HOST_CREATED_FOR_TAB, |
| 22 content::Source<TabContents>(tab_contents_)); | 20 content::Source<TabContents>(tab_contents_)); |
| 23 registrar_.Add(this, | 21 registrar_.Add(this, |
| 24 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, | 22 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, |
| (...skipping 22 matching lines...) Expand all Loading... |
| 47 case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: | 45 case content::NOTIFICATION_RENDER_WIDGET_HOST_DID_PAINT: |
| 48 if (state_ == LOADED) { | 46 if (state_ == LOADED) { |
| 49 state_ = FIRST_PAINT; | 47 state_ = FIRST_PAINT; |
| 50 delegate_->OnTabMainFrameFirstRender(); | 48 delegate_->OnTabMainFrameFirstRender(); |
| 51 } | 49 } |
| 52 break; | 50 break; |
| 53 default: | 51 default: |
| 54 NOTREACHED() << "unknown type" << type; | 52 NOTREACHED() << "unknown type" << type; |
| 55 } | 53 } |
| 56 } | 54 } |
| 57 | |
| 58 } // namespace chromeos | |
| OLD | NEW |