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

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

Issue 9391024: Custom frame UI for platform apps on Windows. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: "Transparent" -> "Clickthrough", fix patchset Created 8 years, 10 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 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_view.h" 5 #include "chrome/browser/ui/views/extensions/extension_view.h"
6 6
7 #include "chrome/browser/extensions/extension_host.h" 7 #include "chrome/browser/extensions/extension_host.h"
8 #include "chrome/browser/ui/views/extensions/extension_popup.h" 8 #include "chrome/browser/ui/views/extensions/extension_popup.h"
9 #include "content/browser/renderer_host/render_view_host.h" 9 #include "content/browser/renderer_host/render_view_host.h"
10 #include "content/public/browser/content_browser_client.h" 10 #include "content/public/browser/content_browser_client.h"
(...skipping 131 matching lines...) Expand 10 before | Expand all | Expand 10 after
142 // focus to the next focusable view). Also handle Backspace, since otherwise 142 // focus to the next focusable view). Also handle Backspace, since otherwise
143 // (on Windows at least), pressing Backspace, when focus is on a text field 143 // (on Windows at least), pressing Backspace, when focus is on a text field
144 // within the ExtensionView, will navigate the page back instead of erasing a 144 // within the ExtensionView, will navigate the page back instead of erasing a
145 // character. 145 // character.
146 return (e.key_code() == ui::VKEY_TAB || e.key_code() == ui::VKEY_BACK); 146 return (e.key_code() == ui::VKEY_TAB || e.key_code() == ui::VKEY_BACK);
147 } 147 }
148 148
149 void ExtensionView::OnBoundsChanged(const gfx::Rect& previous_bounds) { 149 void ExtensionView::OnBoundsChanged(const gfx::Rect& previous_bounds) {
150 // Propagate the new size to RenderWidgetHostView. 150 // Propagate the new size to RenderWidgetHostView.
151 // We can't send size zero because RenderWidget DCHECKs that. 151 // We can't send size zero because RenderWidget DCHECKs that.
152 if (render_view_host()->view() && !bounds().IsEmpty()) 152 if (render_view_host()->view() && !bounds().IsEmpty()) {
153 render_view_host()->view()->SetSize(size()); 153 render_view_host()->view()->SetSize(size());
154
155 if (container_)
156 container_->OnViewWasResized();
157 }
154 } 158 }
155 159
156 void ExtensionView::RenderViewCreated() { 160 void ExtensionView::RenderViewCreated() {
157 if (!pending_background_.empty() && render_view_host()->view()) { 161 if (!pending_background_.empty() && render_view_host()->view()) {
158 render_view_host()->view()->SetBackground(pending_background_); 162 render_view_host()->view()->SetBackground(pending_background_);
159 pending_background_.reset(); 163 pending_background_.reset();
160 } 164 }
161 165
162 // Tell the renderer not to draw scroll bars in popups unless the 166 // Tell the renderer not to draw scroll bars in popups unless the
163 // popups are at the maximum allowed size. 167 // popups are at the maximum allowed size.
164 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth, 168 gfx::Size largest_popup_size(ExtensionPopup::kMaxWidth,
165 ExtensionPopup::kMaxHeight); 169 ExtensionPopup::kMaxHeight);
166 host_->DisableScrollbarsForSmallWindows(largest_popup_size); 170 host_->DisableScrollbarsForSmallWindows(largest_popup_size);
171
172 if (container_)
173 container_->OnViewWasResized();
167 } 174 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/extensions/extension_view.h ('k') | chrome/browser/ui/views/extensions/shell_window_views.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698