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

Side by Side Diff: chrome/browser/chromeos/login/ui/login_web_dialog.cc

Issue 2455513003: chromeos: Make enterprise help dialog work in mash, part 1 (Closed)
Patch Set: Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 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 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/chromeos/login/ui/login_web_dialog.h" 5 #include "chrome/browser/chromeos/login/ui/login_web_dialog.h"
6 6
7 #include <deque> 7 #include <deque>
8 8
9 #include "base/lazy_instance.h" 9 #include "base/lazy_instance.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/chromeos/login/helper.h" 11 #include "chrome/browser/chromeos/login/helper.h"
12 #include "chrome/browser/ui/ash/system_tray_client.h"
12 #include "chrome/browser/ui/browser_dialogs.h" 13 #include "chrome/browser/ui/browser_dialogs.h"
13 #include "chrome/browser/ui/browser_finder.h" 14 #include "chrome/browser/ui/browser_finder.h"
14 #include "content/public/browser/browser_context.h" 15 #include "content/public/browser/browser_context.h"
15 #include "content/public/browser/web_contents.h" 16 #include "content/public/browser/web_contents.h"
16 #include "ui/gfx/geometry/rect.h" 17 #include "ui/gfx/geometry/rect.h"
17 #include "ui/gfx/native_widget_types.h" 18 #include "ui/gfx/native_widget_types.h"
18 #include "ui/views/widget/widget.h" 19 #include "ui/views/widget/widget.h"
19 20
20 using content::WebContents; 21 using content::WebContents;
21 using content::WebUIMessageHandler; 22 using content::WebUIMessageHandler;
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
55 url_(url), 56 url_(url),
56 is_open_(false) { 57 is_open_(false) {
57 gfx::Rect screen_bounds(CalculateScreenBounds(gfx::Size())); 58 gfx::Rect screen_bounds(CalculateScreenBounds(gfx::Size()));
58 width_ = static_cast<int>(kDefaultWidthRatio * screen_bounds.width()); 59 width_ = static_cast<int>(kDefaultWidthRatio * screen_bounds.width());
59 height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height()); 60 height_ = static_cast<int>(kDefaultHeightRatio * screen_bounds.height());
60 } 61 }
61 62
62 LoginWebDialog::~LoginWebDialog() {} 63 LoginWebDialog::~LoginWebDialog() {}
63 64
64 void LoginWebDialog::Show() { 65 void LoginWebDialog::Show() {
65 chrome::ShowWebDialog(parent_window_, browser_context_, this); 66 if (parent_window_) {
67 chrome::ShowWebDialog(parent_window_, browser_context_, this);
68 } else {
69 chrome::ShowWebDialogInContainer(
70 SystemTrayClient::GetDialogParentContainerId(), browser_context_, this);
James Cook 2016/10/26 17:58:09 Aside: I would like to move GetDialogParentContain
xiyuan 2016/10/26 19:30:06 Acknowledged.
71 }
66 is_open_ = true; 72 is_open_ = true;
67 } 73 }
68 74
69 void LoginWebDialog::SetDialogSize(int width, int height) { 75 void LoginWebDialog::SetDialogSize(int width, int height) {
70 DCHECK_GE(width, 0); 76 DCHECK_GE(width, 0);
71 DCHECK_GE(height, 0); 77 DCHECK_GE(height, 0);
72 width_ = width; 78 width_ = width;
73 height_ = height; 79 height_ = height;
74 } 80 }
75 81
(...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 // so we must suppress it. 164 // so we must suppress it.
159 // http://crbug.com/443096 165 // http://crbug.com/443096
160 return (source && !chrome::FindBrowserWithWebContents(source)); 166 return (source && !chrome::FindBrowserWithWebContents(source));
161 } 167 }
162 168
163 bool LoginWebDialog::HandleShouldCreateWebContents() { 169 bool LoginWebDialog::HandleShouldCreateWebContents() {
164 return false; 170 return false;
165 } 171 }
166 172
167 } // namespace chromeos 173 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698