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

Unified Diff: chrome/browser/ui/website_settings/mock_permission_bubble_factory.h

Issue 2182883002: Permissions: Rename PermissionBubbleView to PermissionPromptInterface (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: thestig@ review Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/website_settings/mock_permission_bubble_factory.h
diff --git a/chrome/browser/ui/website_settings/mock_permission_bubble_factory.h b/chrome/browser/ui/website_settings/mock_permission_bubble_factory.h
deleted file mode 100644
index 5574e0dce70af22d58d0c7ad178b3365d1828d3c..0000000000000000000000000000000000000000
--- a/chrome/browser/ui/website_settings/mock_permission_bubble_factory.h
+++ /dev/null
@@ -1,77 +0,0 @@
-// Copyright 2016 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#ifndef CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_
-#define CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_
-
-#include <memory>
-#include <vector>
-
-#include "chrome/browser/permissions/permission_request_manager.h"
-
-class Browser;
-class PermissionBubbleView;
-class MockPermissionBubbleView;
-
-// Provides a skeleton class for both unit and browser testing when trying to
-// test the bubble manager logic. Should not be used for anything that requires
-// actual UI.
-// See example usage in
-// chrome/browser/permissions/permission_request_manager_unittest.cc
-class MockPermissionBubbleFactory {
- public:
- explicit MockPermissionBubbleFactory(PermissionRequestManager* manager);
- ~MockPermissionBubbleFactory();
-
- // Create method called by the PBM to show a bubble.
- std::unique_ptr<PermissionBubbleView> Create(Browser* browser);
-
- void SetCanUpdateUi(bool can_update_ui);
-
- void ResetCounts();
-
- void DocumentOnLoadCompletedInMainFrame();
-
- void set_response_type(PermissionRequestManager::AutoResponseType type) {
- response_type_ = type;
- }
-
- // If the current view is visible.
- bool is_visible();
- // Number of times |Show| was called on any bubble.
- int show_count() { return show_count_; }
- // Number of requests seen by the last |Show|.
- int request_count() { return requests_count_; }
- // Number of requests seen.
- int total_request_count() { return total_requests_count_; }
-
- void WaitForPermissionBubble();
-
- private:
- friend class MockPermissionBubbleView;
-
- // This shouldn't be called. Is here to fail tests that try to create a bubble
- // after the factory has been destroyed.
- static std::unique_ptr<PermissionBubbleView> DoNotCreate(Browser* browser);
-
- void UpdateResponseType();
- void ShowView(MockPermissionBubbleView* view);
- void HideView(MockPermissionBubbleView* view);
-
- bool can_update_ui_;
- int show_count_;
- int requests_count_;
- int total_requests_count_;
- std::vector<MockPermissionBubbleView*> views_;
- PermissionRequestManager::AutoResponseType response_type_;
-
- base::Closure show_bubble_quit_closure_;
-
- // The bubble manager that will be associated with this factory.
- PermissionRequestManager* manager_;
-
- DISALLOW_COPY_AND_ASSIGN(MockPermissionBubbleFactory);
-};
-
-#endif // CHROME_BROWSER_UI_WEBSITE_SETTINGS_MOCK_PERMISSION_BUBBLE_FACTORY_H_

Powered by Google App Engine
This is Rietveld 408576698