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

Side by Side Diff: chrome/browser/extensions/extension_global_error.cc

Issue 8176001: Warn user in case extension delays network traffic too much. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Cleanup Created 9 years, 2 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
OLDNEW
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_global_error.h"
6
7 #include "base/logging.h"
8 #include "chrome/app/chrome_command_ids.h"
9 #include "chrome/browser/extensions/extension_service.h"
10 #include "chrome/browser/profiles/profile.h"
11 #include "chrome/browser/ui/browser.h"
12 #include "grit/generated_resources.h"
13 #include "ui/base/l10n/l10n_util.h"
14
15 ExtensionGlobalError::ExtensionGlobalError() {}
16
17 ExtensionGlobalError::~ExtensionGlobalError() {}
18
19 bool ExtensionGlobalError::HasBadge() {
20 return true;
21 }
22
23 bool ExtensionGlobalError::HasMenuItem() {
24 return true;
25 }
26
27 int ExtensionGlobalError::MenuItemCommandID() {
28 return IDC_EXTENSION_ERRORS;
29 }
30
31 string16 ExtensionGlobalError::MenuItemLabel() {
32 return l10n_util::GetStringUTF16(IDS_EXTENSION_WARNINGS_WRENCH_MENU_ITEM);
33 }
34
35 void ExtensionGlobalError::ExecuteMenuItem(Browser* browser) {
36 ExtensionService* extension_service =
37 browser->GetProfile()->GetExtensionService();
38
39 // Suppress all current warnings in the extension service from triggering
40 // a badge on the wrench menu in the future of this session.
41 extension_service->extension_warnings()->SuppressBadgeForCurrentWarnings();
42
43 browser->ExecuteCommand(IDC_MANAGE_EXTENSIONS);
44 }
45
46 bool ExtensionGlobalError::HasBubbleView() {
47 return false;
48 }
49
50 string16 ExtensionGlobalError::GetBubbleViewTitle() {
51 return string16();
52 }
53
54 string16 ExtensionGlobalError::GetBubbleViewMessage() {
55 return string16();
56 }
57
58 string16 ExtensionGlobalError::GetBubbleViewAcceptButtonLabel() {
59 return string16();
60 }
61
62 string16 ExtensionGlobalError::GetBubbleViewCancelButtonLabel() {
63 return string16();
64 }
65
66 void ExtensionGlobalError::BubbleViewDidClose() {
67 }
68
69 void ExtensionGlobalError::BubbleViewAcceptButtonPressed() {
70 NOTREACHED();
71 }
72
73 void ExtensionGlobalError::BubbleViewCancelButtonPressed() {
74 NOTREACHED();
75 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698