OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/ui/global_error/global_error_service.h" | 5 #include "chrome/browser/ui/global_error/global_error_service.h" |
6 | 6 |
7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
8 #include "chrome/browser/ui/browser.h" | 8 #include "chrome/browser/ui/browser.h" |
9 #include "chrome/browser/ui/global_error/global_error.h" | 9 #include "chrome/browser/ui/global_error/global_error.h" |
10 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" | 10 #include "chrome/browser/ui/global_error/global_error_bubble_view_base.h" |
(...skipping 22 matching lines...) Expand all Loading... |
33 virtual int MenuItemIconResourceID() OVERRIDE { | 33 virtual int MenuItemIconResourceID() OVERRIDE { |
34 ADD_FAILURE(); | 34 ADD_FAILURE(); |
35 return 0; | 35 return 0; |
36 } | 36 } |
37 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE { ADD_FAILURE(); } | 37 virtual void ExecuteMenuItem(Browser* browser) OVERRIDE { ADD_FAILURE(); } |
38 | 38 |
39 virtual bool HasBubbleView() OVERRIDE { return true; } | 39 virtual bool HasBubbleView() OVERRIDE { return true; } |
40 virtual string16 GetBubbleViewTitle() OVERRIDE { | 40 virtual string16 GetBubbleViewTitle() OVERRIDE { |
41 return string16(); | 41 return string16(); |
42 } | 42 } |
43 virtual string16 GetBubbleViewMessage() OVERRIDE { | 43 virtual std::vector<string16> GetBubbleViewMessages() OVERRIDE { |
44 return string16(); | 44 return std::vector<string16>(); |
45 } | 45 } |
46 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE { | 46 virtual string16 GetBubbleViewAcceptButtonLabel() OVERRIDE { |
47 return string16(); | 47 return string16(); |
48 } | 48 } |
49 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE { | 49 virtual string16 GetBubbleViewCancelButtonLabel() OVERRIDE { |
50 return string16(); | 50 return string16(); |
51 } | 51 } |
52 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE { | 52 virtual void OnBubbleViewDidClose(Browser* browser) OVERRIDE { |
53 EXPECT_TRUE(browser); | 53 EXPECT_TRUE(browser); |
54 ++bubble_view_close_count_; | 54 ++bubble_view_close_count_; |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 EXPECT_TRUE(error->HasShownBubbleView()); | 135 EXPECT_TRUE(error->HasShownBubbleView()); |
136 EXPECT_EQ(0, error->bubble_view_close_count()); | 136 EXPECT_EQ(0, error->bubble_view_close_count()); |
137 | 137 |
138 // Removing |error| from profile should dismiss the bubble view without | 138 // Removing |error| from profile should dismiss the bubble view without |
139 // calling |error->BubbleViewDidClose|. | 139 // calling |error->BubbleViewDidClose|. |
140 service->RemoveGlobalError(error.get()); | 140 service->RemoveGlobalError(error.get()); |
141 content::RunAllPendingInMessageLoop(); | 141 content::RunAllPendingInMessageLoop(); |
142 EXPECT_EQ(1, error->bubble_view_close_count()); | 142 EXPECT_EQ(1, error->bubble_view_close_count()); |
143 // |error| is no longer owned by service and will be deleted. | 143 // |error| is no longer owned by service and will be deleted. |
144 } | 144 } |
OLD | NEW |