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

Side by Side Diff: athena/home/home_card_impl.cc

Issue 516643005: Adds the test expectations of home card bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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 | athena/home/home_card_unittest.cc » ('j') | athena/home/home_card_unittest.cc » ('J')
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 "athena/home/public/home_card.h" 5 #include "athena/home/public/home_card.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <limits> 8 #include <limits>
9 9
10 #include "athena/common/container_priorities.h" 10 #include "athena/common/container_priorities.h"
(...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after
244 void InstallAccelerators(); 244 void InstallAccelerators();
245 void UpdateMinimizedHomeBounds(); 245 void UpdateMinimizedHomeBounds();
246 246
247 // Overridden from HomeCard: 247 // Overridden from HomeCard:
248 virtual void SetState(State state) OVERRIDE; 248 virtual void SetState(State state) OVERRIDE;
249 virtual State GetState() OVERRIDE; 249 virtual State GetState() OVERRIDE;
250 virtual void RegisterSearchProvider( 250 virtual void RegisterSearchProvider(
251 app_list::SearchProvider* search_provider) OVERRIDE; 251 app_list::SearchProvider* search_provider) OVERRIDE;
252 virtual void UpdateVirtualKeyboardBounds( 252 virtual void UpdateVirtualKeyboardBounds(
253 const gfx::Rect& bounds) OVERRIDE; 253 const gfx::Rect& bounds) OVERRIDE;
254 virtual aura::Window* GetHomeCardWindowForTest() OVERRIDE;
oshima 2014/08/28 00:03:12 nit: can they be const?
Jun Mukai 2014/08/28 00:43:33 Done.
254 255
255 // AcceleratorHandler: 256 // AcceleratorHandler:
256 virtual bool IsCommandEnabled(int command_id) const OVERRIDE { return true; } 257 virtual bool IsCommandEnabled(int command_id) const OVERRIDE { return true; }
257 virtual bool OnAcceleratorFired(int command_id, 258 virtual bool OnAcceleratorFired(int command_id,
258 const ui::Accelerator& accelerator) OVERRIDE; 259 const ui::Accelerator& accelerator) OVERRIDE;
259 260
260 // HomeCardGestureManager::Delegate: 261 // HomeCardGestureManager::Delegate:
261 virtual void OnGestureEnded(State final_state) OVERRIDE; 262 virtual void OnGestureEnded(State final_state) OVERRIDE;
262 virtual void OnGestureProgressed( 263 virtual void OnGestureProgressed(
263 State from_state, State to_state, float progress) OVERRIDE; 264 State from_state, State to_state, float progress) OVERRIDE;
(...skipping 154 matching lines...) Expand 10 before | Expand all | Expand 10 after
418 SetState(HIDDEN); 419 SetState(HIDDEN);
419 original_state_ = VISIBLE_MINIMIZED; 420 original_state_ = VISIBLE_MINIMIZED;
420 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) { 421 } else if (state_ == VISIBLE_BOTTOM && !bounds.IsEmpty()) {
421 SetState(VISIBLE_CENTERED); 422 SetState(VISIBLE_CENTERED);
422 original_state_ = VISIBLE_BOTTOM; 423 original_state_ = VISIBLE_BOTTOM;
423 } else if (state_ != original_state_ && bounds.IsEmpty()) { 424 } else if (state_ != original_state_ && bounds.IsEmpty()) {
424 SetState(original_state_); 425 SetState(original_state_);
425 } 426 }
426 } 427 }
427 428
429 aura::Window* HomeCardImpl::GetHomeCardWindowForTest() {
430 return home_card_widget_ ? home_card_widget_->GetNativeWindow() : NULL;
431 }
432
428 bool HomeCardImpl::OnAcceleratorFired(int command_id, 433 bool HomeCardImpl::OnAcceleratorFired(int command_id,
429 const ui::Accelerator& accelerator) { 434 const ui::Accelerator& accelerator) {
430 DCHECK_EQ(COMMAND_SHOW_HOME_CARD, command_id); 435 DCHECK_EQ(COMMAND_SHOW_HOME_CARD, command_id);
431 436
432 if (state_ == VISIBLE_CENTERED && original_state_ != VISIBLE_BOTTOM) 437 if (state_ == VISIBLE_CENTERED && original_state_ != VISIBLE_BOTTOM)
433 SetState(VISIBLE_MINIMIZED); 438 SetState(VISIBLE_MINIMIZED);
434 else if (state_ == VISIBLE_MINIMIZED) 439 else if (state_ == VISIBLE_MINIMIZED)
435 SetState(VISIBLE_CENTERED); 440 SetState(VISIBLE_CENTERED);
436 return true; 441 return true;
437 } 442 }
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 instance = NULL; 508 instance = NULL;
504 } 509 }
505 510
506 // static 511 // static
507 HomeCard* HomeCard::Get() { 512 HomeCard* HomeCard::Get() {
508 DCHECK(instance); 513 DCHECK(instance);
509 return instance; 514 return instance;
510 } 515 }
511 516
512 } // namespace athena 517 } // namespace athena
OLDNEW
« no previous file with comments | « no previous file | athena/home/home_card_unittest.cc » ('j') | athena/home/home_card_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698