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

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

Issue 192065: Merge 25487 - Strip .plugin off of Mac plugin names when showing the crash in... (Closed) Base URL: svn://chrome-svn/chrome/branches/195/src/
Patch Set: Created 11 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
« no previous file with comments | « base/string_util_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Property Changes:
Modified: svn:mergeinfo
Merged /trunk/src/chrome/browser/tab_contents/tab_contents.cc:r25487
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/tab_contents.h" 5 #include "chrome/browser/tab_contents/tab_contents.h"
6 6
7 #include "app/l10n_util.h" 7 #include "app/l10n_util.h"
8 #include "app/resource_bundle.h" 8 #include "app/resource_bundle.h"
9 #include "base/file_version_info.h" 9 #include "base/file_version_info.h"
10 #include "base/process_util.h" 10 #include "base/process_util.h"
11 #include "base/string16.h" 11 #include "base/string16.h"
12 #include "base/string_util.h"
12 #include "base/time.h" 13 #include "base/time.h"
13 #include "chrome/browser/autofill_manager.h" 14 #include "chrome/browser/autofill_manager.h"
14 #include "chrome/browser/blocked_popup_container.h" 15 #include "chrome/browser/blocked_popup_container.h"
15 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
16 #include "chrome/browser/browser_process.h" 17 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/cert_store.h" 18 #include "chrome/browser/cert_store.h"
18 #include "chrome/browser/debugger/devtools_manager.h" 19 #include "chrome/browser/debugger/devtools_manager.h"
19 #include "chrome/browser/dom_operation_notification_details.h" 20 #include "chrome/browser/dom_operation_notification_details.h"
20 #include "chrome/browser/dom_ui/dom_ui.h" 21 #include "chrome/browser/dom_ui/dom_ui.h"
21 #include "chrome/browser/dom_ui/dom_ui_factory.h" 22 #include "chrome/browser/dom_ui/dom_ui_factory.h"
(...skipping 1546 matching lines...) Expand 10 before | Expand all | Expand 10 after
1568 1569
1569 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) { 1570 void TabContents::OnCrashedPlugin(const FilePath& plugin_path) {
1570 DCHECK(!plugin_path.value().empty()); 1571 DCHECK(!plugin_path.value().empty());
1571 1572
1572 std::wstring plugin_name = plugin_path.ToWStringHack(); 1573 std::wstring plugin_name = plugin_path.ToWStringHack();
1573 #if defined(OS_WIN) 1574 #if defined(OS_WIN)
1574 scoped_ptr<FileVersionInfo> version_info( 1575 scoped_ptr<FileVersionInfo> version_info(
1575 FileVersionInfo::CreateFileVersionInfo(plugin_path)); 1576 FileVersionInfo::CreateFileVersionInfo(plugin_path));
1576 if (version_info.get()) { 1577 if (version_info.get()) {
1577 const std::wstring& product_name = version_info->product_name(); 1578 const std::wstring& product_name = version_info->product_name();
1578 if (!product_name.empty()) 1579 if (!product_name.empty()) {
1579 plugin_name = product_name; 1580 plugin_name = product_name;
1581 #if defined(OS_MACOSX)
1582 // Many plugins on the Mac have .plugin in the actual name, which looks
1583 // terrible, so look for that and strip it off if present.
1584 const std::wstring plugin_extension(L".plugin");
1585 if (EndsWith(plugin_name, plugin_extension, true))
1586 plugin_name.erase(plugin_name.length() - plugin_extension.length());
1587 #endif // OS_MACOSX
1588 }
1580 } 1589 }
1581 #else 1590 #else
1582 NOTIMPLEMENTED() << " convert plugin path to plugin name"; 1591 NOTIMPLEMENTED() << " convert plugin path to plugin name";
1583 #endif 1592 #endif
1584 AddInfoBar(new SimpleAlertInfoBarDelegate( 1593 AddInfoBar(new SimpleAlertInfoBarDelegate(
1585 this, l10n_util::GetStringF(IDS_PLUGIN_CRASHED_PROMPT, plugin_name), 1594 this, l10n_util::GetStringF(IDS_PLUGIN_CRASHED_PROMPT, plugin_name),
1586 NULL)); 1595 NULL));
1587 } 1596 }
1588 1597
1589 void TabContents::OnCrashedWorker() { 1598 void TabContents::OnCrashedWorker() {
(...skipping 801 matching lines...) Expand 10 before | Expand all | Expand 10 after
2391 NavigationController::LoadCommittedDetails& committed_details = 2400 NavigationController::LoadCommittedDetails& committed_details =
2392 *(Details<NavigationController::LoadCommittedDetails>(details).ptr()); 2401 *(Details<NavigationController::LoadCommittedDetails>(details).ptr());
2393 ExpireInfoBars(committed_details); 2402 ExpireInfoBars(committed_details);
2394 break; 2403 break;
2395 } 2404 }
2396 2405
2397 default: 2406 default:
2398 NOTREACHED(); 2407 NOTREACHED();
2399 } 2408 }
2400 } 2409 }
OLDNEW
« no previous file with comments | « base/string_util_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698