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

Side by Side Diff: ui/views/widget/native_widget_aura.cc

Issue 1130033003: Make the minimize state work when creating a chrome window in CrOS (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: remove the parentheses in the inline if statement Created 5 years 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 "ui/views/widget/native_widget_aura.h" 5 #include "ui/views/widget/native_widget_aura.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/strings/string_util.h" 8 #include "base/strings/string_util.h"
9 #include "third_party/skia/include/core/SkRegion.h" 9 #include "third_party/skia/include/core/SkRegion.h"
10 #include "ui/aura/client/aura_constants.h" 10 #include "ui/aura/client/aura_constants.h"
(...skipping 476 matching lines...) Expand 10 before | Expand all | Expand 10 after
487 } 487 }
488 window_->Show(); 488 window_->Show();
489 if (delegate_->CanActivate()) { 489 if (delegate_->CanActivate()) {
490 if (state != ui::SHOW_STATE_INACTIVE) 490 if (state != ui::SHOW_STATE_INACTIVE)
491 Activate(); 491 Activate();
492 // SetInitialFocus() should be always be called, even for 492 // SetInitialFocus() should be always be called, even for
493 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will 493 // SHOW_STATE_INACTIVE. If the window has to stay inactive, the method will
494 // do the right thing. 494 // do the right thing.
495 SetInitialFocus(state); 495 SetInitialFocus(state);
496 } 496 }
497
498 // On desktop aura, a window is activated first even when it is shown as
499 // minimized. Do the same for consistency.
500 if (state == ui::SHOW_STATE_MINIMIZED)
501 Minimize();
497 } 502 }
498 503
499 bool NativeWidgetAura::IsVisible() const { 504 bool NativeWidgetAura::IsVisible() const {
500 return window_ && window_->IsVisible(); 505 return window_ && window_->IsVisible();
501 } 506 }
502 507
503 void NativeWidgetAura::Activate() { 508 void NativeWidgetAura::Activate() {
504 if (!window_) 509 if (!window_)
505 return; 510 return;
506 511
(...skipping 656 matching lines...) Expand 10 before | Expand all | Expand 10 after
1163 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont)); 1168 l10n_util::AdjustUIFont(&(ncm.lfCaptionFont));
1164 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont))); 1169 base::win::ScopedHFONT caption_font(CreateFontIndirect(&(ncm.lfCaptionFont)));
1165 return gfx::FontList(gfx::Font(caption_font)); 1170 return gfx::FontList(gfx::Font(caption_font));
1166 #else 1171 #else
1167 return gfx::FontList(); 1172 return gfx::FontList();
1168 #endif 1173 #endif
1169 } 1174 }
1170 1175
1171 } // namespace internal 1176 } // namespace internal
1172 } // namespace views 1177 } // namespace views
OLDNEW
« no previous file with comments | « chrome/browser/extensions/api/tabs/tabs_api.cc ('k') | ui/views/widget/native_widget_aura_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698