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

Unified Diff: chrome/browser/ui/views/apps/native_app_window_views.cc

Issue 27207003: Fix declaration vs. implementation ordering in NativeAppWindow{Views|Gtk} (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase again Created 7 years, 2 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/ui/views/apps/native_app_window_views.cc
diff --git a/chrome/browser/ui/views/apps/native_app_window_views.cc b/chrome/browser/ui/views/apps/native_app_window_views.cc
index a0eb67405441ab9c45c6b525f3025cde0cf22fee..c39d0424de13ca69bdfb2516699cb5722a076e62 100644
--- a/chrome/browser/ui/views/apps/native_app_window_views.cc
+++ b/chrome/browser/ui/views/apps/native_app_window_views.cc
@@ -455,33 +455,6 @@ bool NativeAppWindowViews::IsAlwaysOnTop() const {
}
}
-bool NativeAppWindowViews::IsFrameless() const {
- return frameless_;
-}
-
-gfx::Insets NativeAppWindowViews::GetFrameInsets() const {
- if (frameless_)
- return gfx::Insets();
-
- // The pretend client_bounds passed in need to be large enough to ensure that
- // GetWindowBoundsForClientBounds() doesn't decide that it needs more than
- // the specified amount of space to fit the window controls in, and return a
- // number larger than the real frame insets. Most window controls are smaller
- // than 1000x1000px, so this should be big enough.
- gfx::Rect client_bounds = gfx::Rect(1000, 1000);
- gfx::Rect window_bounds =
- window_->non_client_view()->GetWindowBoundsForClientBounds(
- client_bounds);
- return window_bounds.InsetsFrom(client_bounds);
-}
-
-bool NativeAppWindowViews::IsVisible() const {
- return window_->IsVisible();
-}
-
-void NativeAppWindowViews::HideWithApp() {}
-void NativeAppWindowViews::ShowWithApp() {}
-
void NativeAppWindowViews::SetAlwaysOnTop(bool always_on_top) {
window_->SetAlwaysOnTop(always_on_top);
shell_window_->OnNativeWindowChanged();
@@ -642,6 +615,10 @@ const views::Widget* NativeAppWindowViews::GetWidget() const {
return window_;
}
+views::View* NativeAppWindowViews::GetContentsView() {
+ return this;
+}
+
views::NonClientFrameView* NativeAppWindowViews::CreateNonClientFrameView(
views::Widget* widget) {
#if defined(USE_ASH)
@@ -717,6 +694,12 @@ void NativeAppWindowViews::RenderViewCreated(
}
}
+void NativeAppWindowViews::RenderViewHostChanged(
+ content::RenderViewHost* old_host,
+ content::RenderViewHost* new_host) {
+ OnViewWasResized();
+}
+
// views::View implementation.
void NativeAppWindowViews::Layout() {
@@ -797,10 +780,6 @@ bool NativeAppWindowViews::IsDetached() const {
#endif
}
-views::View* NativeAppWindowViews::GetContentsView() {
- return this;
-}
-
void NativeAppWindowViews::UpdateWindowIcon() {
window_->UpdateWindowIcon();
}
@@ -809,10 +788,6 @@ void NativeAppWindowViews::UpdateWindowTitle() {
window_->UpdateWindowTitle();
}
-void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) {
- input_region_ = region.Pass();
-}
-
void NativeAppWindowViews::UpdateDraggableRegions(
const std::vector<extensions::DraggableRegion>& regions) {
// Draggable region is not supported for non-frameless window.
@@ -827,14 +802,39 @@ SkRegion* NativeAppWindowViews::GetDraggableRegion() {
return draggable_region_.get();
}
+void NativeAppWindowViews::UpdateInputRegion(scoped_ptr<SkRegion> region) {
+ input_region_ = region.Pass();
+}
+
void NativeAppWindowViews::HandleKeyboardEvent(
const content::NativeWebKeyboardEvent& event) {
unhandled_keyboard_event_handler_.HandleKeyboardEvent(event,
GetFocusManager());
}
-void NativeAppWindowViews::RenderViewHostChanged(
- content::RenderViewHost* old_host,
- content::RenderViewHost* new_host) {
- OnViewWasResized();
+bool NativeAppWindowViews::IsFrameless() const {
+ return frameless_;
}
+
+gfx::Insets NativeAppWindowViews::GetFrameInsets() const {
+ if (frameless_)
+ return gfx::Insets();
+
+ // The pretend client_bounds passed in need to be large enough to ensure that
+ // GetWindowBoundsForClientBounds() doesn't decide that it needs more than
+ // the specified amount of space to fit the window controls in, and return a
+ // number larger than the real frame insets. Most window controls are smaller
+ // than 1000x1000px, so this should be big enough.
+ gfx::Rect client_bounds = gfx::Rect(1000, 1000);
+ gfx::Rect window_bounds =
+ window_->non_client_view()->GetWindowBoundsForClientBounds(
+ client_bounds);
+ return window_bounds.InsetsFrom(client_bounds);
+}
+
+bool NativeAppWindowViews::IsVisible() const {
+ return window_->IsVisible();
+}
+
+void NativeAppWindowViews::HideWithApp() {}
+void NativeAppWindowViews::ShowWithApp() {}
« no previous file with comments | « chrome/browser/ui/views/apps/native_app_window_views.h ('k') | chrome/browser/ui/views/select_file_dialog_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698