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

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

Issue 10967036: views: Packaged app window icon should be system/generic icon, if icon is not set by default. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Created 8 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 unified diff | Download patch
« no previous file with comments | « no previous file | ui/views/widget/native_widget_win.cc » ('j') | 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/extensions/shell_window_views.h" 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/favicon/favicon_tab_helper.h" 9 #include "chrome/browser/favicon/favicon_tab_helper.h"
10 #include "chrome/browser/ui/tab_contents/tab_contents.h" 10 #include "chrome/browser/ui/tab_contents/tab_contents.h"
(...skipping 10 matching lines...) Expand all
21 #include "ui/base/hit_test.h" 21 #include "ui/base/hit_test.h"
22 #include "ui/base/l10n/l10n_util.h" 22 #include "ui/base/l10n/l10n_util.h"
23 #include "ui/base/resource/resource_bundle.h" 23 #include "ui/base/resource/resource_bundle.h"
24 #include "ui/gfx/canvas.h" 24 #include "ui/gfx/canvas.h"
25 #include "ui/gfx/image/image.h" 25 #include "ui/gfx/image/image.h"
26 #include "ui/gfx/path.h" 26 #include "ui/gfx/path.h"
27 #include "ui/views/controls/button/button.h" 27 #include "ui/views/controls/button/button.h"
28 #include "ui/views/controls/button/image_button.h" 28 #include "ui/views/controls/button/image_button.h"
29 #include "ui/views/controls/webview/webview.h" 29 #include "ui/views/controls/webview/webview.h"
30 #include "ui/views/layout/grid_layout.h" 30 #include "ui/views/layout/grid_layout.h"
31 #include "ui/views/views_delegate.h"
31 #include "ui/views/widget/widget.h" 32 #include "ui/views/widget/widget.h"
32 #include "ui/views/window/non_client_view.h" 33 #include "ui/views/window/non_client_view.h"
33 34
34 #if defined(OS_WIN) && !defined(USE_AURA) 35 #if defined(OS_WIN) && !defined(USE_AURA)
35 #include "chrome/browser/shell_integration.h" 36 #include "chrome/browser/shell_integration.h"
36 #include "chrome/browser/web_applications/web_app.h" 37 #include "chrome/browser/web_applications/web_app.h"
37 #include "ui/base/win/shell.h" 38 #include "ui/base/win/shell.h"
38 #endif 39 #endif
39 40
40 #if defined(USE_ASH) 41 #if defined(USE_ASH)
(...skipping 275 matching lines...) Expand 10 before | Expand all | Expand 10 after
316 ShellWindowViews::ShellWindowViews(ShellWindow* shell_window, 317 ShellWindowViews::ShellWindowViews(ShellWindow* shell_window,
317 const ShellWindow::CreateParams& win_params) 318 const ShellWindow::CreateParams& win_params)
318 : shell_window_(shell_window), 319 : shell_window_(shell_window),
319 web_view_(NULL), 320 web_view_(NULL),
320 is_fullscreen_(false), 321 is_fullscreen_(false),
321 frameless_(win_params.frame == ShellWindow::CreateParams::FRAME_NONE) { 322 frameless_(win_params.frame == ShellWindow::CreateParams::FRAME_NONE) {
322 window_ = new views::Widget; 323 window_ = new views::Widget;
323 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 324 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
324 params.delegate = this; 325 params.delegate = this;
325 params.remove_standard_frame = true; 326 params.remove_standard_frame = true;
327 params.use_system_default_icon = true;
326 minimum_size_ = win_params.minimum_size; 328 minimum_size_ = win_params.minimum_size;
327 maximum_size_ = win_params.maximum_size; 329 maximum_size_ = win_params.maximum_size;
328 window_->Init(params); 330 window_->Init(params);
329 gfx::Rect window_bounds = 331 gfx::Rect window_bounds =
330 window_->non_client_view()->GetWindowBoundsForClientBounds( 332 window_->non_client_view()->GetWindowBoundsForClientBounds(
331 win_params.bounds); 333 win_params.bounds);
332 window_->SetBounds(window_bounds); 334 window_->SetBounds(window_bounds);
333 // Center window if no position was specified. 335 // Center window if no position was specified.
334 if (win_params.bounds.x() < 0 || win_params.bounds.y() < 0) 336 if (win_params.bounds.x() < 0 || win_params.bounds.y() < 0)
335 window_->CenterWindow(window_bounds.size()); 337 window_->CenterWindow(window_bounds.size());
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after
651 ui::WindowShowState show_state) { 653 ui::WindowShowState show_state) {
652 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); 654 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state);
653 shell_window_->SaveWindowPosition(); 655 shell_window_->SaveWindowPosition();
654 } 656 }
655 657
656 // static 658 // static
657 NativeShellWindow* NativeShellWindow::Create( 659 NativeShellWindow* NativeShellWindow::Create(
658 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { 660 ShellWindow* shell_window, const ShellWindow::CreateParams& params) {
659 return new ShellWindowViews(shell_window, params); 661 return new ShellWindowViews(shell_window, params);
660 } 662 }
OLDNEW
« no previous file with comments | « no previous file | ui/views/widget/native_widget_win.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698