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

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

Issue 9703026: Makes the maximize/restore button handling (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Incorporate review feedback 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
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_non_client_frame_view_aura.h" 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h"
6 6
7 #include "ash/wm/frame_painter.h" 7 #include "ash/wm/frame_painter.h"
8 #include "ash/wm/workspace/frame_maximize_button.h"
8 #include "chrome/browser/themes/theme_service.h" 9 #include "chrome/browser/themes/theme_service.h"
9 #include "chrome/browser/ui/views/frame/browser_frame.h" 10 #include "chrome/browser/ui/views/frame/browser_frame.h"
10 #include "chrome/browser/ui/views/frame/browser_view.h" 11 #include "chrome/browser/ui/views/frame/browser_view.h"
11 #include "content/public/browser/web_contents.h" 12 #include "content/public/browser/web_contents.h"
12 #include "grit/generated_resources.h" // Accessibility names 13 #include "grit/generated_resources.h" // Accessibility names
13 #include "grit/theme_resources.h" 14 #include "grit/theme_resources.h"
14 #include "grit/theme_resources_standard.h" 15 #include "grit/theme_resources_standard.h"
15 #include "grit/ui_resources.h" 16 #include "grit/ui_resources.h"
16 #include "ui/base/accessibility/accessible_view_state.h" 17 #include "ui/base/accessibility/accessible_view_state.h"
17 #include "ui/base/l10n/l10n_util.h" 18 #include "ui/base/l10n/l10n_util.h"
(...skipping 27 matching lines...) Expand all
45 close_button_(NULL), 46 close_button_(NULL),
46 window_icon_(NULL), 47 window_icon_(NULL),
47 frame_painter_(new ash::FramePainter) { 48 frame_painter_(new ash::FramePainter) {
48 } 49 }
49 50
50 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() { 51 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() {
51 } 52 }
52 53
53 void BrowserNonClientFrameViewAura::Init() { 54 void BrowserNonClientFrameViewAura::Init() {
54 // Caption buttons. 55 // Caption buttons.
55 maximize_button_ = new views::ImageButton(this); 56 maximize_button_ = new ash::FrameMaximizeButton(this);
56 maximize_button_->SetAccessibleName( 57 maximize_button_->SetAccessibleName(
57 l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE)); 58 l10n_util::GetStringUTF16(IDS_ACCNAME_MAXIMIZE));
58 AddChildView(maximize_button_); 59 AddChildView(maximize_button_);
59 close_button_ = new views::ImageButton(this); 60 close_button_ = new views::ImageButton(this);
60 close_button_->SetAccessibleName( 61 close_button_->SetAccessibleName(
61 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); 62 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE));
62 AddChildView(close_button_); 63 AddChildView(close_button_);
63 64
64 // Initializing the TabIconView is expensive, so only do it if we need to. 65 // Initializing the TabIconView is expensive, so only do it if we need to.
65 if (browser_view()->ShouldShowWindowIcon()) { 66 if (browser_view()->ShouldShowWindowIcon()) {
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
344 } 345 }
345 346
346 SkBitmap* BrowserNonClientFrameViewAura::GetCustomBitmap( 347 SkBitmap* BrowserNonClientFrameViewAura::GetCustomBitmap(
347 int bitmap_id, 348 int bitmap_id,
348 int fallback_bitmap_id) const { 349 int fallback_bitmap_id) const {
349 ui::ThemeProvider* tp = GetThemeProvider(); 350 ui::ThemeProvider* tp = GetThemeProvider();
350 if (tp->HasCustomImage(bitmap_id)) 351 if (tp->HasCustomImage(bitmap_id))
351 return tp->GetBitmapNamed(bitmap_id); 352 return tp->GetBitmapNamed(bitmap_id);
352 return tp->GetBitmapNamed(fallback_bitmap_id); 353 return tp->GetBitmapNamed(fallback_bitmap_id);
353 } 354 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/launcher/chrome_launcher_delegate.cc ('k') | ui/views/controls/button/image_button.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698