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/automation/automation_provider_observers.h" | 5 #include "chrome/browser/automation/automation_provider_observers.h" |
6 | 6 |
7 #include <deque> | 7 #include <deque> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
66 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 66 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
67 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" | 67 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h" |
68 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" | 68 #include "chrome/browser/ui/webui/ntp/most_visited_handler.h" |
69 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" | 69 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" |
70 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" | 70 #include "chrome/browser/ui/webui/ntp/recently_closed_tabs_handler.h" |
71 #include "chrome/common/automation_messages.h" | 71 #include "chrome/common/automation_messages.h" |
72 #include "chrome/common/chrome_notification_types.h" | 72 #include "chrome/common/chrome_notification_types.h" |
73 #include "chrome/common/content_settings_types.h" | 73 #include "chrome/common/content_settings_types.h" |
74 #include "chrome/common/extensions/extension.h" | 74 #include "chrome/common/extensions/extension.h" |
75 #include "content/browser/download/save_package.h" | 75 #include "content/browser/download/save_package.h" |
76 #include "content/browser/renderer_host/render_process_host.h" | |
77 #include "content/browser/renderer_host/render_view_host.h" | 76 #include "content/browser/renderer_host/render_view_host.h" |
78 #include "content/browser/tab_contents/navigation_controller.h" | 77 #include "content/browser/tab_contents/navigation_controller.h" |
79 #include "content/browser/tab_contents/tab_contents.h" | 78 #include "content/browser/tab_contents/tab_contents.h" |
80 #include "content/common/child_process_info.h" | 79 #include "content/common/child_process_info.h" |
81 #include "content/public/browser/notification_service.h" | 80 #include "content/public/browser/notification_service.h" |
| 81 #include "content/public/browser/render_process_host.h" |
82 #include "googleurl/src/gurl.h" | 82 #include "googleurl/src/gurl.h" |
83 #include "third_party/skia/include/core/SkBitmap.h" | 83 #include "third_party/skia/include/core/SkBitmap.h" |
84 #include "ui/gfx/codec/png_codec.h" | 84 #include "ui/gfx/codec/png_codec.h" |
85 #include "ui/gfx/rect.h" | 85 #include "ui/gfx/rect.h" |
86 | 86 |
87 using content::BrowserThread; | 87 using content::BrowserThread; |
88 | 88 |
89 // Holds onto start and stop timestamps for a particular tab | 89 // Holds onto start and stop timestamps for a particular tab |
90 class InitialLoadObserver::TabTime { | 90 class InitialLoadObserver::TabTime { |
91 public: | 91 public: |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
136 } else if (type == content::NOTIFICATION_LOAD_STOP) { | 136 } else if (type == content::NOTIFICATION_LOAD_STOP) { |
137 if (outstanding_tab_count_ > finished_tabs_.size()) { | 137 if (outstanding_tab_count_ > finished_tabs_.size()) { |
138 TabTimeMap::iterator iter = loading_tabs_.find(source.map_key()); | 138 TabTimeMap::iterator iter = loading_tabs_.find(source.map_key()); |
139 if (iter != loading_tabs_.end()) { | 139 if (iter != loading_tabs_.end()) { |
140 finished_tabs_.insert(source.map_key()); | 140 finished_tabs_.insert(source.map_key()); |
141 iter->second.set_stop_time(base::TimeTicks::Now()); | 141 iter->second.set_stop_time(base::TimeTicks::Now()); |
142 } | 142 } |
143 } | 143 } |
144 } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED) { | 144 } else if (type == content::NOTIFICATION_RENDERER_PROCESS_CLOSED) { |
145 base::TerminationStatus status = | 145 base::TerminationStatus status = |
146 content::Details<RenderProcessHost::RendererClosedDetails>(details)-> | 146 content::Details<content::RenderProcessHost::RendererClosedDetails>( |
147 status; | 147 details)->status; |
148 switch (status) { | 148 switch (status) { |
149 case base::TERMINATION_STATUS_NORMAL_TERMINATION: | 149 case base::TERMINATION_STATUS_NORMAL_TERMINATION: |
150 break; | 150 break; |
151 | 151 |
152 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: | 152 case base::TERMINATION_STATUS_ABNORMAL_TERMINATION: |
153 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: | 153 case base::TERMINATION_STATUS_PROCESS_WAS_KILLED: |
154 case base::TERMINATION_STATUS_PROCESS_CRASHED: | 154 case base::TERMINATION_STATUS_PROCESS_CRASHED: |
155 crashed_tab_count_++; | 155 crashed_tab_count_++; |
156 break; | 156 break; |
157 | 157 |
(...skipping 2767 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2925 if (automation_) { | 2925 if (automation_) { |
2926 AutomationJSONReply(automation_, reply_message_.release()) | 2926 AutomationJSONReply(automation_, reply_message_.release()) |
2927 .SendSuccess(NULL); | 2927 .SendSuccess(NULL); |
2928 } | 2928 } |
2929 delete this; | 2929 delete this; |
2930 } | 2930 } |
2931 } else { | 2931 } else { |
2932 NOTREACHED(); | 2932 NOTREACHED(); |
2933 } | 2933 } |
2934 } | 2934 } |
OLD | NEW |