| 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/tab_contents/background_contents.h" | 5 #include "chrome/browser/tab_contents/background_contents.h" |
| 6 | 6 |
| 7 #include "chrome/browser/background_contents_service.h" | 7 #include "chrome/browser/background_contents_service.h" |
| 8 #include "chrome/browser/desktop_notification_handler.h" | 8 #include "chrome/browser/desktop_notification_handler.h" |
| 9 #include "chrome/browser/profiles/profile.h" | 9 #include "chrome/browser/profiles/profile.h" |
| 10 #include "chrome/browser/renderer_preferences_util.h" | 10 #include "chrome/browser/renderer_preferences_util.h" |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 NotificationType::BACKGROUND_CONTENTS_NAVIGATED, | 102 NotificationType::BACKGROUND_CONTENTS_NAVIGATED, |
| 103 Source<Profile>(profile), | 103 Source<Profile>(profile), |
| 104 Details<BackgroundContents>(this)); | 104 Details<BackgroundContents>(this)); |
| 105 } | 105 } |
| 106 | 106 |
| 107 void BackgroundContents::RunJavaScriptMessage( | 107 void BackgroundContents::RunJavaScriptMessage( |
| 108 const std::wstring& message, | 108 const std::wstring& message, |
| 109 const std::wstring& default_prompt, | 109 const std::wstring& default_prompt, |
| 110 const GURL& frame_url, | 110 const GURL& frame_url, |
| 111 const int flags, | 111 const int flags, |
| 112 const bool unload_handler_being_run, |
| 112 IPC::Message* reply_msg, | 113 IPC::Message* reply_msg, |
| 113 bool* did_suppress_message) { | 114 bool* did_suppress_message) { |
| 114 // TODO(rafaelw): Implement, The JavaScriptModalDialog needs to learn about | 115 // TODO(rafaelw): Implement, The JavaScriptModalDialog needs to learn about |
| 115 // BackgroundContents. | 116 // BackgroundContents. |
| 116 *did_suppress_message = true; | 117 *did_suppress_message = true; |
| 117 } | 118 } |
| 118 | 119 |
| 119 bool BackgroundContents::PreHandleKeyboardEvent( | 120 bool BackgroundContents::PreHandleKeyboardEvent( |
| 120 const NativeWebKeyboardEvent& event, | 121 const NativeWebKeyboardEvent& event, |
| 121 bool* is_keyboard_shortcut) { | 122 bool* is_keyboard_shortcut) { |
| (...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 260 BackgroundContents* | 261 BackgroundContents* |
| 261 BackgroundContents::GetBackgroundContentsByID(int render_process_id, | 262 BackgroundContents::GetBackgroundContentsByID(int render_process_id, |
| 262 int render_view_id) { | 263 int render_view_id) { |
| 263 RenderViewHost* render_view_host = | 264 RenderViewHost* render_view_host = |
| 264 RenderViewHost::FromID(render_process_id, render_view_id); | 265 RenderViewHost::FromID(render_process_id, render_view_id); |
| 265 if (!render_view_host) | 266 if (!render_view_host) |
| 266 return NULL; | 267 return NULL; |
| 267 | 268 |
| 268 return render_view_host->delegate()->GetAsBackgroundContents(); | 269 return render_view_host->delegate()->GetAsBackgroundContents(); |
| 269 } | 270 } |
| OLD | NEW |