Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 /* | 1 /* |
| 2 * Copyright (C) 2012 Google Inc. All rights reserved. | 2 * Copyright (C) 2012 Google Inc. All rights reserved. |
| 3 * | 3 * |
| 4 * Redistribution and use in source and binary forms, with or without | 4 * Redistribution and use in source and binary forms, with or without |
| 5 * modification, are permitted provided that the following conditions | 5 * modification, are permitted provided that the following conditions |
| 6 * are met: | 6 * are met: |
| 7 * | 7 * |
| 8 * 1. Redistributions of source code must retain the above copyright | 8 * 1. Redistributions of source code must retain the above copyright |
| 9 * notice, this list of conditions and the following disclaimer. | 9 * notice, this list of conditions and the following disclaimer. |
| 10 * 2. Redistributions in binary form must reproduce the above copyright | 10 * 2. Redistributions in binary form must reproduce the above copyright |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 46 | 46 |
| 47 ColorChooserPopupUIController::ColorChooserPopupUIController(LocalFrame* frame, ChromeClientImpl* chromeClient, ColorChooserClient* client) | 47 ColorChooserPopupUIController::ColorChooserPopupUIController(LocalFrame* frame, ChromeClientImpl* chromeClient, ColorChooserClient* client) |
| 48 : ColorChooserUIController(frame, client) | 48 : ColorChooserUIController(frame, client) |
| 49 , m_chromeClient(chromeClient) | 49 , m_chromeClient(chromeClient) |
| 50 , m_client(client) | 50 , m_client(client) |
| 51 , m_popup(0) | 51 , m_popup(0) |
| 52 , m_locale(Locale::defaultLocale()) | 52 , m_locale(Locale::defaultLocale()) |
| 53 { | 53 { |
| 54 } | 54 } |
| 55 | 55 |
| 56 ColorChooserPopupUIController::~ColorChooserPopupUIController() | 56 ColorChooserPopupUIController::~ColorChooserPopupUIController() |
|
haraken
2014/10/07 03:31:29
Can we add ASSERT(!m_popup) ?
sof
2014/10/07 06:35:19
I'm quite likely missing some invariant, but why c
haraken
2014/10/07 06:43:59
Sorry, I was misreading the code. We cannot assume
| |
| 57 { | 57 { |
| 58 endChooser(); | |
|
tkent
2014/10/07 02:25:00
endChooser() touches m_chooser and m_popup, and bo
haraken
2014/10/07 03:31:29
Both ~ColorChooserPopupUIController and ~ColorChoo
sof
2014/10/07 06:35:19
That changes the order for the popup controller, c
haraken
2014/10/07 06:43:59
Does the order matter?
Not related to this CL, it
| |
| 59 m_chooser = nullptr; | |
| 60 } | |
| 61 | |
| 62 void ColorChooserPopupUIController::trace(Visitor* visitor) | |
| 63 { | |
| 64 visitor->trace(m_client); | |
| 65 ColorChooserUIController::trace(visitor); | |
| 58 } | 66 } |
| 59 | 67 |
| 60 void ColorChooserPopupUIController::openUI() | 68 void ColorChooserPopupUIController::openUI() |
| 61 { | 69 { |
| 62 if (m_client->shouldShowSuggestions()) | 70 if (m_client->shouldShowSuggestions()) |
| 63 openPopup(); | 71 openPopup(); |
| 64 else | 72 else |
| 65 openColorChooser(); | 73 openColorChooser(); |
| 66 } | 74 } |
| 67 | 75 |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 150 } | 158 } |
| 151 | 159 |
| 152 void ColorChooserPopupUIController::closePopup() | 160 void ColorChooserPopupUIController::closePopup() |
| 153 { | 161 { |
| 154 if (!m_popup) | 162 if (!m_popup) |
| 155 return; | 163 return; |
| 156 m_chromeClient->closePagePopup(m_popup); | 164 m_chromeClient->closePagePopup(m_popup); |
| 157 } | 165 } |
| 158 | 166 |
| 159 } // namespace blink | 167 } // namespace blink |
| OLD | NEW |