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

Unified Diff: chrome/browser/chromeos/login/ui/shared_web_view.h

Issue 2610373002: cros: Only preload the lock screen; do not reuse it. (Closed)
Patch Set: Address comments Created 3 years, 11 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/chromeos/login/ui/shared_web_view.h
diff --git a/chrome/browser/chromeos/login/ui/shared_web_view.h b/chrome/browser/chromeos/login/ui/shared_web_view.h
deleted file mode 100644
index 39300becf0324ef8ed873b4cfe6e78866478086b..0000000000000000000000000000000000000000
--- a/chrome/browser/chromeos/login/ui/shared_web_view.h
+++ /dev/null
@@ -1,73 +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_CHROMEOS_LOGIN_UI_SHARED_WEB_VIEW_H_
-#define CHROME_BROWSER_CHROMEOS_LOGIN_UI_SHARED_WEB_VIEW_H_
-
-#include <memory>
-
-#include "base/macros.h"
-#include "base/memory/memory_pressure_listener.h"
-#include "base/memory/ref_counted.h"
-#include "components/keyed_service/core/keyed_service.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
-#include "url/gurl.h"
-
-class Profile;
-
-namespace chromeos {
-
-class WebViewHandle;
-
-// Stores and fetches a views::WebView instance that is ulimately owned by the
-// signin profile. This allows for a WebView to be reused over time or
-// preloaded. Use SharedWebViewFactory to get an instance of this class.
-class SharedWebView : public KeyedService,
- public content::NotificationObserver {
- public:
- explicit SharedWebView(Profile* profile);
- ~SharedWebView() override;
- void Shutdown() override;
-
- // Stores a webview instance inside of |out_handle|. |url| is the initial
- // URL that the webview stores (note: this function does not perform the
- // navigation). This returns true if the webview was reused, false if it
- // was freshly created.
- bool Get(const GURL& url, scoped_refptr<WebViewHandle>* out_handle);
-
- // Returns true if there is an attached views::WebView instance.
- bool has_web_view() const { return !!web_view_handle_; }
-
- private:
- // content::NotificationObserver:
- void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) override;
-
- // Called when there is a memory pressure event.
- void OnMemoryPressure(
- base::MemoryPressureListener::MemoryPressureLevel level);
-
- content::NotificationRegistrar registrar_;
-
- // Profile used for creating the views::WebView instance.
- Profile* const profile_;
-
- // Cached URL that the |web_view_| instance should point to used for
- // validation.
- GURL web_view_url_;
-
- // Shared web-view instance. Callers may take a reference on the handle so it
- // could outlive this class.
- scoped_refptr<WebViewHandle> web_view_handle_;
-
- std::unique_ptr<base::MemoryPressureListener> memory_pressure_listener_;
-
- DISALLOW_COPY_AND_ASSIGN(SharedWebView);
-};
-
-} // namespace chromeos
-
-#endif // CHROME_BROWSER_CHROMEOS_LOGIN_UI_SHARED_WEB_VIEW_H_
« no previous file with comments | « chrome/browser/chromeos/login/ui/preloaded_web_view_factory.cc ('k') | chrome/browser/chromeos/login/ui/shared_web_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698