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

Side by Side Diff: chrome/browser/ui/views/extensions/extension_dialog.cc

Issue 666533007: Move JavaScriptDialogManager, JavascriptAppModalDialogViews to components/app_modal_dialogs (Closed) Base URL: https://chromium.googlesource.com/chromium/src@master
Patch Set: Created 6 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 (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/views/extensions/extension_dialog.h" 5 #include "chrome/browser/ui/views/extensions/extension_dialog.h"
6 6
7 #include "chrome/browser/chrome_notification_types.h" 7 #include "chrome/browser/chrome_notification_types.h"
8 #include "chrome/browser/extensions/extension_view_host.h" 8 #include "chrome/browser/extensions/extension_view_host.h"
9 #include "chrome/browser/extensions/extension_view_host_factory.h" 9 #include "chrome/browser/extensions/extension_view_host_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 79 matching lines...) Expand 10 before | Expand all | Expand 10 after
90 view->SetVisible(true); 90 view->SetVisible(true);
91 91
92 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts. 92 // Ensure the DOM JavaScript can respond immediately to keyboard shortcuts.
93 host->host_contents()->Focus(); 93 host->host_contents()->Focus();
94 return dialog; 94 return dialog;
95 } 95 }
96 96
97 void ExtensionDialog::InitWindow(aura::Window* parent, 97 void ExtensionDialog::InitWindow(aura::Window* parent,
98 int width, 98 int width,
99 int height) { 99 int height) {
100 views::Widget* window = CreateBrowserModalDialogViews(this, parent); 100 views::Widget* window = CreateAppModalDialogViews(this, parent);
101 101
102 // Center the window over the browser. 102 // Center the window over the browser.
103 gfx::Point center = parent->GetBoundsInScreen().CenterPoint(); 103 gfx::Point center = parent->GetBoundsInScreen().CenterPoint();
104 int x = center.x() - width / 2; 104 int x = center.x() - width / 2;
105 int y = center.y() - height / 2; 105 int y = center.y() - height / 2;
106 // Ensure the top left and top right of the window are on screen, with 106 // Ensure the top left and top right of the window are on screen, with
107 // priority given to the top left. 107 // priority given to the top left.
108 gfx::Rect screen_rect = gfx::Screen::GetScreenFor(parent)-> 108 gfx::Rect screen_rect = gfx::Screen::GetScreenFor(parent)->
109 GetDisplayNearestPoint(center).bounds(); 109 GetDisplayNearestPoint(center).bounds();
110 gfx::Rect bounds_rect = gfx::Rect(x, y, width, height); 110 gfx::Rect bounds_rect = gfx::Rect(x, y, width, height);
(...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (content::Details<extensions::ExtensionHost>(host()) != details) 216 if (content::Details<extensions::ExtensionHost>(host()) != details)
217 return; 217 return;
218 if (observer_) 218 if (observer_)
219 observer_->ExtensionTerminated(this); 219 observer_->ExtensionTerminated(this);
220 break; 220 break;
221 default: 221 default:
222 NOTREACHED() << L"Received unexpected notification"; 222 NOTREACHED() << L"Received unexpected notification";
223 break; 223 break;
224 } 224 }
225 } 225 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698