Revert "Only store leading 13 bits of password hash."
[chromium-blink-merge.git] / chrome / browser / ui / views / chrome_constrained_window_views_client.cc
blob7575b14741b9aa69c9025eb7f396e73d1d95e0cf
1 // Copyright 2014 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.
5 #include "chrome/browser/ui/views/chrome_constrained_window_views_client.h"
7 #include "chrome/browser/platform_util.h"
8 #include "chrome/browser/ui/browser_finder.h"
9 #include "components/web_modal/web_contents_modal_dialog_host.h"
10 #include "extensions/browser/guest_view/guest_view_base.h"
12 namespace {
14 class ChromeConstrainedWindowViewsClient
15 : public constrained_window::ConstrainedWindowViewsClient {
16 public:
17 ChromeConstrainedWindowViewsClient() {}
18 ~ChromeConstrainedWindowViewsClient() override {}
20 private:
21 // ConstrainedWindowViewsClient:
22 content::WebContents* GetEmbedderWebContents(
23 content::WebContents* initiator_web_contents) override {
24 extensions::GuestViewBase* guest_view =
25 extensions::GuestViewBase::FromWebContents(initiator_web_contents);
26 return guest_view && guest_view->embedder_web_contents() ?
27 guest_view->embedder_web_contents() : initiator_web_contents;
29 web_modal::ModalDialogHost* GetModalDialogHost(
30 gfx::NativeWindow parent) override {
31 // Get the browser dialog management and hosting components from |parent|.
32 Browser* browser = chrome::FindBrowserWithWindow(parent);
33 if (browser) {
34 ChromeWebModalDialogManagerDelegate* manager = browser;
35 return manager->GetWebContentsModalDialogHost();
37 return nullptr;
39 gfx::NativeView GetDialogHostView(gfx::NativeWindow parent) override {
40 return platform_util::GetViewForWindow(parent);
43 DISALLOW_COPY_AND_ASSIGN(ChromeConstrainedWindowViewsClient);
46 } // namespace
48 scoped_ptr<constrained_window::ConstrainedWindowViewsClient>
49 CreateChromeConstrainedWindowViewsClient() {
50 return make_scoped_ptr(new ChromeConstrainedWindowViewsClient);