Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(397)

Side by Side Diff: chrome/browser/plugin_observer.cc

Issue 7835004: Moved the following IPCs out of chrome into content where they are handled by (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 9 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/plugin_observer.h" 5 #include "chrome/browser/plugin_observer.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/content_settings/host_content_settings_map.h" 8 #include "chrome/browser/content_settings/host_content_settings_map.h"
9 #include "chrome/browser/google/google_util.h" 9 #include "chrome/browser/google/google_util.h"
10 #include "chrome/browser/infobars/infobar_tab_helper.h" 10 #include "chrome/browser/infobars/infobar_tab_helper.h"
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
286 PluginObserver::PluginObserver(TabContentsWrapper* tab_contents) 286 PluginObserver::PluginObserver(TabContentsWrapper* tab_contents)
287 : TabContentsObserver(tab_contents->tab_contents()), 287 : TabContentsObserver(tab_contents->tab_contents()),
288 tab_contents_(tab_contents) { 288 tab_contents_(tab_contents) {
289 } 289 }
290 290
291 PluginObserver::~PluginObserver() { 291 PluginObserver::~PluginObserver() {
292 } 292 }
293 293
294 bool PluginObserver::OnMessageReceived(const IPC::Message& message) { 294 bool PluginObserver::OnMessageReceived(const IPC::Message& message) {
295 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message) 295 IPC_BEGIN_MESSAGE_MAP(PluginObserver, message)
296 IPC_MESSAGE_HANDLER(ViewHostMsg_CrashedPlugin, OnCrashedPlugin)
297 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin, 296 IPC_MESSAGE_HANDLER(ChromeViewHostMsg_BlockedOutdatedPlugin,
298 OnBlockedOutdatedPlugin) 297 OnBlockedOutdatedPlugin)
299 IPC_MESSAGE_UNHANDLED(return false) 298 IPC_MESSAGE_UNHANDLED(return false)
300 IPC_END_MESSAGE_MAP() 299 IPC_END_MESSAGE_MAP()
301 300
302 return true; 301 return true;
303 } 302 }
304 303
305 void PluginObserver::OnCrashedPlugin(const FilePath& plugin_path) { 304 void PluginObserver::CrashedPlugin(const FilePath& plugin_path) {
jam 2011/09/03 00:10:47 why is this method still here?
ananta 2011/09/03 00:43:23 Removed and moved to browser.cc. No reason for it
306 DCHECK(!plugin_path.value().empty()); 305 DCHECK(!plugin_path.value().empty());
307 306
308 string16 plugin_name = plugin_path.LossyDisplayName(); 307 string16 plugin_name = plugin_path.LossyDisplayName();
309 webkit::WebPluginInfo plugin_info; 308 webkit::WebPluginInfo plugin_info;
310 if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath( 309 if (webkit::npapi::PluginList::Singleton()->GetPluginInfoByPath(
311 plugin_path, &plugin_info) && 310 plugin_path, &plugin_info) &&
312 !plugin_info.name.empty()) { 311 !plugin_info.name.empty()) {
313 plugin_name = plugin_info.name; 312 plugin_name = plugin_info.name;
314 #if defined(OS_MACOSX) 313 #if defined(OS_MACOSX)
315 // Many plugins on the Mac have .plugin in the actual name, which looks 314 // Many plugins on the Mac have .plugin in the actual name, which looks
(...skipping 13 matching lines...) Expand all
329 true)); 328 true));
330 } 329 }
331 330
332 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name, 331 void PluginObserver::OnBlockedOutdatedPlugin(const string16& name,
333 const GURL& update_url) { 332 const GURL& update_url) {
334 tab_contents_->infobar_tab_helper()->AddInfoBar(update_url.is_empty() ? 333 tab_contents_->infobar_tab_helper()->AddInfoBar(update_url.is_empty() ?
335 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate( 334 static_cast<InfoBarDelegate*>(new BlockedPluginInfoBarDelegate(
336 tab_contents(), name)) : 335 tab_contents(), name)) :
337 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url)); 336 new OutdatedPluginInfoBarDelegate(tab_contents(), name, update_url));
338 } 337 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698