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

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

Issue 10038040: In Windows8 metro mode prevent moving/sizing/maximizing of the chrome browser frame. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 8 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 | « no previous file | 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_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after
103 #include "ui/views/window/dialog_delegate.h" 103 #include "ui/views/window/dialog_delegate.h"
104 104
105 #if defined(USE_ASH) 105 #if defined(USE_ASH)
106 #include "ash/launcher/launcher.h" 106 #include "ash/launcher/launcher.h"
107 #include "ash/launcher/launcher_model.h" 107 #include "ash/launcher/launcher_model.h"
108 #include "ash/shell.h" 108 #include "ash/shell.h"
109 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" 109 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h"
110 #include "chrome/browser/ui/views/ash/launcher/launcher_updater.h" 110 #include "chrome/browser/ui/views/ash/launcher/launcher_updater.h"
111 #include "chrome/browser/ui/views/ash/window_positioner.h" 111 #include "chrome/browser/ui/views/ash/window_positioner.h"
112 #elif defined(OS_WIN) 112 #elif defined(OS_WIN)
113 #include "base/win/metro.h"
113 #include "chrome/browser/aeropeek_manager.h" 114 #include "chrome/browser/aeropeek_manager.h"
114 #include "chrome/browser/jumplist_win.h" 115 #include "chrome/browser/jumplist_win.h"
115 #include "ui/views/widget/native_widget_win.h" 116 #include "ui/views/widget/native_widget_win.h"
116 #endif 117 #endif
117 118
118 #if defined(USE_AURA) 119 #if defined(USE_AURA)
119 #include "chrome/browser/ui/views/accelerator_table.h" 120 #include "chrome/browser/ui/views/accelerator_table.h"
120 #include "ui/gfx/screen.h" 121 #include "ui/gfx/screen.h"
121 #endif 122 #endif
122 123
(...skipping 1392 matching lines...) Expand 10 before | Expand all | Expand 10 after
1515 return false; 1516 return false;
1516 #endif 1517 #endif
1517 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR); 1518 return browser_->SupportsWindowFeature(Browser::FEATURE_TITLEBAR);
1518 } 1519 }
1519 1520
1520 bool BrowserView::ExecuteWindowsCommand(int command_id) { 1521 bool BrowserView::ExecuteWindowsCommand(int command_id) {
1521 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND. 1522 // This function handles WM_SYSCOMMAND, WM_APPCOMMAND, and WM_COMMAND.
1522 #if defined(OS_WIN) && !defined(USE_AURA) 1523 #if defined(OS_WIN) && !defined(USE_AURA)
1523 if (command_id == IDC_DEBUG_FRAME_TOGGLE) 1524 if (command_id == IDC_DEBUG_FRAME_TOGGLE)
1524 GetWidget()->DebugToggleFrameType(); 1525 GetWidget()->DebugToggleFrameType();
1526
1527 // In Windows 8 metro mode prevent sizing and moving.
1528 if (base::win::GetMetroModule()) {
1529 // Windows uses the 4 lower order bits of |notification_code| for type-
1530 // specific information so we must exclude this when comparing.
1531 static const int sc_mask = 0xFFF0;
1532 if (((command_id & sc_mask) == SC_MOVE) ||
1533 ((command_id & sc_mask) == SC_SIZE) ||
1534 ((command_id & sc_mask) == SC_MAXIMIZE))
1535 return true;
1536 }
1525 #endif 1537 #endif
1526 // Translate WM_APPCOMMAND command ids into a command id that the browser 1538 // Translate WM_APPCOMMAND command ids into a command id that the browser
1527 // knows how to handle. 1539 // knows how to handle.
1528 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id); 1540 int command_id_from_app_command = GetCommandIDForAppCommandID(command_id);
1529 if (command_id_from_app_command != -1) 1541 if (command_id_from_app_command != -1)
1530 command_id = command_id_from_app_command; 1542 command_id = command_id_from_app_command;
1531 1543
1532 return browser_->ExecuteCommandIfEnabled(command_id); 1544 return browser_->ExecuteCommandIfEnabled(command_id);
1533 } 1545 }
1534 1546
(...skipping 964 matching lines...) Expand 10 before | Expand all | Expand 10 after
2499 return; 2511 return;
2500 2512
2501 PasswordGenerationBubbleView* bubble = 2513 PasswordGenerationBubbleView* bubble =
2502 new PasswordGenerationBubbleView(bounds, 2514 new PasswordGenerationBubbleView(bounds,
2503 this, 2515 this,
2504 web_contents->GetRenderViewHost()); 2516 web_contents->GetRenderViewHost());
2505 views::BubbleDelegateView::CreateBubble(bubble); 2517 views::BubbleDelegateView::CreateBubble(bubble);
2506 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 2518 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
2507 bubble->Show(); 2519 bubble->Show();
2508 } 2520 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698