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

Side by Side Diff: chrome/browser/ui/views/frame/browser_frame_aura.cc

Issue 9817025: Ash: Use right edge of screen to scroll maximized windows (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 9 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_util.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/frame/browser_frame_aura.h" 5 #include "chrome/browser/ui/views/frame/browser_frame_aura.h"
6 6
7 #include "ash/wm/frame_painter.h"
8 #include "ash/wm/window_util.h"
7 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
8 #include "chrome/browser/ui/views/frame/browser_view.h" 10 #include "chrome/browser/ui/views/frame/browser_view.h"
9 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h" 11 #include "chrome/browser/ui/views/frame/system_menu_model_delegate.h"
10 #include "grit/chromium_strings.h" 12 #include "grit/chromium_strings.h"
11 #include "grit/generated_resources.h" 13 #include "grit/generated_resources.h"
12 #include "ui/aura/client/aura_constants.h" 14 #include "ui/aura/client/aura_constants.h"
13 #include "ui/aura/window.h" 15 #include "ui/aura/window.h"
14 #include "ui/aura/window_observer.h" 16 #include "ui/aura/window_observer.h"
15 #include "ui/base/hit_test.h" 17 #include "ui/base/hit_test.h"
16 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
(...skipping 12 matching lines...) Expand all
29 BrowserFrame* browser_frame) 31 BrowserFrame* browser_frame)
30 : browser_frame_aura_(browser_frame_aura), 32 : browser_frame_aura_(browser_frame_aura),
31 browser_frame_(browser_frame) {} 33 browser_frame_(browser_frame) {}
32 34
33 virtual void OnWindowPropertyChanged(aura::Window* window, 35 virtual void OnWindowPropertyChanged(aura::Window* window,
34 const void* key, 36 const void* key,
35 intptr_t old) OVERRIDE { 37 intptr_t old) OVERRIDE {
36 if (key != aura::client::kShowStateKey) 38 if (key != aura::client::kShowStateKey)
37 return; 39 return;
38 40
41 // Maximized windows don't want resize handles overlapping the content area,
42 // because when the user moves the cursor to the right screen edge we want
43 // them to be able to hit the scroll bar.
44 window->SetHitTestBoundsOverride(
45 ash::FramePainter::kResizeOutsideBoundsSize,
46 ash::wm::IsWindowMaximized(window) ?
47 0 :
48 ash::FramePainter::kResizeInsideBoundsSize);
49
39 // Allow the frame to be replaced when maximizing an app. 50 // Allow the frame to be replaced when maximizing an app.
40 if (browser_frame_->non_client_view() && 51 if (browser_frame_->non_client_view() &&
41 browser_frame_aura_->browser_view()->browser()->is_app()) 52 browser_frame_aura_->browser_view()->browser()->is_app())
42 browser_frame_->non_client_view()->UpdateFrame(); 53 browser_frame_->non_client_view()->UpdateFrame();
43 54
44 // When migrating from regular ChromeOS to Aura, windows can have saved 55 // When migrating from regular ChromeOS to Aura, windows can have saved
45 // restore bounds that are exactly equal to the maximized bounds. Thus when 56 // restore bounds that are exactly equal to the maximized bounds. Thus when
46 // you hit maximize, there is no resize and the layout doesn't get 57 // you hit maximize, there is no resize and the layout doesn't get
47 // refreshed. This can also theoretically happen if a user drags a window to 58 // refreshed. This can also theoretically happen if a user drags a window to
48 // 0,0 then resizes it to fill the workspace, then hits maximize. We need 59 // 0,0 then resizes it to fill the workspace, then hits maximize. We need
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
151 162
152 //////////////////////////////////////////////////////////////////////////////// 163 ////////////////////////////////////////////////////////////////////////////////
153 // NativeBrowserFrame, public: 164 // NativeBrowserFrame, public:
154 165
155 // static 166 // static
156 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame( 167 NativeBrowserFrame* NativeBrowserFrame::CreateNativeBrowserFrame(
157 BrowserFrame* browser_frame, 168 BrowserFrame* browser_frame,
158 BrowserView* browser_view) { 169 BrowserView* browser_view) {
159 return new BrowserFrameAura(browser_frame, browser_view); 170 return new BrowserFrameAura(browser_frame, browser_view);
160 } 171 }
OLDNEW
« no previous file with comments | « ash/wm/window_util.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698