OLD | NEW |
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/renderer_host/render_view_host.h" | 5 #include "content/browser/renderer_host/render_view_host.h" |
6 | 6 |
7 #include <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <utility> | 9 #include <utility> |
10 #include <vector> | 10 #include <vector> |
(...skipping 27 matching lines...) Expand all Loading... |
38 #include "content/public/browser/dom_operation_notification_details.h" | 38 #include "content/public/browser/dom_operation_notification_details.h" |
39 #include "content/public/browser/native_web_keyboard_event.h" | 39 #include "content/public/browser/native_web_keyboard_event.h" |
40 #include "content/public/browser/notification_details.h" | 40 #include "content/public/browser/notification_details.h" |
41 #include "content/public/browser/notification_service.h" | 41 #include "content/public/browser/notification_service.h" |
42 #include "content/public/browser/notification_types.h" | 42 #include "content/public/browser/notification_types.h" |
43 #include "content/public/browser/render_view_host_delegate.h" | 43 #include "content/public/browser/render_view_host_delegate.h" |
44 #include "content/public/browser/render_view_host_observer.h" | 44 #include "content/public/browser/render_view_host_observer.h" |
45 #include "content/public/browser/user_metrics.h" | 45 #include "content/public/browser/user_metrics.h" |
46 #include "content/public/common/bindings_policy.h" | 46 #include "content/public/common/bindings_policy.h" |
47 #include "content/public/common/content_constants.h" | 47 #include "content/public/common/content_constants.h" |
| 48 #include "content/public/common/content_switches.h" |
48 #include "content/public/common/result_codes.h" | 49 #include "content/public/common/result_codes.h" |
49 #include "content/public/common/url_constants.h" | 50 #include "content/public/common/url_constants.h" |
50 #include "net/base/net_util.h" | 51 #include "net/base/net_util.h" |
51 #include "net/url_request/url_request_context_getter.h" | 52 #include "net/url_request/url_request_context_getter.h" |
52 #include "third_party/skia/include/core/SkBitmap.h" | 53 #include "third_party/skia/include/core/SkBitmap.h" |
53 #include "ui/gfx/native_widget_types.h" | 54 #include "ui/gfx/native_widget_types.h" |
54 #include "webkit/fileapi/isolated_context.h" | 55 #include "webkit/fileapi/isolated_context.h" |
55 #include "webkit/glue/context_menu.h" | 56 #include "webkit/glue/context_menu.h" |
56 #include "webkit/glue/webaccessibility.h" | 57 #include "webkit/glue/webaccessibility.h" |
57 #include "webkit/glue/webdropdata.h" | 58 #include "webkit/glue/webdropdata.h" |
(...skipping 144 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 params.frame_name = frame_name; | 203 params.frame_name = frame_name; |
203 params.next_page_id = next_page_id; | 204 params.next_page_id = next_page_id; |
204 Send(new ViewMsg_New(params)); | 205 Send(new ViewMsg_New(params)); |
205 | 206 |
206 // If it's enabled, tell the renderer to set up the Javascript bindings for | 207 // If it's enabled, tell the renderer to set up the Javascript bindings for |
207 // sending messages back to the browser. | 208 // sending messages back to the browser. |
208 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); | 209 Send(new ViewMsg_AllowBindings(routing_id(), enabled_bindings_)); |
209 // Let our delegate know that we created a RenderView. | 210 // Let our delegate know that we created a RenderView. |
210 delegate_->RenderViewCreated(this); | 211 delegate_->RenderViewCreated(this); |
211 | 212 |
| 213 // Invert the color scheme if a flag was set. |
| 214 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kInvertWebContent)) |
| 215 Send(new ViewMsg_InvertWebContent(routing_id(), true)); |
| 216 |
212 FOR_EACH_OBSERVER( | 217 FOR_EACH_OBSERVER( |
213 content::RenderViewHostObserver, observers_, RenderViewHostInitialized()); | 218 content::RenderViewHostObserver, observers_, RenderViewHostInitialized()); |
214 | 219 |
215 return true; | 220 return true; |
216 } | 221 } |
217 | 222 |
218 bool RenderViewHost::IsRenderViewLive() const { | 223 bool RenderViewHost::IsRenderViewLive() const { |
219 return process()->HasConnection() && renderer_initialized_; | 224 return process()->HasConnection() && renderer_initialized_; |
220 } | 225 } |
221 | 226 |
(...skipping 1346 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1568 DomOperationNotificationDetails details(json_string, automation_id); | 1573 DomOperationNotificationDetails details(json_string, automation_id); |
1569 content::NotificationService::current()->Notify( | 1574 content::NotificationService::current()->Notify( |
1570 content::NOTIFICATION_DOM_OPERATION_RESPONSE, | 1575 content::NOTIFICATION_DOM_OPERATION_RESPONSE, |
1571 content::Source<RenderViewHost>(this), | 1576 content::Source<RenderViewHost>(this), |
1572 content::Details<DomOperationNotificationDetails>(&details)); | 1577 content::Details<DomOperationNotificationDetails>(&details)); |
1573 } | 1578 } |
1574 | 1579 |
1575 void RenderViewHost::ClearPowerSaveBlockers() { | 1580 void RenderViewHost::ClearPowerSaveBlockers() { |
1576 STLDeleteValues(&power_save_blockers_); | 1581 STLDeleteValues(&power_save_blockers_); |
1577 } | 1582 } |
OLD | NEW |