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

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

Issue 10407105: Improve error messaging of webRequest API in case of conflicts (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed Evan's comments Created 8 years, 1 month 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
(Empty)
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
3 // found in the LICENSE file.
4
5 #include "chrome/browser/extensions/extension_global_error_badge.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 "chrome/browser/ui/browser_commands.h"
13 #include "grit/generated_resources.h"
14 #include "ui/base/l10n/l10n_util.h"
15
16 ExtensionGlobalErrorBadge::ExtensionGlobalErrorBadge() {}
17
18 ExtensionGlobalErrorBadge::~ExtensionGlobalErrorBadge() {}
19
20 bool ExtensionGlobalErrorBadge::HasBadge() {
21 return true;
22 }
23
24 bool ExtensionGlobalErrorBadge::HasMenuItem() {
25 return true;
26 }
27
28 int ExtensionGlobalErrorBadge::MenuItemCommandID() {
29 return GetMenuItemCommandID();
30 }
31
32 string16 ExtensionGlobalErrorBadge::MenuItemLabel() {
33 return l10n_util::GetStringUTF16(IDS_EXTENSION_WARNINGS_WRENCH_MENU_ITEM);
34 }
35
36 void ExtensionGlobalErrorBadge::ExecuteMenuItem(Browser* browser) {
37 ExtensionService* extension_service =
38 browser->profile()->GetExtensionService();
39
40 // Suppress all current warnings in the extension service from triggering
41 // a badge on the wrench menu in the future of this session.
42 extension_service->extension_warnings()->SuppressBadgeForCurrentWarnings();
43
44 chrome::ExecuteCommand(browser, IDC_MANAGE_EXTENSIONS);
45 }
46
47 bool ExtensionGlobalErrorBadge::HasBubbleView() {
48 return false;
49 }
50
51 string16 ExtensionGlobalErrorBadge::GetBubbleViewTitle() {
52 return string16();
53 }
54
55 string16 ExtensionGlobalErrorBadge::GetBubbleViewMessage() {
56 return string16();
57 }
58
59 string16 ExtensionGlobalErrorBadge::GetBubbleViewAcceptButtonLabel() {
60 return string16();
61 }
62
63 string16 ExtensionGlobalErrorBadge::GetBubbleViewCancelButtonLabel() {
64 return string16();
65 }
66
67 void ExtensionGlobalErrorBadge::OnBubbleViewDidClose(Browser* browser) {
68 }
69
70 void ExtensionGlobalErrorBadge::BubbleViewAcceptButtonPressed(
71 Browser* browser) {
72 NOTREACHED();
73 }
74
75 void ExtensionGlobalErrorBadge::BubbleViewCancelButtonPressed(
76 Browser* browser) {
77 NOTREACHED();
78 }
79
80 // static
81 int ExtensionGlobalErrorBadge::GetMenuItemCommandID() {
82 return IDC_EXTENSION_ERRORS;
83 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698